[MPlayer-users] audio sync -- the final step between me and happiness.

Noah Spurrier noah at noah.org
Tue Jun 13 01:27:09 CEST 2006

I know a lot has been said about audio sync, but I'm just not getting it. The
audio seems to start off in sync, but slowly drifts. These are the exact
I'm using to transcode a DVD VOB file to MPEG4/MP3 AVI.

    # Extract raw PCM audio (defaults to audiodump.wav)
    mplayer SRC.VOB -vc null -vo null -aid 129 -ao pcm:fast -noframedrop
    # Compress raw PCM audio to 96kbps MP3 (note CBR, not VBR, so this
should be safer).
    lame -h --athaa-sensitivity 1 --lowpass 16.0 --cbr -b 96 --resample 32
audiodump.wav audiodump.mp3
    # Transcode video pass 1
    mencoder SRC.VOB -o videodump.avi -oac copy -ovc lavc -lavcopts
    # Transcode video pass 2
    mencoder SRC.VOB -o videodump.avi -oac copy -ovc lavc -lavcopts
    # Mix video and audio together to final video container
    mencoder -oac copy -ovc copy -o video_final.avi -audiofile
audiodump.mp3 videodump.avi

Note that I do no use -nosound in any step because the docs say that removing
the audio prematurely can cause audio sync problems later on -- I leave the
original audio in until the final mux step.

My thought is that perhaps in the final mux step that mencoder does not know
which audio id in the videodump.avi to sync with the audiodump.mp3. My source
file has three different aid tracks (128,129,130). I'm grabbing aid=129.
If I try to play the VOB file with mplayer it defaults to playing track
130, so
I perhaps mencoder also uses this default track to sync with the MP3.

I'm trying to create an automated system to compress DVD VOB files to MPEG4.
I'm worked out all the quirks except for the audio sync. I'm so close that
I can taste it... Argh!


More information about the MPlayer-users mailing list