[MPlayer-users] mencoder + x264 + pullup, softskip = a/v sync problems

matthew.garman at gmail.com matthew.garman at gmail.com
Fri Feb 23 04:45:47 CET 2007


I started a thread on this subject a couple weeks ago[1], but now
have more definitive symptoms and new information.

My intent: rip interlaced TV episodes from DVD to H.264 video and
Ogg Vorbis audio in a Matroska container.

My procedure is shown below[2].  This exact same procedure, minus
the "pullup,softskip" video filters, appears to work perfectly for
progressive sources that do not change framerate.

Here's what has changed since my last posting: the first part of the
script below generates an AVI with h.264 video and AC3 audio.  Even
*the AVI* is slightly out of sync.  So, for now, I believe we can
ignore the ogg+mkvmerge portions of the script.

The video is generally ahead of the audio by about 100--200ms.  I
can get near-perfect sync (of the AVI or mkv) by using mplayer's "-"
command once or twice during playback (ajusts audio delay by -0.1
seconds).

I don't know if this is relevant or not, but the +/- commands adjust
the audio exactly +/- 100ms on the mkv file; but on the AVI, the
adjustment is +/- 80--100ms.

I tried playing these videos in xine with the same result: audio
behind video about 100--200 ms.

Things currently trying/left to try:
    - encoding without bframes
    - using a different interlaced source[3]

MPlayer version: MPlayer 1.0rc1-4.1.1 (C) 2000-2006 MPlayer Team.
This is on a Gentoo Linux system, kernel 2.6.19-gentoo-r2.


If anyone can point out any obvious problems, or make any
suggestions, I'd be more than happy to hear them!

Thank you,
Matt



[1] Friday, Feb 9, 2007: mplayer-users: mencoder, x264, vorbis,
    matroska - bad a/v sync problems
    http://lists.mplayerhq.hu/pipermail/mplayer-users/2007-February/065422.html

[2] Simple script to rip interlaced DVD content to
    h264+vorbis+matroska:

    for i in *.vob ; do
        fnbase=`basename $i .vob` ;
        src=$i ;
        echo -e "\n\n\n\n====== $fnbase ======\n" ;
        date ;
        time nice -n 1 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 pullup,crop=720:352:0:66,hqdn3d=2:1:2,pp=ac,softskip,harddup \
            -idx -o /dev/null \
            $src >> mencoder.log 2>>mencoder_stderr.log ;
        date ;
        time nice -n 1 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 pullup,crop=720:352:0:66,hqdn3d=2:1:2,pp=ac,softskip,harddup \
            -idx -o ${fnbase}.avi \
            $src >> mencoder.log 2>>mencoder_stderr.log ;
        date ;
        mplayer $src -ao pcm:fast:file=${fnbase}.wav -vc dummy \
            -aid 128 -alang en -vo null ;
        date ;
        oggenc -q7 ${fnbase}.wav ;
        date ;
        vorbisgain ${fnbase}.ogg ;
        date ;
        mkvmerge -o ${fnbase}.mkv -A ${fnbase}.avi ${fnbase}.ogg ;
        date ;
    done

[3] Current source material is "House, MD" Season 1.  In my earlier
    posts, I was working with Season 2 of the same series---which is
    *not* interlaced.  But Season 1 *definitely* is.  The next thing
    I attempt will be "The Simpsons" Season 9.




More information about the MPlayer-users mailing list