encoding video for dvd burning
Michael Beattie
mtbeedee at gmail.com
Tue May 17 13:20:19 UTC 2005
> Yes, see below. I've tried this with several different videos, and it
> seems to work.
>
> You'll need the following packages: mplayer, mjpegtools, ffmpeg.
>
> (1) Convert your file to mpeg2 video in DVD format:
>
> mplayer -ao null -noframedrop -vo yuv4mpeg AVI.avi
>
> (2) Step one will create a file called "stream.yuv" in the current
> directory, the next command will convert it to an mpeg2 video (all one
> command, watch out for line wrapping):
>
> cat stream.yuv | yuvfps -r 30000:1001 | yuvscaler -n n -O DVD |
> mpeg2enc -n n -f 8 -F 4 -o out.m2v
>
> Alternatively, if your original file has correct fps (29.970 for NTSC)
> and the scaling is OK (720x480 for NTSC), you can simplify this to:
>
> cat stream.yuv | mpeg2enc -n n -f 8 -F 4 -o out.m2v
>
> (3) Next you need to get the audio from your original video file:
>
> mplayer -ao pcm -vo null -vc dummy AVI.avi
>
> (4) The result will be a new file called "audiodump.wav", the next
> command will convert it to MP2 format:
>
> ffmpeg -ab 224 -ac 2 -ar 48000 -i audiodump.wav audiodump.mp2
>
> NOTE: you should be able to substitute "mp3enc" for "ffmpeg", but I
> haven't tested it, so I can't verify that it works; mp3enc is part of
> the mjpegtools package, and would allow you to avoid installing an
> extra package (the ffmpeg package).
>
> (5) Finally, multiplex the new video and audio files:
>
> mplex -f 8 -o ready-to-master.mpg out.m2v audiodump.mp2
>
> (6) I don't know the dvdauthor program very well at all, but the
> following should allow you to make a dvd which will start up
> automatically and play the mpeg2 video you just made, with no menus or
> other fancy stuff.
>
> Create a file called "dvdauthor.xml", containing:
>
> <dvdauthor>
> <vmgm />
> <titleset>
> <titles>
> <pgc>
> <vob file="ready-to-master.mpg"/>
> </pgc>
> </titles>
> </titleset>
> </dvdauthor>
>
> (7) Use dvdauthor to create the DVD filesystem:
>
> dvdauthor -o output_dir/ -x dvdauthor.xml
>
> (8) Use mkisofs to make an image, then burn with growisofs (useful for
> checking that the image is correct, and finding any errors before you
> burn a coaster):
>
> mkisofs -dvd-video -o image.iso output_dir
> growisofs -dvd-compat -Z /dev/dvd=image.iso
>
> ...or else use growisofs to master and burn in one step:
>
> growisofs -Z /dev/dvd -dvd-video /target-dir-for-dvd-filesystem-image
>
> That's a lot of work, but should be more reliable that just using
> mencoder, as I originally suggested (apologies in advance for any
> typos/errors above).
>
> You should be able to do basically the same thing with transcode (and
> probably other tools as well).
>
Thanks a lot. This seems to have worked. dvdauthor accepted the mpeg
and I made the ISO. I just need to get home from work to put a DVD in
the drive and burn it. Thanks.
A note for anyone else reading this, when it makes stream.yuv, it is a
gigantic file. A 3 meg AVI will turn into about 300 meg yuv file. I
guess this might depend on bitrate and stuff though.
More information about the ubuntu-users
mailing list