Perl programmer for hire: download my resume (PDF).
John Bokma MexIT
freelance Perl programmer

AVI to DVD on Ubuntu

Tuesday, July 28, 2009 | 1 comment

In the evening I wanted to convert a single AVI file to something I could burn on a DVD so it could be played back on a standalone DVD player. I had already learned how to burn VOB, BUP, and IFO to DVD on Ubuntu but had no idea yet how to convert an AVI file to those required files on a GNU/Linux operating system.

So I searched the Ubuntu community documentation using a smart keyword in Firefox I had created sometime ago, and found documentation on Tovid:

Tovid is a collection of video disc authoring tools. With Tovid, you can create DVDs and other video discs.

Installation of tovid on Unbuntu

I installed the tovid collection via the command line as follows:

sudo apt-get install tovid

The Tovid documentation mentiones that it's required to enable Multiverse. Since the apt-get install worked for me without any problems I guess I had already done so in the past, probably when I installed VLC media player.

Using tovid to convert AVI to MPEG

After the successful installation I converted the AVI to (S)VCD/DVD-complaint MPEG format - suitable for burning to CD/DVD-R for playback on a standalone DVD player - at the command line using tovid as follows:

tovid -in example.avi -out example

With example.avi the name of the AVI file, and example the desired output name. Note that the extension mpg is automatically added to the output file, which I forgot, so I ended up with a file named example.mpg.mpg. However, this is not a real issue and it can be fixed with using:

mv example.mpg.mpg example.mpg

The television standard tovid uses defaults to NTSC and the format defaults to DVD; both correct in my case as I am living in Mexico and I wanted a DVD. Check man tovid for a full list of options.

Creating the DVD file-system with menu

Next I used the todisc command-line script to create a DVD file-system with an animated thumbnail menu. Since I had only one video I used:

todisc -files example.mpg -titles "Example Title" -out result

to create a simple menu with a title for the video, and to write the DVD file-system to a directory named result.

If you have more than one file converted with tovid, list them after the -files option and follow the -titles option with a title for each video between double quotes.

After the todisc program had finished I checked the result directory with the ls -R command:

ls -R result
result:
AUDIO_TS  VIDEO_TS

result/AUDIO_TS:

result/VIDEO_TS:
VIDEO_TS.BUP  VIDEO_TS.VOB  VTS_01_0.IFO  VTS_01_1.VOB
VIDEO_TS.IFO  VTS_01_0.BUP  VTS_01_0.VOB  VTS_01_2.VOB

The file VTS_01_0.VOB when opened in VLC media player showed me the menu that was automatically created by the todisc command-line script: a rectangle with inside at the top the title I had specified, below the title an animation consisting of fragments out of the video, and below the rectangle the text "My Video Collection" - note that the latter can be changed with the option -menu-title. Since for now I was satisfied with the generated menu I decided to convert the DVD file-system to an ISO image.

Note that todisc has a lot of options to explore, see man todisc for a full list.

Creating a DVD ISO image with mkisofs

Since it was unclear to me from the Tovid documentation how to proceed; the section "Todisc Script" is followed by "Creating a Video Disc" which starts with

After Tovid has finished

Will finish this one soon, see: Burning VOB, BUP, and IFO to DVD on Ubuntu on how to convert the DVD-filesystem to an ISO image and burn the ISO image to an actual DVD.

Also today

Please post a comment | read 1 comment by Paul | RSS feed