[MPlayer-users] Making VCD / SVCD from rendered animation?

Brett Kosinski brettk at frodo.dyn.gno.org
Wed Apr 16 17:41:54 CEST 2003


> [Automatic answer: RTFM (read DOCS, FAQ), also read DOCS/bugreports.html]
> Hi, I've got a POV-Ray animation that I'd like to turn into an SVCD. I've
> rendered it at 480x480 'squished' aspect ratio, and now am ready to make a CD
> out of it. How exactly do I go about this? I've come accross plenty of DVD
> ripping examples, but that obviously doesn't apply, and some mpeg/avi
> examples, but none of them deal with having something already in the proper
> size. I want this to look as nice as possible.

Well, for creating an SVCD, the mjpegtools package is probably more
appropriate than mplayer (I believe mplayer's mpeg output isn't that
mature yet).  You can find those at mjpeg.sourceforge.net.  Then, just
convert your frames to PPM format (rendering directly to PPM is even
easier, something which I'm pretty sure POV can do).  Then, do something
like this:

mkfifo frames.fifo

cat directory_for_frames/*.ppm > frames.fifo &
cat frames.fifo | ppmtoy4m [options here] | \
  mpeg2enc -f 4 [remaining options] -o movie.mpg

rm frames.fifo

Your ppmtoy4m options should probably be something like:

-F 30000:1001

and for mpeg2enc

-F 4 -a 2 -n n

There are various other options to control quality that you might want to
tweak, but these are the basics.  Essentially, we select 29.97 frame rate,
4:3 aspect ratio, and an NTSC video stream.

Next, you have to create a dummy audio track of the right length.  You can
do this any number of ways, but make sure it's mp2.  The mp2enc  program
which comes with mjpegtools can generate mp2 files.  One way to generate
the audio is to use sox to convert RAW data, piped from /dev/zero, to WAV,
and use the sox "trim" filter to get the right amount of data.  Then, pipe
the result to mp2enc.  eg, to generate a 1 minute 30 second silent track:

sox -t raw -sw -c 2 -r 44100 /dev/zero -t wav - trim 0 1:30 |  \
  mp2enc -o movie.mp2

Lastly, use mplex (also in mjpegtools) to multiplex the audio and video
streams together thusly:

mplex -f 4 -o svcd.mpg movie.m1v movie.mp2

And voila!  You have an SVCD!

Brett.

PS.  This is all predicated on the assumption that you have enough space
to store all the frames as uncompressed PPM files.  If not, you'll have to
use some compressed format and convert to a combined PPM... this could be
done with a fairly simple Perl script.



More information about the MPlayer-users mailing list