My steps to making a DVD under linux

Single video, one stereo audio track, multiple subtitles. April 2008

  1. Cut the video using cinelerra (or some other editor - now adays, there is more than one)
  2. Audio: Render the audio to wav and then encode with:
    mp2enc -b 384 -r 48000 -o kaos.mp2 < kaos.wav
    A bitrate of 384kbs should be the highest possible.
  3. Video: Render the video portion with the yuv2mpeg stream render option. This will pipe the output in a yuv format for either ffmpeg or mpeg2enc. Both have advantages which can be seen here. I chose to use the following command:
    ffmpeg -f yuv4mpegpipe -i - -y -target dvd -aspect 4:3 -b 9000k -f mpeg2video %
    The highest bitrate for ffmpeg (as well as safe DVD mplexing) is 9000k. Aspect ratio is 4:3 even though the 720x576 frame is 5:4. Useful info about bitrate and formats can be found here. If you want to batch render (or render in the background, then you can set up the rendering option and then quit cinelerra. On the command line, you can just type:
    cinelerra -r
    This will render the video. Be careful to either not have in/out points marked in cinelerra or have them marking the entire portion you wish to have rendered =it will render the portion of video between these points. If you are working remotely and want to edit the batch render options by hand, you can simply edit ~/.bcast/batchrenderer.rc
  4. Then, mplex those suckers together with:
    mplex -f 8 -o kaosDVD.mpg kaos.m2v kaos.mp2
  5. Subtitles: Use Gaupol to edit/create/translate subtitles. Make one file each for every language you intend to use. Save the files as "SubRip" .srt files with "UTF-8" encoding. For this example, I have three .srt files: kaos_en.srt, kaos_es.srt, and kaos_it.srt.
    To add subtitles to the dvd mpeg, you can follow the directions here. However, the default subtitles from spumux are not that pretty. Instead, I have made a simple python script to generate more elaborate spumux subtitles. Download the makespumux.py and do the following:
    python makespumux.py kaos_en.srt
    python makespumux.py kaos_it.srt
    python makespumux.py kaos_es.srt
    spumux -s0 kaos_en/spu.xml < kaosDVD.mpg > kaosDVD+en.mpg
    spumux -s1 kaos_it/spu.xml < kaosDVD+en.mpg > kaosDVD+en+it.mpg
    spumux -s2 kaos_es/spu.xml < kaosDVD+en+it.mpg > kaosDVD+en+it+es.mpg
  6. the menu: Create a play, a select and a highlight button for your video in Gimp, each with only 3 colors max. Save them as PNG files and MAKE SURE TO CHECK OFF THE "Save background color" check button. You don't want it to save an extra color in your file so that it is incompatible with spumux. For more info about colors, be sure to check here.
    The basic rule is the following. You can have three image, one each for button, select, and highlight. If you use the autoline features of spumux without any button geometry entries, then the images MUST be the same shape. Each can have a 3 color palette.
    Then create a spumux file called menuspumux.xml, that looks like this:
    <subpictures>
    <stream>
    <spu force="yes" start="00:00:00.00" image="buttons.png" select="selected.png" highlight="highlighted.png" >
    <button x0="304" y0="330" x1="456" y1="384" />
    <button x0="304" y0="392" x1="456" y1="438" />
    </spu>
    </stream>
    </subpictures>

    As of this writing, be aware that you need at least two buttons to get highlighting to work. The buttons are automatically named in order that you place them in the xml file. This will be important for your main dvdauthor xml description.

    Next, create a short sequence in cinelerra. Render the video portion as m2v to a file called background.m2v. Then, render the audio as ac3 to a file called background.ac3. Then :
    mplex -f 8 -o background.mpg background.m2v background.ac3
    spumux menuspumux.xml < background.mpg > menu.mpg
  7. Then, generate the DVD structure with:
    dvdauthor -o mydvd -x auth.xml
    and test with
    mplayer dvd:// -dvd-device mydvd
    or if you want menus:
    xine dvd:/data/r_g/final-april-11-2008/mydvd/VIDEO_TS/
  8. Create an iso image and burn.
    mkisofs -r -V "KAOS" -dvd-video -o kaosdvd.iso mydvd
    growisofs -dvd-compat -Z /dev/dvd2=kaosdvd.iso