[MPlayer-users] mencoder, x264, vorbis, matroska - bad a/v sync problems

matthew.garman at gmail.com matthew.garman at gmail.com
Tue Feb 20 15:15:51 CET 2007


On Wed, Feb 14, 2007 at 09:08:29PM +0100, Moritz Bunkus wrote:
> > Well, the mkvmerge tool won't take AVI directly[2].
> 
> That's not true anymore. mkvmerge brings support for raw AVC ES
> streams and AVC in AVI with release 2.0.0, but if you want to use
> this you should upgrade to the current development version from my
> Subversion repository. You don't need MP4Box anymore, neither
> avi2raw, if you want h264 in Matroska.

Well, it appears that I finally got it working!

I made two changes, so I'm not sure which "fixed" the problem:
(1) removed the pullup,softskip from the video filter chain[1], and
(2) upgraded to mkvtoolnix 2.0.0 (not from svn though).

I still need to do some testing with source material that actually
needs -vf pullup,softskip.  Wish me luck...


Here's my quick'n'dirty script, for anyone who's interested.

# assuming the episodes you want are titles 1--4 on your DVD
for i in 1 2 3 4 ; do
    fnbase="house_s2_d1_ep${i}" ;
    dvddevice="/dev/hda"
    time nice -n 10 mencoder -aid 128 -alang en -oac copy \
        -ovc x264 -x264encopts \
        bitrate=2000:partitions=all:8x8dct:me=umh:subq=6:frameref=5:threads=auto:pass=1:turbo=1:bframes=4:b_pyramid:weight_b \
        -ofps 24000/1001 -of avi -vf hqdn3d=2:1:2,pp=ac,harddup -idx \
        -o /dev/null \
        -dvd-device  ${dvddevice}  \
        dvd://$i >> mencoder.log 2>>mencoder_stderr.log ;
    time nice -n 10 mencoder -aid 128 -alang en -oac copy  \
        -ovc x264 -x264encopts bitrate=2000:partitions=all:8x8dct:me=umh:subq=6:frameref=5:threads=auto:pass=2:bframes=4:b_pyramid:weight_b \
        -ofps 24000/1001 -of avi -vf hqdn3d=2:1:2,pp=ac,harddup -idx \
        -o ${fnbase}.avi \
        -dvd-device ${dvddevice} \
        dvd://$i >> mencoder.log 2>>mencoder_stderr.log ;
    mplayer -dvd-device ${dvddevice} \
        dvd://$i -ao pcm:fast:file=${fnbase}.wav -vc dummy \
        -aid 128 -alang en -vo null ;
    oggenc -q7 ${fnbase}.wav ;
    vorbisgain ${fnbase}.ogg ;
    mkvmerge -o ${fnbase}.mkv -A ${fnbase}.avi ${fnbase}.ogg ;
done


Thanks everyone for your help and suggestions (and patience),
Matt



[1] Season 1 of my source material was interlaced, season 2 is not.
    All this frustration and I didn't do a sanity check on the
    source material (any and all verbal abuse is warranted at this
    point)!



More information about the MPlayer-users mailing list