HD Video Workflow in Linux

There won't be very much commercial HD DVD media on the market by 2009 because Toshiba has stopped supporting the format. Since it's easy to make a red laser DVD with HD mpeg2 files on it that a Toshiba HD DVD player can play, there is still some use for an old player. Does it make sense to pick one up cheap while people are dumping them? They are about $70 each on amazon.com as of June 2008.

This document describes a method for creating HD video DVDs that are playable on most Toshiba HD DVD players and many software DVD players. Note that we are not making a standard definition DVD containing downconverted HD material but a non-standard DVD with high definition 1440x1080i mpeg2 content. The method is based on the observation that the Toshiba HD-A2 DVD player and many software DVD players will play mpeg2 HD content that has been placed in VOB files on an otherwise compliant red laser DVD. This was first observed by

The resulting disks are playable with Note that the Xbox HD DVD may not work with these disks. This is because we are not creating a 3xDVD with EVO files using a UDF filesystem. Instead we're making a non-standard DVD with HD content that is compatible with the Toshiba hardware. While these disks do not conform to any standard, one need not worry about whether a new Toshiba HD DVD player will play them or not, because there won't be any new players. In fact, a non-standard DVD with HD content is better than a 3xDVD disk, because the 3xDVD format never caught on and there is no longer any support for it.

Needed Software

This method relies only on open source software. Moreover, the software needed is exactly the same well-polished software that is used on Linux for authoring standard definition DVDs.

Capture

Use dvgrab version 3.1 by Arne Schirmacher or later for HDV capture. Connect the firewire cable. Make sure your camcorder is set to export HDV format. Type
$ mkdir capture
$ cd capture
$ dvgrab -fhdv -noavc src
and then press play on the camcorder. This will result in the files src001.m2t, src002.m2t and so forth being created in the capture directory. These are the HDV mpeg2 transport stream files dumped direct from the camera. You can test them with vlc to make sure they are fine.

Editing

Cinelerra will edit HDV files natively. Select Settings->Format and specify 1440x1080 as the resolution.

Then open the HDV files. After you are done with editing, the project needs to be rendered. To do this create a small script called pipe-hd containing the following commands

#!/bin/sh
yuvcorrect -T INTERLACED_TOP_FIRST |
yuvdenoise -g 0,0,0 -t 8,12,12 -M 0,0,0 |
mpeg2enc --no-constraints -f3 -nn \
	-a3 -Ktmpgenc -lh -b18000 -V488 -r32 -G18 -q9 -s -o $1
make it executable and put it in your path. Then select File->Render and choose the YUV4MPEG Stream file format. Click on the Video rendering options and select use pipe with the name of the script pipe-hd %

This will render the video. Now render the audio by selecting File->Render and choosing Microsoft WAV as the file format.

Encode the audio track and the multiplex the video and audio together using the commands

$ mp2enc < final.wav -o final.m2a
$ mplex -f8 -b488 -r20000 final.m2v final.m2a -o final-hd.mpg
You now have a HD mpeg2 stream that can be turned into a VOB file by dvdauthor and written to a DVD.

Creating a Menu

Create menus using gimp exactly as you would for an ordinary DVD using standard definition 720x480 stills with a 4:3 aspect ratio. Further information may be found on the creating a menu page. Note that you can mix HD and SD content on a single DVD as long as they are in separate titlesets. A main menu can be used to select between HD and SD formats to create a disk that works in every DVD player. Again, the idea is to simply make menus for dvdauthor using gimp the same way as you would do when authoring a regular DVD.

Authoring the DVD

Authoring is done with dvdauthor. The only difference from authoring a standard definition DVD is that some of the input mpeg2 files are 1440x1080i. Note that dvdauthor doesn't check whether the input mpeg2 files are in a valid resolution for a standard definition DVD or not, it simply does what's necessary to turn them into VOB files. Therefore if you hand it an HD mpeg2 file, it will happily change it to a VOB without ever knowing something strange is happening.

Suppose that logo.mpg and final-sd.mpg are standard definition mpeg2 files and final-hd.mpg is the HD mpeg2 file created earlier. Let menu0.mpg and menu1.mpg be standard definition menus with two buttons each. Then the xml file dvd.xml given by

<dvdauthor>
    <vmgm>
        <menus>
            <video aspect="4:3" />
            <pgc entry="title">
                <vob file="logo.mpg" />
                <post>jump menu 2;</post>
            </pgc>
            <pgc>
                <vob file="menu0.mpg" />
                <button>jump titleset 1 menu;</button>
                <button>jump titleset 2 menu;</button>
            </pgc>
        </menus>
    </vmgm>
    <titleset>
        <menus>
            <video aspect="4:3" />
            <pgc entry="root">
                <vob file="menu1.mpg" />
                <button>jump vmgm menu 2;</button>
                <button>jump title 1 chapter 1;</button>
            </pgc>
        </menus>
        <titles>
            <video aspect="16:9" />
            <pgc>
                <vob file="final-hd.mpg" />
                <post>call menu;</post>
            </pgc>
        </titles>
    </titleset>
    <titleset>
        <menus>
            <video aspect="4:3" />
            <pgc entry="root">
                <vob file="menu1.mpg" />
                <button>jump vmgm menu 2;</button>
                <button>jump title 1 chapter 1;</button>
            </pgc>
        </menus>
        <titles>
            <video aspect="16:9" />
            <pgc>
                <vob file="final-sd.mpg" />
                <post>call menu;</post>
            </pgc>
        </titles>
    </titleset>
</dvdauthor>
would direct dvdauthor to include an HD and SD version of the same video along with a menu to select between them on a single DVD.

Burning the DVD

Burning the DVD with HD content is done in exactly the same way as for a regular DVD. Specifically, the commands are
$ dvdauthor -o disk1 -x dvd.xml
$ growisofs -dvd-compat -dvd-video -Z/dev/dvd disk1
If you stay away from the HD title the disk will work fine in a standard definition DVD player. If you select the HD title on a standard definition DVD player you will either get sound only, a lockup or nothing at all. If you place the disk in a Toshiba HD DVD player you can play both the HD and SD content. VLC will also play the HD concent on a reasonably fast computer.
[HOME]
Last Updated: Sat May 24 20:19:47 PDT 2008