[Tutorial] Convert Xvid or Avi to DVD Format in Ubuntu

Today I want to backup all my tutorial videos into DVDs, but the problem is all my videos are not in DVD format. Some are .avi, .flv, .mov and these type of file cannot be converted to DVD video. You need to convert them to .mpg format first then compile to DVD format.

First you need to install these tools:

  1. mencoder
  2. ffmpeg

If you don’t have that yet, you can install with this command:

sudo apt-get install mencoder ffmpeg

If you already have then continue with this step:

1. Convert media to .avi format (if your file already in .avi, then continue to next step):

mencoder (inputfile) -ovc xvid -xvidencopts pass=1 -oac mp3lame -lameopts vbr=3 -o /dev/null

After which type:

mencoder (inputfile) -ovc xvid -xvidencopts pass=2:bitrate=1000 -oac mp3lame -lameopts vbr=3 -o (outputfile)

If you like to add subtitle use this command:

mencoder (inputfile) -sub  -ovc xvid -xvidencopts pass=2:bitrate=1000 -oac mp3lame -lameopts vbr=3 -o (outputfile)

2. Up to this step I assume you already have .avi file format. Then continue to convert to .mpg file:

ffmpeg -i (inputfile) -target pal-dvd final.mpg

If your DVD player uses NTSC then replace the ‘pal’ to ‘ntsc’. Example:

ffmpeg -i (inputfile) -target ntsc-dvd final.mpg

Or if you want you can type:

ffmpeg -i (inputfile) -target pal-dvd -aspect 16:9 final.mpg

This will make the aspect ratio 16:9, see if it works for you.

Now you already have .mpg file, later I will show you how to make the DVD video with this file.

Have a nice day…