Transcoding Image Sequences into High-Quality Animations Suitable for Playback under Windows

 

John Clyne

Scientific Computing Division, NCAR

 

12/09/2002

Introduction

This document provides some guidance for transcoding a sequence of image files into high-quality animations, suitable for playback under MS Windows. The aim is to produce very high fidelity animations that may be played on an ordinary Windows laptop or desktop system, either in a standalone media player or embedded within a MS Powerpoint file. The priority is not to conserve disk space, bandwidth, or to be able to stream animations over the web.  Presented below is a brief comparison of a number of codecs and encoding methods for producing such an animation. The analysis that was performed was anything but exhaustive; a good solution was sought, not necessarily the best solution. It’s entirely possible that results differing from those observed could be obtained simply by tweaking appropriate parameters.

Encoders and Encoding Schemes

Three different encoding/encoding-schemes combinations were examined:

 

 

For a variety of reasons, the WME9 encoder seems to be the best option for most, but not all cases. Trade offs of the various schemes are presented below, followed by step-by-step instructions for conversion of an image sequence to WME9’s video format file, .wmv.

 

Some observations applicable to all the encoders:

 

DIVX/MPEG4

DivX is an open source mpeg4 codec and associated collection of video playback and recording tools. The software has been ported to linux, windows, and MacOS, and is claimed to have a user base of 60 million people (I read it on the web so it must be true).

 

An example DivX animation is available here.

 

The good

 

  1. The DivX recorder will accept a sequence of image files as input. Most other tools won’t.
  2. The software is free and the source is available.
  3. Runs under MacOS and Linux

           

The bad

 

  1. Playback doesn’t seem to be able to keep up with the native rate of 30 fps (frames are dropped on my crusty old Dell laptop).
  2. A stock windows machine won’t be able to play a DivX created file without downloading a decoder from DivX.

           

Adobe Premier/Ligos/MPEG2

MPEG2 is the encoding standard used by DVD’s. It’s a lossy format, like MPEG4, but not quite as lossy. So in theory MPEG2 encoded material should look better than MPEG4.

 

The good

 

  1. The quality, particularly for high-frequency information (abrupt color transitions) is quite good, almost indistinguishable from uncompressed imagery in some instances.

 

The bad

 

  1. Encoders for MPEG2 are not free. The Ligos encoder cost a couple hundred dollars. Adobe Premier, is even more expensive (~$600). However, there may be less costly alternatives to Premier.
  2. Decoders for MPEG2 are generally bundled with DVD players. So if you don’t have a DVD player, you may have to purchase a decoder.
  3. There appears to be a fixed and very limited number of resolutions and aspect ratios supported by MPEG2.
  4. The Ligos encoder appears to map colors into a video-safe space. Hence, the colors in your encoded material may look very different from the source.
  5. Better quality means of course larger files.

 

An example MPEG2 is available here. Note the goofy aspect ratio. What happened to the colors? But the text looks damn good.

WME9/MPEG4??

Windows Media Encoder 9 is a newly released product from the Evil Empire. It’s presently in beta. WME9 appears to support and provide multiple codecs, but of course, because it’s M$, nothing is documented and WME9 is essentially a black box.

 

The good

 

  1. The encoder exposes a variety of configuration parameters and it’s possible to get very high quality encodings, better then DivX in all regards. Of course with different DivX parameter settings, equally high-fidelity encodings may be possible with DivX.
  2. There are no restrictions on output resolution or aspect ratios
  3. Since it’s an MS creation I suspect the chances that it will work on a variety of MS systems is greater than for the other methods.

 

The bad

 

  1. WME9 won’t ingest image sequences directly. A movie file of some format is required.
  2. Its from Microsoft

 

A “very high quality” WME9 file is available here. A “high definition quality video” WME9 file can be found here.

Conversion to Windows Media Player (mpv) Format

If you don’t already have it, download the Windows Media Encoder 9 encoder from the M$ web site. Note, you’ll need DirectX 8.1 run-timer environment installed on your machine, also freely available from M$’s web site.

 

Unfortunately WME9 does not ingest image files. You have to provide WME9 with a movie file for input. And if you want a high quality encoding, you’ll need to provide a lossless movie file. Uncompressed AVI files seem to work just fine. You can convert an image sequence into an uncompressed AVI file either by using QuickTime Pro (available from Apple for $30), or under IRIX using dmconvert. Alas, one of the shared libs dmconvert relies on is broken in the present version of IRIX. To get around this problem, add /usr/local/lib/irix6.5.9  to your run-time library search path. E.g. under csh:

 

% setenv  LD_LIBRARY_PATH /usr/local/lib/irix6.5.9/

 

Once you’ve got your search path set up, invoke dmconvert with something like:

 

dmconvert -v -f avi -p video,comp=none \

myimages.????.rgb mymovie.avi

 

Now you’re ready to transcode your .avi file into a .wmv file. The WME9 encoder has a wizard  to guide you though the process. Use the following steps:

 

  1. Fire up WME9
  2. Select ‘convert a file’ from the wizard. Click ok.
  3. Set your input source to your .avi file and your output to whatever you want. Click next.
  4. Select either ‘File download’ or ‘File archive’ from the next window. File archive will give slightly better results and a correspondingly larger file size. However, File archive will not allow you to change the output resolution. Click next.
  5. If you selected File download in the previous step, make sure the video encoding is set to ‘high definition quality video’. If you selected File archive, select ‘highest quality video’. Click next.
  6. Click next.
  7. If you selected File archive, click finish and conversion will begin. If you selected File download, uncheck the ‘begin converting’ box, click finish, and then go to the Properties/Video Size menu. Change the output video size to whatever you want (by default it’s 1280x720). Click on ‘Start Encoding’.

Acknowledgements

Thanks to fellow VETS staff members Fred Clare, Joey Mendoza, and Tim Scheitlin for their assistance in testing the various codecs.