Making MPEG Movies

 

This page focuses on creating MPEG-1 movies (video only) using NERSC and LBNL UNIX computers. The resultant movies can be played using any MPEG-1 player directly or from a web page. This page describes what you need to consider before you make you make your movie; two methods for creating a movie; and some advanced tips for the more adventuresome user. Note: The example movies shown in this page do not reflect the normal quality of output from the graphics & visualization packages used. We picked the worst way to create the images and movies to illustrate what you should not do.

Creating a movie is at least a two step process. First you need to create the individual frames that will comprise your movie. You then need to combine these images to create a movie that you and others can play back on a computer. Almost all computer-generated movie formats use a compression algorithm. Compression is necessary because of size constraints (size of image times the number of the images to make a movie (30 frames per second) equals hundreds to thousands of megabytes). The MPEG-1 standard is one movie format that supports a very good compression scheme. Others possible formats are Apple's QuickTime, and Microsoft's AVI. This page focuses on MPEG because most platforms support MPEG-1 players and there are lots of plug-ins available for web browsers.

When you decide to make your movie, be prepared to spend more time on creating the movie than you first thought or you would like to. Movie making is an art. There is no cookbook that will tell you exactly what you need to do to create your perfect movie. Factors that contribute to the problem is that the final movie size may be the most important factor to one user, another user is more interested in the highest-quality image, and yet another is interested in portability.

This page is not a course on creating videos nor are we experts in this area. If you are interested in learning more about video and various standards like MPEG, check out the web and books and magazines on video, it's creation, and deployment.

Things to consider before you make the images for your movie:

 Movie Creation:

We describe two ways of creating an MPEG-1 movie. The first method uses SGI software that is available on escher.nersc.gov and many SGI workstations. The SGI tool, mediaconvert is very easy to use if you follow the steps below exactly and gives you a lot of control over the finished movie. For example, you can do smoothing on each image. The second method describes using mpeg_encode. Mpeg_encode was written at UC Berkeley, is free, and can be installed on your own computer. Check out http://bmrc.berkeley.edu/projects/mpeg/ for more information on mpeg_encode.

Which one you use is up to you. Try out both if you can and see which one creates the movie quality and size you want. Here are two sample movies that show how the two encoders worked with small bouncing balls with their default settings for compression. In this case, mediaconvert did a better job than mpeg_encode but created a larger file (490K versus 90K). mpeg_encode did a better job when the balls were made a little larger and the colors were de-saturated. Movie 1, notice the balls are not distorted. Movie 2, the balls are distorted.

With both encoders you can play with changing the compression scheme by modifying the number of I, P, and B frames. The definition of these frame types are detailed at the Berkeley site mentioned in the previous paragraph or any article on MPEG. Basically, the more B and P frames you specify, the more compression.

Movie Making Method 1: SGI TOOLS

mediaconvert can convert most image file formats (TIFF, JPEG, AVS, PPM, etc.) and various movie formats to MPEG-1. The GUI interface is very particular on how you specify the images. Follow the steps exactly and make sure you type everything in correctly. The error messages disappears too fast to be useful. If you can't get it to work, create an intermediate movie first (makemovie -o /tmp/outfile.sgi -f sgi -r 30 -c rle24 files*) and than convert this movie to MPEG using mediaconvert. (The GUI interface works better when video is imported.)

% mediaconvert &

 

Movie Making Method 2: mpeg_encode:

%module load mpeg_encode.

% mpeg_encode <name of parameter file>

 

 Useful Tools to know about:

The Visualization Group's software page describes many useful image conversion and display tools and how to access them.

Convert from a TIFF file to a JPEG file.

imconv 0000.tif 0000.jpg

On NERSC (escher.nersc.gov) and LBNL machines you can convert your CGM movie file (called gmeta in this example) into JPEG files all at once by doing:

module load ncar

ncgm2jpeg gmeta

 

Advanced Tips:

The below examples and ideas are for the more adventuresome user.