Linux – Ripping DVD’s To AVI’s At The Command Line

image_pdfimage_print

You can backup your DVD’s to AVI files for archival purposes in Linux by using mencoder at the command line. Mencoder is installed on most Linux distributions when you install mplayer. The command is:

$ /usr/bin/mencoder dvd://1 -ovc lavc --af volnorm=1 \
-alang en -oac mp3lame -lameopts cbr:preset=128 \
-lavcopts vbitrate=900:v4mv:vhq:vcodec=mpeg4 -vf \
pp=de,scale=480:-2 -nosub -o filename.avi

This will produce an AVI file around 600-700 MB in size using English for the language option. It will also perform volume normalization, and strip the subtiles from being displayed. The audio will also be sampled at a constant bit rate of 128kbit/s. If you wanted to increase the video quality at the expense of filesize you could bump up the vbitrate=900 option until you are satisfied.

This command could be inserted into a simple bash script so that it can be reused easily.

#!/bin/bash

#Simple DVD to AVI script for archiving.
#By: Ronny L. Bull
#Version: 1.0
#Date: 8-05-2011

echo "Enter the DVD Title"
read TITLE

echo "Where would you like the file to be ripped to? (FULL PATH)"
read PATH

echo "Ripping: $TITLE to $PATH"

/usr/bin/mencoder dvd://1 -ovc lavc -af volnorm=1 \
-alang en -oac mp3lame -lameopts cbr:preset=128 \
-lavcopts vbitrate=900:v4mv:vhq:vcodec=mpeg4 \
-vfpp=de,scale=480:-2 -nosub -o "$PATH/$TITLE.avi"

echo "Ripping of - $TITLE - is done"

echo "Your file can be found at $PATH/$TITLE.avi"

echo "Ejecting DVD now. Please wait ..."

/usr/bin/eject

exit