Wednesday, September 3, 2008

Ripping DVDs into AVI files

Ripping DVDs in Linux using mencoder is tricky business. No doubt mencoder is the most powerful tool at your disposal with a wide variety of options to convert practically from any format to any format. This in turn also becomes its disadvantage - there are too many options, which an ordinary user cannot understand. There were nearly a 1000 options out there, with a variety of combinations between them, most of which keep taking about stuff like deinterlacing, quantization and key frames.

After trying a number of times to rip DVDs unsuccessfully in Linux, I recently struck gold, while googling, in a discussion forum on how to do this correctly. This is the command that worked flawlessly for me
/usr/bin/mencoder -vf harddup -vf-add 
smartblur=.6:-.5:0,unsharp=l5x5:.8:c5x5:.4
-vf scale=480:360 -xvidencopts
bitrate=900:profile=dxnhtntsc -lameopts
cbr:br=128:aq=0:vol=1 -oac mp3lame
-ovc xvid -o outfile.avi *.vob

The scale= could be used to set the new size of the AVI file. Lesser sizes will result in lesser space. The bitrate= also controls the quality of the movie generated, and is inversely related to the size of the generated AVI file.

Download the mencoder (located in the mplayer package) from some default distribution (I used yum to get it), so that most of the required options are compiled in.

No comments: