Table of Contents

MEncoder

mencoder is the video/audio transcoding utility shipped with mplayer. Like the player, it's a very mighty utility, perfectly performing the tasks it was designed for.

DVD Ripping

This is how I used to rip my DVDs using mencoder (meanwhile I switched to using ffmpeg:

Information to have at hand when beginning

Ripping The Audio Track

% mencoder dvd://3 -aid 129 -ss 0:03:18 -af pan=2:1:0:0:1:1:0:0:1:0.5:0.5:0.5:0.5 \
	-ovc frameno -o frameno.avi -oac mp3lame -lameopts vbr=2

when mencoder finishes encoding audio, it will output some hints for later choice of video bitrate, pasting them to a temporary place is a good idea.

First Pass Of Encoding

% mencoder -dvd-device NBK_18 dvd://3 -ss 0:03:18 -oac copy -o /dev/null -ovc lavc \
	-lavcopts vcodec=mpeg4:vbitrate=1400:vhq:vqmin=2:vqmax=31:aspect=16/9:threads=4:vpass=1 \
	-vf crop=710:430

Second Pass Of Encoding

% mencoder -dvd-device NBK_18 dvd://3 -ss 0:03:18 -oac copy -o target_filename.avi -ovc lavc \
	-lavcopts vcodec=mpeg4:vbitrate=1400:vhq:vqmin=2:vqmax=31:aspect=16/9:threads=4:vpass=3 \
	-vf crop=710:430

Third And Subsequent Passes Of Encoding

Just repeat the second pass to achieve better results. Doing this more than four times is said to not help really much anymore.

Hints

To speed up or allow delayed encoding of a DVD, it's content is best copied to disk. I do this using vobcopy. Just create and change into a new directory, then run:

% vobcopy -m -i /mnt/dvd

where /mnt/dvd is the path to the mounted DVD drive. To allow mplayer/mencoder to operate on the ripped files on disk, the option -dvd-device /path/to/rip can be used.

Converting Audio Tracks

Not as easy as one may think, at least mencoder itself didn't let me do it. But luckily mplayer does the job:

% mplayer -ao pcm:file="audiotrack.pcm" -vo null audiotrack.m4a

for encoding I then simply use lame:

% lame -m s -q 2 --vbr-new -V 3 audiotrack.pcm audiotrack.mp3

Encoding to SVCD

DivX support in many DVD players is still completely broken. So instead of trying to find the right DivX encoding parameters for each DVD player device out there separately, using a well-known (and also well-supported) video format instead seems to be more practical. And this is where good old SVCD comes into play.

Extensive DVD Ripping Howto Encoding to VCD, SVCD or DVD