AirWare   On-line Reference Manual

  Release Level 5.4
  Release Date 2008 10
  Revision Level 1.0

Model Output Animation

Wherever models produce a time series of results (24, 48, 72, or 24*365 hours) these results can be converted to and viewed as an MPG animation, using a Java applet as player.

Creating PNG images and MPG movies from model results matrix data

uses: mpeg2 MPEG-2 Encoder / Decoder, Version 1.2, July 19, 1996, Copyright (c) 1996 MPEG Software Simulation Group, mssg@mpeg.org (author contact), http://www.mpeg.org/MSSG/

The utilities mpeg2encode / mpeg2decode are used to convert PNG into MPG. Contains implementation of an ISO/IEC DIS 13818-2 codec and converts uncompressed video frames into MPEG-1 and MPEG-2 video coded bitstream sequences and vice versa. The codec is used by 'convert' program for encoding/decoding. mpeg2encode and mpeg2decode binaries are located in /usr/bin/

Databases:

  • AIRMATRIX.MATRIX_DATA
  • AIRMATRIX.MATRIX_METADATA

Function:

  • /var/www/cgi-bin/matrixmpg.cgi
Usage:   matrixmpg.cgi [-?] [-f|--db-config STRING] [-i|--matrix-id INT] [-?|--help] [--usage]
  • input options: matrixID and db config file
  • reads matrix MetaData for given matrixID
  • sets image options (WIDTH, HEIGHT, BACKGROUND MAP,...)
  • uses MatrixImageCreator() functions to create png images (source directory mp2:/d0/acatk/libsrc/libmetamatrix/)
  • creates png images for all matrix layers and timesteps
  • uses background map saved as PNG images named mapserver$IMAGEMAP in
  • /var/www/html/templates/metamatrix/data
  • converts png images into mpg animation using 'convert' program
  • saves png files into PNG_OUT_DIR defined in MM5.MM5_scenario (/var/www/html/templates/mm5/img)
  • saves mpg files into MPG_OUT_DIR defined in MM5.MM5_scenario (/var/www/html/templates/animations/mpg)

Utility program:

  • /usr/bin/convert
  • converts list of png images sorted by timestep in ascending order into a mpg animation
  • program belongs to package ImageMagick 5.4.7 web:http://www.imagemagick.org

ANIMATIONS DISPLAY:

  • html directory:   /var/www/html/templates/animations
java applet:
  • /var/www/html/templates/animations/mpeg_java-3.6
  • Java class files for the MPEG decoder and player:   /var/www/html/templates/mm5/php
The Java applet is installed in a php file for animations display   (var/www/html/templates/animations/php/animation_matrix.php)

The parameters that can be controlled within the applet are:

  • WIDTH of animation,
  • HEIGHT of animation,
  • DELAY describes the delay (in ms) between 2 images during animation (default: 50).

    Animation control:

    • oneleft() - one step back
    • stopanim() - stop
    • oneright() - one step forward
    • moreright() - play animation
    The movie files are in   /var/www/html/templates/animations/mpg/
    naming convention:   movie.$matrixID.$layer.mpg

    The class "MPEG_Play" is the main applet. Its work is divided into 2 phases:

    1. scanning: A "ScanThread" and an "AnimatorThread" work concurrently The "ScanThread" produces a list of frames (images) and informes the "AnimatorThread" if a frame is decoded. The number of the frame (timestep) is displayed under the loaded frame.
    2. display: By means of the method "Element.close_chain()" the list of frames is closed to a ring of frames. After that the frames are displayed. The "ScanThread" dies and the "AnimatorThread" begins to display the frames.

  • © Copyright 1995-2016 by:   ESS   Environmental Software and Services GmbH AUSTRIA | print page