DVD Authoring

I've been making DVDs for quite some time now. I started on the Windows side, where you are limited to the functionality provided by the package purchased. I progressed to the Linux side to get away from Windows for several reasons. One of the best turned out to be the flexibility in DVD creation. I wanted to have extremely customized menus. I started with 'Q' DVD-Author in August 2007. It is a good package that offers a good amount of flexibility. However, it still wasn't enough. I wanted more flexibility for the cursor graphics. I scoured the internet and looked at Varol's method in QDVDAuthor and ended up with the process below. The goal was to: - Edit video source files, saving certain pieces and discarding other pieces - Create a DVD from separate video source files - Create a custom, multi-level navigation menu for the DVD It seems like a lot of different software and steps, which it is. However, it is actually pretty easy. I wrote a GTK+ graphical helper program to issue the commands for me at the click of a button. Shell scripting could probably work here as well.

The Open Office presentation slides are here.

=Software Used & It's Purpose=

MPlayer
- Accepts various source video formats - Navigate source video quickly to find time boundaries for trimming - Take video screen shots for navigation menu creation

MEncoder
- Transcode input video from original format to DVD format

Gimp
- Create menu backgrounds from screenshots - Create menu highlight and select subpictures - Use layers to create all the above in one file - Export different layer combinations to various image formats

mjpegtools
- Create a video sequence from a still picture - Multiplex video track and sound track together

spumux
- Use xml config file to add the navigation options to the DVD menu

DVDAuthor
- Create chapter marks - Assemble the DVD file system from the multiple transcoded videos and the menu(s)===Xine===

Xine
- Check the DVD file system on the hard drive for errors before burning to disc

growisofs
- Burn the DVD file system to a disc - Accepts volume names - Auto-detects burn rate

=Process=

MPlayer
- Use the arrow keys to quickly navigate - Use the on-screen display to find the time boundaries (i.e. cutting out commercials) - Pause playback (press .) - Take screenshot for menu background (press s)
 * Left, Right = jump ~10 sec
 * Up, Down = jump 1 minute
 * PgUp, PgDn = jump 10 minutes

MEncoder (copy)
- Use start time and clip length to trim the video - Output in the source format by copying (fast) Command line: mencoder -oac copy -ovc copy -of mpeg -ss start_time -endpos clip_length -o output_fn input_fn
 * Quick way to verify that the trim times are correct
 * I haven't found the times to be infinitely adjustable. This probably has something to do with the number of frames per second and intervals occurring on frame boundaries.
 * Certainly 0.5s intervals work; I've had varying success with 0.2, 0.35, 0.5, 0.65 and 0.8 intervals (i.e. start time = 4:35.2 and trim length = 5:14.8).

MEncoder (transcode)
- Transcode from source format to DVD format - 4MB/s video bit rate produces good quality, however it can be increased or decreased as needed - mp2 audio produces good output - AC3 (Dolby Digital) is also available Command line: mencoder -oac lavc -ovc lavc -of mpeg -mpegopts format=dvd:tsaf -lavcopts vcodec=mpeg2video:vrc_buf_size=1835:vrc_maxrate=9800:vbitrate=3999:keyint=18: vstrict=0:acodec=mp2:aspect=4/3 -ofps 30000/1001 -ss start_time -endpos clip_length -o output_fn input_fn Note: If you don't want to deal with the command line for transcoding the source video, AVIDemuxlooks like a good editor. Check out the Wiki Docs for some good tutorials.

Gimp
- Create a 720x480 image (for NTSC Std Def) - Import the screenshot as a layer for the menu background - Create text items as layers for the menu options - Create graphics items as different layers (and colors) for option select (if desired) and option highlight - Create 3 separate output files:
 * Background layer with menu option text layers
 * Options linked to a sub-menu or chapters in the DVDAuthor file
 * jpg format (i.e. menu.jpg)
 * Highlight graphics object layers only
 * Required for menu navigation
 * options all in one color on a transparent background
 * png format (i.e. menu-hi.png)
 * Select graphics object layers only, all in a different color
 * NOT Required for menu navigation
 * all in one color, but different from highlight color used above
 * Transparent background
 * png format (i.e. menu-sel.png)

mjpegtools
- DVD menus are actually video clips w/ subtitles - jpeg2yuv: - Pipe the above output to mpeg2enc - Save the file for use in the next step Command line: jpeg2yuv -n 30 -I p -f 29.97 -j menu.jpg | mpeg2enc -n n -f 8 -a 2 -o menu.m2v - Multiplex the mpeg2 video with audio tracks of your choice (english, spanish, etc.) - I chose silent menus Command line: mplex -f 8 -S 0 -M -o menu.mpg menu.m2v silence.mp2
 * Create a yuv video stream from a jpg picture
 * Convert the yuv stream to mp2 video file

spumux
- Add the highlight and select subpictures to the movie clip created in previous step - Uses a xml configuration file - Will automatically detect the menu buttons based on a composite of the highlight and select subpicture files - I use a shell script to accomplish the mjpegtools & spumux steps - spumux config file menu.xml  Command line: spumux -m dvd menu.xml < menu.mpg > menu-buttoned.mpg
 * Easiest since it requires the least input
 * Otherwise the top-left and bottom-right coordinates must be explicitly specified for each button

