Making Movies

I think I’ve finally got a complete workflow for burning recorded programs to DVDs now:

1) Record the show off of the TV input using MythTV.

Generally I capture at 480×480 at 2.2Mbps to keep the files sizes from getting too big and within the abilities of this system to play back at full speed. If I know I’m going to want to record something to DVD, I might capture at 720×480 at 5Mbps instead.

2) Cut out the commercials, using ‘gopdit’

‘nuvexport’ is supposed to work for this as well and will automatically cut based on the MythTV tables of commercials it detected, but it’s often not precise enough and leaves in station IDs and intros, cuts too quickly, sometimes misdetects, etc…

3) Re-encode the recorded file with ‘transcode’

Although the source stream is already MPEG-2, this phase takes care of some other tasks that need to be done: it expands the picture to the full 720×480 DVD resolution if it wasn’t already, reduces the frame rate to 24fps if it’s a movie, deinterlaces it so that it doesn’t have the annoying mixed fields that the original recording has, and inserts the padding necessary for DVD authoring. The command line usually looks something like:

transcode -i escape.mpg -V -Z 720x480 -x mpeg2,mp3 -y mpeg2enc,toolame -F "8,-c -4 2 -2 1" -E 48000 -b 224 --export_asr 2 -o escape -w 5000 -J smartdeinter --export_fps=24 -J modfps

Unfortunately this is also the slowest step, taking around *three days* per two hours of encoding. Maybe I can get ‘transcode’ working under Cygwin so I can run it on the much-faster gaming box instead…

4) Re-multiplex the audio and video streams with ‘mplex’ since transcode puts them in separate files.

mplex -f 8 escape.m2v escape.mp2 -o escape.vob

5) Create the DVD directory structure using ‘dvdauthor’

There are a lot of options available here for generating menus, setting chapters, etc., but for now I’m using a minimal control file to just specify a single title, no menus, no chapters.

escape.xml:
    <dvdauthor>
    <vmgm />
    <titleset>
    <titles>
    <pgc>
    <vob file="escape.vob" />
    </pgc>
    </titles>
    </titleset>
    </dvdauthor>

dvdauthor -o escape -x escape.xml

6) Create an ISO image with a UDF filesystem containing the directory structure.

mkisofs -dvd-video -o escape.iso escape/

7) Copy the ISO file to the XP box and burn it using DVD Decrypter.

I was tempted to get Nero 6 yesterday when I went to pick up some DVD-R blanks, but at $100? Just for the final burn phase, when most of the prep work is already being done under Linux? Nuts to that. Fortunately there are some free tools available, though not quite as professionally polished.

So how well does it work? Two coasters, out of two attempts so far. They still work fine if I mount them and play the raw .vob files in MPlayer, but get all glitchy if I try to load them in the standalone DVD player or in DVD Player on the iBook. I’ll have to try tightening up some of the encoding parameters that might be violating the DVD specs, if the players are being super-nitpicky.

Suddenly Nero doesn’t sound so bad after all…

Update: Finally, success on the third attempt. That was using .vob files made by a coworker though, but at least it proves the ISO image creation and burning are working fine and it’s not just an incompatibility between the media and the DVD player, so the problem is somewhere in the authoring stages. Of course, another encode is going to take another THREE FREAKING DAYS…

Update 2: I use a different process instead now, having figured out how to avoid the transcode step entirely.

One thought on “Making Movies”

  1. And another update: I’ve finally now successfully burned my first self-encoded DVD. I did a few things differently this time so I’m not sure which of them specifically did the trick, but it was something in the combination of: 1) leaving the frame rate at 29.97fps instead of trying to convert it, 2) removing the -g and -G options in the mpeg2enc parameters, and 3) using the -D parameter to ‘transcode’ to do audio/video syncing, instead of trying to handle it in ‘mplex’. As an added bonus the encode is now about 60% faster, so now it only takes TWO FREAKING DAYS…

    The sync change in particular might have done it. ‘transcode’ usually reports a suggested sync adjustment time (e.g., ‘700 ms’) and I originally used the -O parameter to ‘mplex’ to tell it to offset the sync by that amount. ‘dvdauthor’ would then complain about the sync being slightly off but went ahead and created the directory structure anyway, so I thought it was harmless. However, if I stop the initial transcode run and restart it with the -D parameter it suggests for itself, dvdauthor no longer complains and the burned image worked.

Leave a Reply

Your email address will not be published. Required fields are marked *