CSC 418/2504 Fall 2001: Creating an MPEG file
- 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.
- edit
"mpeg.dat"
, and change the second line to read
"anim*.ppm [001-nnn]"
, where "nnn"
is the
highest frame number recorded.
- on CDF, type
"mpeg_encode mpeg.dat"
to create the
movie.
- 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:
- Playing back the movie:
- On CDF, typing "xanim -Ae anim.mpg" should play the
movie. The "-Ae" flag disables audio, otherwise the
program may skip video frames to keep up with the audio.
Type "man xanim" for more information.
- On MS Windows, double-click the MPEG file, which should
pop up Media Player or RealPlayer.
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