mencoder: useful options

Keywords: mencoder, video
Versions: mencoder 1.0pre7

  • Resolutions should always be dividable by 16
  • borders should be cut off

When ripping a dvd:

for pass in 1 2
        mencoder -dvd 1 \ 
                -oac mp3lame \ 
                -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=1000:vhq:vpass=$pass:aspect=1.78/1

When reencoding only the video portion of an existing file:

for pass in 1 2
        mencoder \ 
                raw.avi \ 
                -oac copy \ 
                -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=1000:vhq:vpass=$pass

When ripping a dvd stored in a filesystem using constant quant., as well as scropping and scaling to make a perfect fit and adjusting volume:

mencoder dvd://14 \ 
         -dvd-device . \ 
         -mc 0 \ 
         -af volume=10 \ 
         -vf crop=714:427:3:75,scale=704:416 \ 
         -force-avi-aspect 21:9 \ 
         -oac lavc \ 
         -ovc lavc \ 
         -lavcopts acodec=ac3:abitrate=160:vcodec=mpeg4:vqscale=3.25:vhq:v4mv \ 
         -o movie.avi

When recording live tv or vhs:

mencoder \ 
        -tv on:driver=v4l:device=/dev/video1:input=1:width=384:height=288:amode=1:forcechan=2:alsa:audioid=0 \ 
        -oac mp3lame \ 
        -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=2000

When creating a dvd from file:

mencoder \
        -vf scale=720:576,harddup \
        -srate 48000 -af lavcresample=48000 \
        -oac lavc \
        -ovc lavc \
        -lavcopts acodec=ac3:abitrate=192:vcodec=mpeg2video:keyint=12:vrc_buf_size=1835:vrc_maxrate=9800:vbitrate=4000:aspect=16/9 \
        -ofps 25 \
        -of mpeg -mpegopts format=dvd
        -o movie.mpg movie.avi

Related notes for 'mencoder':
mplayer: compile in SuSE Linux 9.x

Related notes for 'video':
mplayer: work around poor quality mp2 audio playback

Enter new comment:

The comment will only be accepted when the following question is answered correctly:
How many dwarfs are there in snow white and the seven dwarfs?

(Dear handmade spam sender: The URL will only be linked to after my approval, which you will not get.)