Thursday, May 20, 2010

Converting an mpeg2 file to a DVD

I got an interesting question from my brother the other day. He wanted to know whether I could help him convert his wedding movie, in mpeg format, to a DVD. The reason for this was that his friends, and himself, had old DVD players that did not support anything other than plain DVD format. So this is just a small description of how I did it.

I used dvdauthor to solve this problem. Dvdauthor does just what it says: it helps you author DVD's. There is a GUI for it, but I used it from command line since I only needed the basic functionality.

No of course I couldn't apply dvdauthor directly since it requires the mpeg's to be in VOB format. So the first thing I did was to convert my mpeg file to VOB format with the following line:
ffmpeg -i videofile.mpeg -target dvd videofile.vob
Now we have a workable format in the file called "videofile.vob". This is the file we will let dvdauthor work with. In order for dvdauthor to be able to do it's job we need to let it know the basic structure of the DVD we want to create. We will describe this structure using an XML file. In principle you can just open up your favourite editor and enter the following:

<dvdauthor>
<vmgm />
<titleset>
<titles>
<pgc>
<vob file="your_video.mpg" />
</pgc>
</titles>
</titleset>
</dvdauthor>

and then save the file as dvd.xml. This will give you only on chapter, i.e., no chapters which can be rather limiting, but I didn't need anything fancy. So basically we can call dvdauthor now like this:
dvdauthor -o dvd -x dvd.xml
If you look in your directory now, you will have a new folder called dvd containing the AUDIO_TS and VIDEO_TS folders. You can now burn this to a dvd with growisofs like this:
growisofs -dvd-compat -Z yourdvddevice -dvd-video ./dvd/
Well, that did it for me. I hope you'll find it useful. Thank you and good night. :)

No comments:

Post a Comment