DVD Authoring

Creating DVDs under Linux without using non-free tools is a somewhat complex process. The general steps are:

1. Convert the video and audio to the right form. 2. Create a menu. 3. Use dvdauthor to assemble the parts of the DVD. 4. Turn the DVD image into an ISO, and burn it.

There is an extensive forum thread on how to author your own DVDs here.

Step 1: The Audio and Video
While the above forum posting has a somewhat lengthy process, the following will work if you have ffmpeg and all of the right codecs installed:

The example shows an MPEG-2 video stream and an MPEG-1 layer 3 stream for the audio. If there are multiple tracks, the forum post above shows how to deal with those.

Step 2: Creating Menus
There are three basic parts to a menu:

1. The background. 2. The items. 3. The selection box.

Step 3: Putting it all together
dvdauthor is convenient utility, available in portage, to put all the pieces together. It does this by having the user create an XML file describing the layout, menus, and behavior of the DVD. A tutorial on how to use it can be found here.

Step 4: Creating the ISO
Step 3 results in a folder structure containing the contents of the DVD. Now use mkisofs, available as part of the cdrtools package in Portage to turn this into a proper image.

Bash Script to batch convert files in a directory
The following script can be used to convert M2TS files (e.g. as recorded by Sony Handycams) to a PAL MPEG suitable for burning as a DVD.


 * 1) !/bin/bash

shopt -s nullglob

if [ ! -d "mpeg" ]; then mkdir mpeg fi

for f in *.m2ts do echo " " echo "-> CONVERT $f? [y/n] " read -n1 -s answer case "$answer" in     [Yy])      mencoder -oac copy -ovc lavc -of mpeg -mpegopts format=dvd:tsaf -vf scale=720:576,harddup -srate 48000 -af lavcresample=48000 -lavcopts\ vcodec=mpeg2video:vrc_buf_size=1835:vrc_maxrate=9800:vbitrate=8000:keyint=15:trell:mbd=2:precmp=2:subcmp=2:cmp=2:dia=-10:predia=-10:cbp:mv0:\ vqmin=1:lmin=1:dc=10:vstrict=0:acodec=ac3:abitrate=192:aspect=16/9:threads=2 $f -ofps 25 -fps 50 -o mpeg/$f.mpg -demuxer lavf -msglevel all=-1      ;;      [Nn]) ;;     *)      ;;   esac done