DVDAuthor
- Use a xml file to configure the DVD file system - Assemble multiple video source files together to create a coherent stream (titleset), i.e. when a captured TV show is trimmed into several files to remove the commercials - Create chapter marks in the video stream for points of interest or ease of navigation (i.e. every 6 min) - The chapter marks can be linked to the custom menu buttons if desired - Hard drive space requirement Command line: dvdauthor -x path_to_dvdauthor_xml_file
 * DVD file system output from DVDAuthor (up to 4.7GB for single-layer)
 * DVD formatted source video from Mencoder Step 2 (same size as above)
 * Actual source video (unknown size AVI, MPEG, MOV, other)

Xine
- Another powerful video player - Best part is it will play a DVD file system from a hard drive as if were already burned on a disc - Use it to verify the quality of the DVDAuthor compilation before burning Command line: xine dvd://path_to_directory_containing_DVD_file_system
 * Menu buttons operate as designed
 * Typos in menus
 * Chapter marks at the correct location

growisofs
- Burn the DVD file system to specified disc drive - Will accept a volume label - Substitute /dev/scd0 with your device location Command line: growisofs -Z /dev/scd0 -dvd-video -V 'label' path_to_directory_containing_DVD_file_system

=My dvdauthor.xml control template= - This file creates a main menu that points to 5 submenus. Each of these submenus corresponds to chapter marks of a 30-minute TV episode. - The submenu, the episode and the chapter marks are contained in the 5 portions. - Each episode consists of 4 video chunks due to the trimming out of the commercials. The video chunks are contained on the lines. Chapter marks are a comma-separated list of times with the format hh:mm:ss

 g0=1024; jump vmgm menu entry title;  button=g0; g1=1024;  g0=button; jump titleset 1 menu; g0=button; jump titleset 2 menu; g0=button; jump titleset 3 menu; g0=button; jump titleset 4 menu; g0=button; jump titleset 5 menu;

button=g1;  g1=button; jump title 1 chapter 1; g1=button; jump title 1 chapter 2; g1=button; jump title 1 chapter 3; g1=button; jump title 1 chapter 4; g1=button; jump title 1 chapter 5; jump vmgm menu;     call vmgm menu;

button=g1;  g1=button; jump title 1 chapter 1; g1=button; jump title 1 chapter 2; g1=button; jump title 1 chapter 3; g1=button; jump title 1 chapter 4; g1=button; jump title 1 chapter 5; g1=button; jump title 1 chapter 6; g1=button; jump title 1 chapter 7; jump vmgm menu;     call vmgm menu;

button=g1;  g1=button; jump title 1 chapter 1; g1=button; jump title 1 chapter 2; g1=button; jump title 1 chapter 3; g1=button; jump title 1 chapter 4; g1=button; jump title 1 chapter 5; g1=button; jump title 1 chapter 6; jump vmgm menu;  <vob file="/home/mike/DVD/ge01/sub3/part02.mpeg" chapters=","> <vob file="/home/mike/DVD/ge01/sub3/part03.mpeg" chapters=","> <vob file="/home/mike/DVD/ge01/sub3/part04.mpeg" chapters=","> call vmgm menu;

button=g1; <vob file="/home/mike/DVD/ge01/sub4/menu-buttoned.mpg"> g1=button; jump title 1 chapter 1; g1=button; jump title 1 chapter 2; g1=button; jump title 1 chapter 3; g1=button; jump title 1 chapter 4; g1=button; jump title 1 chapter 5; g1=button; jump title 1 chapter 6; jump vmgm menu; <vob file="/home/mike/DVD/ge01/sub4/part01.mpeg" chapters=","> <vob file="/home/mike/DVD/ge01/sub4/part02.mpeg" chapters=","> <vob file="/home/mike/DVD/ge01/sub4/part03.mpeg" chapters=","> <vob file="/home/mike/DVD/ge01/sub4/part04.mpeg" chapters=","> call vmgm menu;

button=g1; <vob file="/home/mike/DVD/ge01/sub5/menu-buttoned.mpg"> g1=button; jump title 1 chapter 1; g1=button; jump title 1 chapter 2; g1=button; jump title 1 chapter 3; g1=button; jump title 1 chapter 4; g1=button; jump title 1 chapter 5; g1=button; jump title 1 chapter 6; jump vmgm menu; <vob file="/home/mike/DVD/ge01/sub5/part01.mpeg" chapters=","> <vob file="/home/mike/DVD/ge01/sub5/part02.mpeg" chapters=","> <vob file="/home/mike/DVD/ge01/sub5/part03.mpeg" chapters=","> <vob file="/home/mike/DVD/ge01/sub5/part04.mpeg" chapters=","> call vmgm menu;

=Software Versions Used= - Mplayer 1.0-rc2 (includes Mencoder) - Gimp 2.4.6) - Mjpegtools 1.8.0) - DVDauthor 0.6.14 (includes spumux)) - Xine 0.99.6) - dvd+rw-tools 7.0.1 (genisoimage 1.1.6))

=References= - Some thoughts on DVD authoring - More detailed presentation - Spumux and menu color limitations - DVDAuthor reference - An excellent dvdauthor.xml example - Ways to create a DVD file system (their server went down on 10/17/08; however, this is a good reference that wil hopefully be back on line soon)