Rip a DVD and encode as Xvid with mencoder

  • Determine what is the longest title in the dvd. Usualy it’s the longest:
lsdvd -d /dev/dvd | grep Longest
  • Determine the croping to be applied to avoid encoding black bars:
mplayer dvd://[longest_title] -chapter 3 -vf cropdetect
  • Based on the correct aspect ratio, decide what will be the desired final resolution. Here are some examples:

480:368 gives AR=1.30:1
656:368 gives AR=1.78:1
720:304 gives AR=2.37:1
704:304 gives AR=2.32:1

  • I’m using 2-pass encoding and converting the sound to mp3. Here are the mencoder commands:
mencoder \

dvd://[title_to_encode] \

-vf crop=[cropping],scale=[final_resolution] \

-ovc xvid -xvidencopts chroma_opt:quant_type=mpeg:bitrate=[video_bitrate|-desired_size_in_kB]:pass=1 \

-oac copy \

-o /dev/null

mencoder \

dvd://[title_to_encode] \

-vf crop=[cropping],scale=[final_resolution] \

-ovc xvid -xvidencopts chroma_opt:quant_type=mpeg:bitrate=[video_bitrate|-desired_size_in_kB]:pass=2 \

-oac  mp3lame -lameopts preset=[audio_bitrate] \

-o [filename].avi
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s