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

Tyler Eaves tyler at cg1.org
Wed Apr 16 17:54:02 CEST 2003


On Wednesday 16 April 2003 11:41, Brett Kosinski wrote:
> [Automatic answer: RTFM (read DOCS, FAQ), also read DOCS/bugreports.html]
>
> > [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.
>

Wow! Great responce ;) I'm having POV output TGA, and ImageMagick can 
certainly convert them to PPM. I could output direct to PPM from pov, but 
that'll have to wait for the NEXT 20+ hour render ;)

I do have one question though.... What's with the 'movie.m1v' in the mplex 
command line.  Shouldn't that be movie.mpg ?



More information about the MPlayer-users mailing list