- Overview
- Container Formats
- Creation Software
- Playback Software
- (g)mplayer (Linux)
- PowerPoint (Windows, Mac)
- xanim (Linux)
1. Overview
We summarize only those formats and applications recommended
for scientific visualizations where accuracy in color and clarity are critical.
Typical visualizations include pseudo-colored contours and surfaces as
well as text labels.
TIFF and PNG images should be used whenever possible as input
to the suggested creation programs (images that aren't just conversions of JPEG images!).
In other words, the images should have been either "screen-captured", or
converted from PostScript files. More information on image conversion
can be found
here.
Also, animated GIFs are de-emphasized due to their limited colormaps.
The general animation creation process is illustrated below.
Experience has shown that no single animation format is sufficient for every purpose,
so we listed some common scenarios and recommended formats and tools to use to encode them.
- If it's for a PowerPoint presentation on a Windows laptop, use MPEG-4 with the MSv2 codec. See mkmpeg4.
- If it's for a PowerPoint presentation on an Apple (Mac) laptop, use Quicktime with the Sorenson Video 3 codec. See Toast.
- If it's meant to be downloaded from your webpage, use Quicktime with the Sorenson Video 3 codec. See Toast.
- If it's an animation reqested by the news (TV), use MPEG-4 with the DivX codec. See Toast.
- If it's an animation reqested by a production or special-effects studio, use Quicktime with the Animation codec. See makemovie.
2. Formats
Many variants exist for each format due to the modularity and plethora of compression schemes.
These compression schemes are commonly referred to as CODECS (COmpressors/DECompressors).
So it no longers suffices to say that your animation is just an AVI, because
the viewer may not have the necessary plug-ins in their playback software.
Saying "an Indeo 5 AVI" is more appropriate, if that was the compression chosen.
The following table has format/codec pairs selected by GFDL for their ability to preserve
24-bit colormaps throughout an animation's frames while also keeping smoothing (blurring)
to a minimum, if any. As you see, there are many cases where plug-ins must
be installed in advance by a playback viewer's adminstrator. GFDL recommends
mplayer for playback and mkmpeg4 for animation creation
targeting MS Windows platforms. For Mac OS X systems, DivX is recommended.
Examples reflecting typical animation styles created at GFDL are available
to compare each format/codec's visual output quality and file size.
Example 1 | Example 2 |
PNG Images TAR.GZ (232 KB) | PNG Images TAR.GZ (3 MB) |
Format | Compression | Creation Software | Playback Portability |
Example 1
(in bytes) |
Example 2
(in bytes) |
||||
---|---|---|---|---|---|---|---|---|---|
mplayer | PowerPoint 2000 | PowerPoint 2003 | PowerPoint OSX | xanim | |||||
MPEG-4 | DivX | Toast | Yes | Yes1 | Yes1 | Yes1 | - | 382,804 | 398,732 |
Quicktime | Sorenson Video 3 | Toast | Yes | Yes3 | Yes3 | Yes | - | 401,014 | 257,470 |
MPEG-4 | MS v.2 | mkmpeg4 | Yes | Yes | Yes | - | - | 843,650 | 373,110 |
AVI | Ligos Indeo 5 | MainActor | Yes | Yes2 | Yes2 | - | Yes | 839,016 | 666,616 |
QuickTime | Animation | makemovie | Yes | Yes3 | Yes3 | Yes | Yes | 965,538 | 7,695,942 |
GIF | LZW | gifmerge | - | Yes | Yes | Yes | Yes | 369,073 | 1,651,427 |
AVI | None | mkavi | - | Yes | Yes | Yes | Yes | 20,275,968 | 22,119,216 |
1 | Requires (free) plug-in from http://www.divx.com |
2 | Requires (free) plug-in from http://www.free-codecs.com/download/Ligos_Indeo_Codec.htm |
3 | Requires HTML embedding within a slide and plug-in as explained here. |
AVI (Audio Video Interleaved) is a format first developed for the PC (namely the Windows OS). It also allows an interleaving of the audio and video tracks. Refer to the table above for creation and playback software.
This format basically consists of a number of GIF images stored in one file with inter-frame timing information. Each image can have its own colormap (limited to 8-bit just like regular GIF images) or all the images can share a global colormap. It is really designed for simple animations on Web pages (using Netscape 2.0 or higher) because there is no frame-to-frame compression, just the usual LZW compression for each individual frame. Also, players like XAnim always buffer all the images in memory which severly limits its usefullness with large animations. The GIFMerge and WhirlGIF programs provide a way to create them on the SGI. Here is a source of more information on GIF89a animation.
MPEG-4 (a standard from the Motion Picture Experts Group) is an unusual
format when compared to the other types.
In general it is actually a standard for multimedia applications, with
video compression being only one part of many.
One of the things that makes it so unique is that you can actually
specify how much compression you want for an animation sequence using
adjustable "quality settings". Briefly, the basic idea of MPEG encoding
is predicting motion between images using three types of "frames".
They are I (intra) frames, P (predicted) frames, and B (bidirectional) frames.
Each source image is associated with a frame type which determines the
algorithm used to encode it into the animation. What this means is that
the quality setting can be individually specified for each of these frame
types which affects their encoding algorithms and allows tremendous control
over the final animation. In practice, setting them all to the same value
will usually produce reasonable results.
QuickTime is a format first developed for the Macintosh computer. It allows a high-quality audio track to be synchronized with the video. The basic compression scheme supported by GFDL is Run Length Encoding (RLE, or Animation), which is loss-less when used with a 100% quality creation parameter. Apple is the official source of QuickTime information (including samples) on their WWW pages. Refer to the table above for creation and playback software.
3. Creation Software
DESCRIPTION :animate is a simple command-line program to preview, but not save to disk, an animation using an image sequence. It is just one of many useful programs bundled with ImageMagick, the free, open-source collection of imaging tools.
PLUSES :
- Simple and fast.
- Works with any image file format.
- Preview only; can't generate an animation file. Note, ImageMagick does offer convert for creating animated GIFs.
-
On a linux workstation, animate TIFF images
at 2 frames-per-second, rotate 90 degrees and resize to 1280x720:
animate -delay 50 -rotate 90 -geometry 1280x720! *.tif
- Right-clicking the animation will display a pop-up menu. From there the playback direction can be change and the speed can be increased or decreased.
- ImageMagick website (http://www.imagemagick.org/)
- See the man page
GIFMerge is a program for assembling a number of GIF images into a GIF89a animation file usually for direct display on WWW pages. It allows the specification of inter-frame timing for precise control over how long each frame is shown when played back. It also has the ability to specifiy one of the colors as being "transparent" so that backgrounds can show through that color when the animation is on a WWW page. The transparent color is specified as an index number (0-255; the background color is frequently 0) or with the actual RGB components.
PLUSES :
- Precise inter-frame timing control.
- The GIF format is obsolescent.
-
Here is an example of GIF files assembled into a looping animation
gifmerge -50 -l0 *.gif > anim.gif
The "-50" option specifies a 1/2 (or 50/100) second delay between images and the "-l0" option specifies that the animation should loop infinitely when on a WWW page. If the "-l" is not specified at all then the web browser will play the animation only once.
- Project website with extensive examples (http://www.the-labs.com/GIFMerge/)
MainActor is a commercial, graphical program for arranging and encoding image sequences into some (older) AVI animation formats. Each image in the sequence is assigned a duration for display, which can be unique or global. This can be useful for images that contain longer passages of text, thus allowing a viewer to read during playback without pausing the animation itself.
MINUSES :
- Only one license available at GFDL.
- Supports only legacy, lower-quality animation codec compressors, such as Indeo 5.
- Must be used on a specific Windows computer at GFDL (media, room 316), and not remotely.
- The image quality with the Indeo AVI format is poor compared to the other formats. See the examples above if you're not convinced.
- Instructions on how to make an AVI with MainActor.
- mkmpeg4 is recommended over MainActor, since it uses higher-quality and more portable animation encoders.
-
TIFF images are not supported. PNG images are recommended. Convert your
images on a linux workstation with
foreach f (*.tiff) convert $f $f:r.png end
- Product website (www.mainconcept.com/)
makemovie is an old, but still useful command found on IRIX machines. It will create a loss-less QuickTime animation from the command-line for a sequence of images.
PLUSES :
- Simple command-line interface.
- Output is loss-less with 100% setting, therefore output is good as, but smaller than uncompressed AVI.
- Output is still large despite its run-length encoding compression.
- QuickTime is NOT seamlessly portable with Windows PowerPoint, but possible! See below.
- It must be run on GFDL's IRIX-based onyx1 host. If your list of files is too long for the ls command, consider using mkavi on your workstation or xc1 along with the find command to generate a file that lists your images.
-
While logged on onyx1 at GFDL:
makemovie
-
Create a 10 frames-per-second loss-less compressed QuickTime animation from a sorted list
of TIFF images:
makemovie -o out.mov -f qt -c qt_anim -r 10 -q 1.0 -p 1.0 -k 1 `ls -c1 *.tif | sort -n`
-
Create a 10 frames-per-second uncompressed QuickTime animation (preferred by film studios) from a sorted list
of SGI images:
makemovie -o out.mov -f qt -c none -r 10 `ls -c1 *.sgi | sort -n`
-
Certain flavors of PNG images are not supported (makemovie is that old!).
PNG images generated by VTK will work, however. If not, convert your PNG images to TIFF like so:
foreach f (*.png) convert -compress none $f $f:r.tif end
- You can play QuickTime in PowerPoint, in Windows. Just embed HTML within a slide and download a plug-in as explained here, assuming you have write privileges on the computer.
- Refer to the man page
mkavi is a Perl script that invokes MATLAB to create an uncompressed AVI animation. Since MATLAB encodes the image sequence, any image format can be used as input and the script can be run on any platform supporting MATLAB. Since the output is uncompressed, the image quality is not compromised, however, the file size could be potentially too large to be distributed practically. Nevertheless, it is the most portable format for playback and can be used as a reference for comparing other animation compression schemes.
PLUSES :
- No degradation in image quality.
- Very portable for playback.
- Easy to use command-line interface.
- Works on any machine with MATLAB.
- Accepts any image format as input excluding PostScript.
- Accepts list of images from shell command-line or from a text file.
- Creates very large output, may be too large for the Web, but managable for storage on CD or DVD.
- While logged onto a linux or irix machine:
/home/rsz/pub/mkavi
-
Create an animation at 10 frames-per-second by supplying a sorted file listing
of TIFF images:
/home/rsz/pub/mkavi -f 10 `ls -c1 *.tif | sort -n` output.avi
-
Verbosely create an animation at 10 frames-per-second by supplying a file listing
your PNG images:
# Create the file listing your images (if `ls` fails with "Argument list too long"). find /net2/rsz -name '*.png' | sort -n > tmp.txt /home/rsz/pub/mkavi -v -f 10 tmp.txt output.avi
- mkavi script
-
Usage instructions:
Makes an AVI movie with MATLAB from an image sequence. mkavi.pl [-v] [-f fps] files fileout -v Verbose -f Frames per second Examples: mkavi.pl img*.png movie.avi mkavi.pl `ls -c1 img*.png | sort -n` movie.avi
mkmpeg4 is a Python script for creating MPEG-4 animations with MEncoder, the encoder shipped with the free, open-source media player MPlayer. Also, every input image is first converted to an RGB format with ImageMagick before encoding. mkmpeg4 was designed to use either the MS MPEG-4 v.2 or DivX compression schemes because of their output's image-quality, small size and portability. The predefined parameters chosen for MEncoder best suit scientific visualizations, but may be customized by the user by simply editing the script.
PLUSES :
- Easy to use command-line interface.
- Works with any image format.
- With MS v.2 compression, will play on Windows computers without downloading additional plug-in software.
- Sharp image quality and color preservation.
- Creates very small files.
- Image quality will never be 100% accurate as an uncompressed AVI.
HOW TO INVOKE :
-
While logged on a linux workstation at GFDL, run
/home/rsz/pub/mkmpeg4
HINTS :
-
Get usage instructions with
/home/rsz/pub/mkmpeg4 -h
-
Create an MS MPEG-4 animation at 8 frames-per-second by supplying a sorted list of images
/home/rsz/pub/mkmpeg4 -f 8 -o out.mpg `ls -c1 *.png | sort -n`
INFO / DOCUMENTATION :
- mkmpeg4 script
-
Usage instructions:
usage: mkmpeg4 [options] image1 ... imagen example: mkmpeg4 -v -f 8 -o tmp.mpg `ls *png` Creates an MPEG animation from a sequence of images. The input images can be any format other than TIFF with ZLIB compression. By default, the MS-MPEG4 v.2 codec is used so it will playback in MS PowerPoint 2000, 2003, MS Media Player 9+, MPlayer and Mac OS X QuickTime Player (if the Mac MS-MPEG4 codec is installed). DivX output can be used instead of MS-MPEG4v2 with the [-d|--divx] switch. Note, a file output extension of .mpg is enforced due to a playback bug with PowerPoint. Version 0.1 Remik.Lastname@noaa.gov where Lastname = Ziemlinski options: -h, --help show this help message and exit -bBITRATE, --bitrate=BITRATE bitrate (defaults to 2^23 = 8388608) -d, --divx enable DivX codec instead of MS-MPEG4v2 -fFPS, --fps=FPS frames per second (defaults to 10) -oFILE, --out=FILE output filename (REQUIRED) -p, --params2 use different DivX compression parameters to reduce artifacts -v, --verbose shows progress
Toast is a commercial program meant for DVD authoring and duplication, however it's also capable of digital movie conversion. One of the higher quality codecs that it supports is DivX 6 and should be used over all others offered by Toast if the audience supports the format, otherwise use Sorenson Video 3. With the proper settings, the DivX codec may be very good at compressing your animations to small files while also remaining compatible to all the major operating systems. This is GFDL's recommended tool to use for animations meant for general viewing on Max OS X systems, but is equally suitable for Windows, Linux and PowerPoint hosts.
PLUSES :
- Offers many tuning parameters for the DivX movie exporter so you can trade-off file size with image quality.
- DivX output plays directly in PowerPoint, but the file name must end with the extension .mpg.
- Using the Sorenson codec is very easy because parameters can be set automatically.
- Animation resolutions beyond 1280x720 are not supported for DivX output.
- Image sequences can't be used as input to Toast. Instead, an intermediate animation format must be used, such as Quicktime with lossless compression (see makemovie).
- Can't be scripted for convenient automation by a remote user.
- Toast is only available internally at GFDL in room 104 on the PowerMac G4 workstation. This DivX step-by-step guide should be used for first-time users. A similar Sorenson Video 3 step-by-step guide is also available.
- Internal step-by-step guide to create DivX animations.
- Internal step-by-step guide to create Sorenson Video 3 animations.
WhirlGIF is a program for assembling a number of GIF images into a GIF89a animation file usually for direct display on WWW pages. It allows the specification of inter-frame timing for precise control over how long each frame is shown when played back. It also has the ability to specifiy one of the colors as being "transparent" so that backgrounds can show through that color when the animation is on a WWW page. The transparent color is specified as an index number (0-255; the background color is frequently 0) or with the actual RGB components.
PLUSES :
- Precise inter-frame timing control.
- The GIF format is obsolescent.
-
Here is an example of GIF files assembled into a looping animation
whirlgif -trans #a7a7a7 -time 10 -loop 0 -o led_anim.gif *.gif
The "-trans #a7a7a7" option specifies what color should be considered as transparent. The "-time 10" option specifies a 1/10 (or 10/100) second delay between images. The "-loop 0" option specifies that the animation should loop infinitely when on a WWW page. If the "-loop" is not specified at all then the web browser will play the animation only once. Finally, the "-o" option specifies the name of the output animation.
- Project website (http://www.danbbs.dk/~dino/whirlgif/)
- See the man page
4. Playback Software
DESCRIPTION :MPlayer is a free, open-source program targeted for the Linux platform. It is well known in the linux community and supports virtually every codec compression scheme. A graphical version is also available with customizable "skins" that alter the interface's look-and-feel. It also isn't limited to just playing video, but other media such as MP3 and CD.
PLUSES :
- Supports virtually every animation format.
- Has 2 interfaces, a simple command-line or a customizable graphical one.
- Allows for playlists so that several animations can play after one another.
- Supports looping, fullscreen mode, and variable playback speed.
- Can't view animations frame-by-frame. The seek resolution is limited to either 1 second intervals or 1% of the total-running length.
- Looping repositions the playback window to the center of the screen when not running in fullscreen mode.
-
On a linux workstation:
/home/rsz/pub/linux/mplayer/bin/mplayer # graphical version /home/rsz/pub/linux/mplayer/bin/gmplayer
-
With an infinite loop, and at 1/4 the original frames-per-second speed and full-screen:
mplayer -loop 0 -speed .25 -fs movie.avi
-
Using a custom playback width 1280 and height 720:
mplayer -x 1280 -y 720 movie.avi
- You can extract a few or all of the frames from a movie to either
PNG or JPEG:
# first 10 frames exported to JPEG mplayer -frames 10 -vo jpeg path/to/movie.mov # all frames exported to PNG; optional -z compression (0 none, 9 maximum) mplayer -vo png -z 1 path/to/movie.mov
For FLI/FLC movies, you can use the command unflick to extract images to PPM format, which can then be converted with convert. -
The STDOUT echo during playback can be superfluous, so alias the
command:
# C-Shell mplayer ferret.mov 1 >& /dev/null # BASH, SH mplayer ferret.mov 1 > /dev/null 2>1
- Linux
# select GCC that isn't 2.96 setenv CC /net2/rsz/linux/gcc/bin/gcc ./configure --with-codecsdir=/home/rsz/pub/linux/mplayer/codecs \ --enable-gui \ --prefix=/home/rsz/pub/linux/mplayer/MPlayer-1.0pre5 make make install make clean Download a font from the MPlayer website and unpack into /home/rsz/pub/linux/mplayer/MPlayer-1.0pre5/share/mplayer/font cd /share/mplayer/font cd mkdir .mplayer cd .mplayer ln -s /home/rsz/pub/linux/mplayer/MPlayer-1.0pre5/share/mplayer/font .
- See the man page
PowerPoint is not a playback viewer per se, but is often used for embedding animations, and as such raises many playback portability issues. PowerPoint does playback many MS accepted formats, plus others when plug-ins are available. An animation can be scaled and looped within PowerPoint, but lacks any seek capabilities, other than "rewind".
MINUSES :
- To play DivX (MPEG-4), QuickTime, or Indeo AVIs, free plug-ins must be installed.
- The Mac OS X version does not play MS MPEG-4 v.2 animations.
- Available in the GFDL rdesktop terminal client.
-
To insert an animation,
go to the slide that will contain the animation.
Select from the menubar
Insert | Movies and Sounds | Movie from File...
Right-clicking the animation will bring up a menu with Edit Movie Object. Select this item to (un)set a checkbox for continuous animation looping. -
Free downloadable plug-ins:
DivX (MPEG-4) http://www.divx.com Ligos Indeo 5 (AVI) http://www.free-codecs.com/download/Ligos_Indeo_Codec.htm - QuickTime requires HTML embedding within a slide and plug-in download as explained here.
- Embedding HTML and Applets is explained here.
- Within PowerPoint, press F1 for general help
xanim is a legacy program with a GUI control panel. It plays only older animation formats such as QuickTime (Animation) and uncompressed or Indeo 5 AVIs. It's GUI does allow frame-by-frame seeking in an intiutive fashion plus variable speed control.
PLUSES :
- Frame-by-frame seeking.
- GUI speed control.
- Reverse playback.
- Plays only older animation formats, such as QuickTime (Animation) and uncompressed or Indeo 5 AVIs.
-
To play an animation just enter:
xanim file.mov
-
To allow scaling of the window during playback (by dragging its border):
xanim +ASr file.mov
-
To set the playback window size to 1280x720:
xanim +ASx1280 +ASy720 file.mov
- See the man page
- Project website