Packages for both programs are available for most Linux distributions and BSDs, so you can install them on your favorite OS easily. Compiling the programs from source isn't difficult, as long as you get their dependencies right. Both programs provide adequate documentation about the installation. You can burn the final files to a DVD disc with the help of the growisofs utility from the dvd+rw-tools suite.
Converting the files to MPEG-2
First, you must convert your file to MPEG-2 for the video and to AC3 for the audio, in order to be compliant with the DVD video specifications. If the audio on your file is already encoded in AC3 format, you can use it as is without re-encoding it. Run this command to check the audio format of the file:
mplayer -vo dummy -ao dummy -identify your_video.avi 2>&1 | grep AUDIO_FORMAT | cut -d '=' -f 2
If it returns hwac3, the audio part of your file is encoded in AC3, and you can convert the file to MPEG-2 with the following command:
mencoder -oac copy -ovc lavc -of mpeg -mpegopts format=dvd -vf scale=720:576,harddup \ -lavcopts vcodec=mpeg2video:vrc_buf_size=1835:vrc_maxrate=9800:vbitrate=5000:keyint=15:aspect=16/9 \ -ofps 25 -o your_video.mpg your_video.avi
If it isn't encoded in AC3, run this command:
mencoder -oac lavc -ovc lavc -of mpeg -mpegopts format=dvd -vf scale=720:576,harddup \ -srate 48000 -af lavcresample=48000 \ -lavcopts vcodec=mpeg2video:vrc_buf_size=1835:vrc_maxrate=9800:vbitrate=5000:keyint=15:aspect=16/9:\ acodec=ac3:abitrate=192 -ofps 25 -o your_video.mpg your_video.avi
The previous commands create an MPEG-2 file in phase-alternating line (PAL) format with an aspect ratio of 16:9. PAL is used in most of Europe (except France). If you want to create a National Television System Committee (NTSC) DVD, which is the North American video standard, replace scale=720:576 with scale=720:480, keyint=15 with keyint=18, and -ofps 25 with -ofps 30000/1001. If you don't have a wide-screen TV, you should encode your file with an aspect ratio of 4:3 by replacing aspect=16/9 with aspect=4/3.
For more information, check the MPlayer's man page, which provides detailed explanations about each option used in these commands.
This process should take some time to finish. My 1.5GHz Centrino laptop took about 25 minutes to convert a file with a one-hour runtime that was encoded in XviD.
Creating the DVD structure
Now you can use dvdauthor to create the layout of the DVD from the MPEG-2 file of your video. Although you can pass any options to dvdauthor directly from the command line, it's easier and more flexible to create an XML file with the appropriate options instead. Open your favorite editor and create a file called dvd.xml with the following contents:
<dvdauthor>
<vmgm />
<titleset>
<titles>
<pgc>
<vob file="your_video.mpg" chapters="0,0:10,0:20,0:30,0:40,0:50" />
</pgc>
</titles>
</titleset>
</dvdauthor>
I split my hour-long video into six 10-minute chapters. Adjust the chapters= option for your video, or remove the option from your XML file if you don't want chapters.
Type dvdauthor -o dvd -x dvd.xml to create the layout of the DVD; the -o switch defines the output directory, and -x is used for the XML file. This command takes five to 10 minutes, depending on your video size and your CPU speed. Once it completes, you'll have a directory named dvd with two subdirectories: AUDIO_TS and VIDEO_TS. Before burning the video to a disc, you can check it by running mplayer dvd:// -dvd-device ./dvd.
If the video plays correctly, you can burn it onto a DVD disc with growisofs by running growisofs -dvd-compat -Z /dev/dvdrw -dvd-video ./dvd/. Make sure to replace /dev/dvdrw with the device name of your DVD recorder.
The only thing left is to make some popcorn, get your favorite beverage, and enjoy the show.
Note: Comments are owned by the poster. We are not responsible for their content.
<tt> <tt><dvdauthor>
<vmgm<nobr> <wbr></nobr>/>
<titleset>
<titles>
<pgc>
<vob file="vid1.mpg" chapters="0" pause="2"<nobr> <wbr></nobr>/>
<vob file="vid2.mpg" chapters="0" pause="2"<nobr> <wbr></nobr>/>
<vob file="vid3.mpg" chapters="0" pause="2"<nobr> <wbr></nobr>/>
</pgc>
</titles>
</titleset>
</dvdauthor></tt></tt>
does not create six 10-minute-chapters but five chapters 10 seconds each and one chapter which is 59:10 minutes!<tt><vob file="your_video.mpg" chapters="0,0:10,0:20,0:30,0:40,0:50"<nobr> <wbr></nobr>/></tt>
Note: If the first line was right, chapters could only contain full minutes...<tt><vob file="your_video.mpg" chapters="0,10:00,20:00,30:00,40:00,50:00"<nobr> <wbr></nobr>/></tt>
All of what I learned is documented as a HOWTO in my blog. Partly so I wouldn't forget how I got everything working, haha. Maybe this will be helpful to others.
I used the info here and many hours of research and testing to come up with a satisfactory recipe for archiving HDTV.
The biggest problem I had was audio/lip sync. This is fixed with an excellent tool: ProjectX. ProjectX took me a while to get installed & running and I documented it on my blog. I have spent hours (days?) trying various tools to 'fix' the hdtv mpeg files, and so far only projectx does the corrections automagically. Awesome tool.
PX demuxes & creates two files (from the hdtv/atsc hidef files created by MythTV): One for video, one for audio. This presented a new problem, what tool(s) to use to convert the video file to the DVD standard. After much reading, I settled on avidemux2. The next problem was that I needed to run avidemux2 on my fast P4 server (because encoding takes a lot of cpu), but my fast server is my myth frontend and that has a plasma monitor. The plasma monitor does not support the high resolutions that PC monitors have, and this is important because when you load a HD file in avidemux the window is sometimes so large that you can't see all of the controls/buttons! So, I ran avidemux remotely via X11 over ssh. To get around a weird error with GTK (used by avidemux), I hunted and learned that I needed to run ssh with the "-Y" switch.
Back to video: Following one of the many guides on avidemux, I converted the hdtv mpg video to dvd format. Then I used mplex to mux the dvd format video with the ac3 audio file created by projectx. This<nobr> <wbr></nobr>.mpg file is just like the one described by the article here ("your_video.mpg"). Then I just followed the rest of this article.
I really wanted to use the simpler steps in this article, but was forced to use projectx due to the typical glitches that will be in most atsc/hdtv recordings.
I'm now able to free up disk space on my mythtv backend by archiving (compressing) to DVD. Thanks to this article, I would not have been inspired to climb this mountain. Nice article!
Donn Lee
Wicked Cool, But...
Posted by: Anonymous Coward on April 27, 2006 10:28 PMQueue the crickets.
P.S. Kino show promise but, it's alpha at best.
#