[MEncoder-users] dvd rip -> x264 + ogg -> mkv or mp4 containers, using mencoder

Everett everettraygun at gmail.com
Sat May 27 04:40:28 CEST 2006


this is my first post.  forgive me if it's not helpful or if it's been gone 
over already.

I have found a solution/workaround for a problem that I had trouble finding an 
answer for.  I see that someone recently posted this problem in another form, 
i.e. how to get mencoder to encode for ipod.

this is the series of commands that I use to get an excellent rip of a dvd.  I 
do a streamdump of the dvd using 
$mplayer dvd://1 -dvd-device /mnt/<mydvdmount> -dumpstream -dumpfile rip.vob

here are the commands I used for disc one of the extended "lord of the rings, 
fellowship of the rings" :

<pass1>
$mencoder rip.vob -vf pullup,softskip,crop=720:352:0:62 -nosound -ovc x264 
-x264encopts bitrate=1000:subq=4:bframes=3:b_pyramid:weight_b:turbo=1:pass=1 
-ofps 24000/1001 -of rawvideo -o video.264

<pass2>
$mencoder rip.vob -vf pullup,softskip,crop=720:352:0:62 -nosound -ovc x264 
-x264encopts 
bitrate=1000:subq=6:frameref=6:4x4mv:8x8dct:me=3:bframes=3:b_pyramid:weight_b:pass=2 
-ofps 24000/1001 -of rawvideo -o video.264

<put video in mp4 format, mkvmerge doesn't accept raw x264 nor x264 in an avi 
file (properly)>
$MP4Box -fps 23.976025 -add video.264 video.mp4

<dump audio to wav>
$mplayer rip.vob -vo null -ao pcm:file="audio.wav"

<encode wav to ogg>
$oggenc -q8 audio.wav

<stick together in matroska file>
$mkvmerge -o rip.mkv audio.ogg video.mp4

<watch with mplayer>
$mplayer -fs rip.mkv
this makes a sweet rip with hiq ogg and x264 video.  the output format 
rawvideo encodes only the video, you can't encode audio at the same time.  I 
didn't want to anyway, since I wanted to use ogg.
You have to use .264 as the file extension for MP4Box (which I renamed as root 
to mp4box hahahahaha  wtf?).
(#mv /usr/local/bin/MP4Box /usr/local/bin/mp4box)

mp4box is part of mpeg4ip.  mkvmerge is part of mkvtoolnix.

for ipod, you would have to use faac or something for the audio, and of course 
you'd have to scale it or whatever down to the right size.  I don't have an 
ipod video (yet!!).
(also, you'd have to change the commands for mp4box to include the audio, and 
of course skip the mkvmerge step.)

I hope this helps someone.
I wanted to do it because I'm going to stick both the discs together into one 
file using mkvmerge.
-- 
http://www.shadowrise.com



More information about the MEncoder-users mailing list