Converting ppm files to mpeg

From Gerris

(Difference between revisions)
Jump to: navigation, search
Revision as of 05:20, 17 July 2007
203.58.241.190 (Talk)
(added more URLs)
← Previous diff
Revision as of 05:42, 17 July 2007
GeordieMcBain (Talk | contribs)
(added links for Totem & mplayer)
Next diff →
Line 15: Line 15:
$ sudo cp src/mpeg2dec/mpeg2decode /usr/local/bin $ sudo cp src/mpeg2dec/mpeg2decode /usr/local/bin
-The resulting MPEG file can then be played with ImageMagick, Totem, mplayer, &c.+The resulting MPEG file can then be played with ImageMagick, Totem [http://www.gnome.org/projects/totem], mplayer [http://www.mplayerhq.hu], &.
As suggested in the tutorial, the MPEG file is much smaller than the PPM; here it's 1.9M cf. 85M. As suggested in the tutorial, the MPEG file is much smaller than the PPM; here it's 1.9M cf. 85M.

Revision as of 05:42, 17 July 2007

As suggested in the tutorial [1] multiframe ppm image files can be converted to mpeg format using Imagemagick's [2] convert [3] program with

 $ convert vorticity.ppm vorticity.mpg

which in Bash can more compactly be expressed

 $ convert vorticity.{ppm,mpg}

For this to work, one needs imagemagick (from the Debian package of the same name, for example) and also mpeg2encode which doesn't have a Debian package. Following some instructions from Marshall D. Perrin [4], the source code for the program can be found on the imagemagick site at ftp://ftp.imagemagick.org/pub/ImageMagick/delegates/mpeg2vidcodec_v12.tar.gz. This is compiled with make, and then the executable has to be copied to a directory on PATH (or its directory added to the path).

 $ tar xzf mpeg2vidcodec_v12.tar.gz
 $ cd mpeg2
 $ make
 $ sudo cp src/mpeg2enc/mpeg2encode /usr/local/bin
 $ sudo cp src/mpeg2dec/mpeg2decode /usr/local/bin

The resulting MPEG file can then be played with ImageMagick, Totem [5], mplayer [6], &.

As suggested in the tutorial, the MPEG file is much smaller than the PPM; here it's 1.9M cf. 85M.

Personal tools
communication