How to Create DVD's from Various Video Formats on Ubuntu

Ever since ADSL has been an affordable option here in Australia (not that long really) I've sourced quite a few movies online.  These days I get most of movies from ZML in *.avi format.  This is great for watching and storing on the computer, but what if I want to create a DVD from the *.avi video?  The following tutorial will go through some simple steps to get a variety of video formats converted into DVD images in Ubuntu.

To get this going you will need the following programs:

videotrans
libxvidcore4
genisoimage
dvdauthor
mplayer

To install these enter the following in the terminal:

sudo aptitude install videotrans libxvidcore4 genisoimage dvdauthor mplayer

I'll briefly run through what each of these programs is/does.

Videotrans

Videotrans is a collection of utilities and scripts designed to help with DVD authoring.  It can perform the following:

  • movie-to-dvd - convert video to MPEG2 + MP2 or AC3
  • movie-title - combine video and title sequence into a menu
  • movie-make-title - create background video for DVD menu
  • movie-make-title-simple - create background image+audio for DVD menu
  • movie-rip-tv.com - gather information about TV series from tv.com
  • movie-rip-epg.data - convert EPG to .info for movie-title
  • movie-compare-dvd - verify if DVD was burned correctly

Libxvidcore4

Libxvidcore4 (XviD) is a high quality/performance ISO MPEG4 codec.

Dvdauthor

Dvdauthor is a program that will generate a DVD movie from a valid mpeg2 stream that will play in a DVD player.

Mplayer

Mplayer plays most mpeg, avi and asf files, supported by many native and win32 DLL codecs. You can watch VCD, DVD and even DivX movies too. The other big feature of mplayer is the wide range of supported output drivers. It works with X11, Xv, DGA, OpenGL, SVGAlib, fbdev, but you can use SDL (and this way all drivers of SDL) and some lowlevel card-specific drivers (for Matrox/3dfx/SiS) too! Most of them supports software or hardware scaling, so you can enjoy movies in fullscreen.

Genisoimage

genisoimage is a pre-mastering program for creating ISO-9660 CD-ROM filesystem images, which can then be written to CD or DVD media using the wodim program. genisoimage includes support for making bootable "El Torito" CDs, as well as CDs with support for the Macintosh HFS filesystem.

The package also includes extra tools useful for working with ISO images:

  • mkzftree - create ISO-9660 image with compressed contents
  • dirsplit - easily separate large directory contents into disks of predefined size
  • geteltorito - extract an El Torito boot image from a CD image

OK.  Now that we know what the programs are and what they do let's got on to the task at hand.  The first thing that we need to do is make sure that our video playes in mplayer.  You can either right-click the video file and select 'Open with mplayer', or you can enter the following in the terminal:

mplayer your-movie-file.avi

Simply replace 'your-movie-file.avi' with your video and format.  If mplayer can play the file then we can convert it into a DVD image.

The next step is to convert the video file into a DVD compatible MPG format.  You'll end up with two files, one audio and one video, titled *.m2v and *.ac3.  Execute the following command in the terminal:

movie-to-dvd -m pal your-movie-file.avi

The '-m pal' is the mode option.  As I'm in Australia and will be watching the resulting DVD on a PAL DVD player I specify that the mode I need is Pal.  If your DVD player requires a NTSC disk then simply substitute 'ntsc' for 'pal'.

Depending on your processor speed this can take a while.  A 1GB *.avi file takes around two hours on my computer.

When this process is over we need to merge the *.m2v and *.ac3 files back into a single DVD compatible *.mpg file.  To do this execute the following command in the terminal:

mplex -f 8 -o your-movie-file.mpg your-movie-file.m2v your-movie-file.ac3

The '-f 8' specifies that we want format number 8, which is DVD format.  If you've got a particularly small video file that will fit on a CD then you may use '-f 1' for a VCD.  The '-o' specifies that the following text will be the filename of your new file.

This will create a simgle *.mpg file and takes only a few minutes.

Next we need to format our DVD compatible *.mpg file so that it will function correctly.  Execute the following command in the terminal:

dvdauthor -o dvd/ -t your-movie-file.mpg

The '-o' specifies the output directory for the DVD file structure.  The 't' option sets the title of the disk, in this case it is simply the same as the filename.

Next we create a table of contents file so our DVD player knows where to find the movie.  Execute the following command in the terminal:

dvdauthor -o dvd/ -T

Now we need to make a disk image, or ISO file, that we can then transfer to a blank DVD.  To create the ISO file execute the following in the terminal:

mkisofs -dvd-video -v -o your-movie-file.iso dvd

The '-dvd-video' option generates a DVD-Video compliant UDF filesystem. The '-v' option (verbose) will print to the terminal the process of the operation. The '-o' option specifies the filename.  The 'dvd' option at the end specifies the location of the DVD file structure.

Now all we need to do is to copy the resultant *.iso file to a blank DVD.  To do this you can use your favourite DVD Writing application, such as Braesero, K3B etc., or you can simply right-click the *.iso file in nautilus and select 'Write to Disk'

Trackback URL for this post:

http://archive.simonives.info/trackback/138