Much ado about scripting, Linux & Eclipse: card subject to change


HOWTO: AVI to DVD Conversion

Yesterday I set about learning how to convert a Xvid-encoded .avi to DVD so that my more technically challenged relatives can watch an HBO movie that's not available in video stores.

Here's the process, with approximate elapsed times. Thanks go entirely to for the solution.

Hardware used: Thinkpad R51 (Pentium M 1.6GHz, 1.2G RAM) + Samsung USB DVD-DL burner (16.4x1352KBps).

  • Acquire your .avi file source. For a 1.1G .torrent, this took 2 hours.
  • Copy the source onto a drive with sufficient space to re-encode it. 20 - 25 minutes for USB-to-USB copy between drives.
  • Verify installed software requirements. I still have an old copy of xubuntu on the R51, so I needed to install these tools. Under 2 minutes.
    apt-get install dvdauthor dvd+rw-tools \
      transcode mplayer ffmpeg mjpegtools xine
  • Create a dvdauthor.xml file. Under 2 minutes.
  • Check for 5.1 audio; if the following yields a result, run tcextract; otherwise skip. For my video, skipped. Seconds.
    mplayer -vo dummy -identify movie.avi
    tcextract -d2 -i movie.avi -a0 -x ac3 | tcextract -d2 \
      -x ac3 -t raw > movie.ac3
  • Split the 16:9 NTSC widescreen .avi into movie.m2v (video) and movie.ac3 (audio). Create an MPEG from the audio and video pieces. Generate DVD/AUDIO_TS/ and DVD/VIDEO_TS/ dirs in the current dir using the dvdauthor.xml to add chapters every 15 minutes. All three steps back-to-back, 6 hours.
    transcode -i movie.avi -y ffmpeg --export_prof dvd-ntsc \
      --export_asr 3 -o movie -D0 -s2 -m movie.ac3 -J \
      modfps=clonetype=3 --export_fps 29.97; \
      mplex -f 8 -o movie.mpg movie.m2v movie.ac3; \
      dvdauthor -x dvdauthor.xml
  • Verify the video and audio will play. Seconds.
    xine dvd:/full/path/to/DVD/VIDEO_TS/
  • Burn the DVD. 90 minutes for a 2.8G DVD image USB-to-USB burn.
    growisofs -Z /dev/dvd1 -dvd-video DVD/

Total time to acquire a 1 hour 43 minute DVD: just under 10 hours. Your mileage may vary.