CSC 418/2504 Fall 2001: Creating an MPEG file

  1. run the program, and record all the frames in PPM files (click the "recording" checkbox). This will create files named "animXXX.ppm", where "XXX" is the frame number.
  2. edit "mpeg.dat", and change the second line to read "anim*.ppm [001-nnn]", where "nnn" is the highest frame number recorded.
  3. on CDF, type "mpeg_encode mpeg.dat" to create the movie.
  4. on MS-Windows, there are several mpeg encoders available. There is called cmpeg at: For the files produced by the sample code, you can use the following auxiliary files with cmpeg:
  5. Playing back the movie:
Warning! On CDF, you may run out of disk space. Keep the window small, to keep the PPM files small. You can also convert PPM files to JPG using cjpeg. The following Perl script may help:
#!/local/bin/perl
for (1..60) {
  system sprintf "cjpeg anim%03d.ppm > anim%03d.jpg",$_,$_;
}
If you do, you must change lines 2 and 4 of mpeg.dat .


Alejo Hausner, Dept of Computer Science, University of Toronto
Last modified: Sat Nov 24 10:31:30 EST 2001