[MPlayer-users] audio and video auto of sync ..looking for solution

RC rcooley at spamcop.net
Tue Apr 4 07:00:10 CEST 2006


On Tue, 4 Apr 2006 00:18:21 +0200
wim delvaux <wim.delvaux at adaptiveplanet.com> wrote:

> 1, split video and audio
> 2. truncate audio (which is faster than video so there should be
> excess audio) 3. now I have and good length video and audio file.
> 4. remerge them remove a frame here and there.  Since this is PAL at
> 25 fps  and suppose I have 10 seconds too much, I need to remove 250
> fps all over the  movie which should be unnoticable.
> 
> So would this work and how can I do this ?

Wow!  That's so far off the mark, I don't know where to start.

Just because audio is further along, doesn't mean there's MORE of it. 
It could end halfway through the movie.  It's almost always safe to
assume that audio and video are pretty close to the same length, and any
mis-match is supposed-to be smoothed over by delays and pts in the
container (AVI, MOV, etc.).

How to deal with it depends on the type of delay.  If the audio is a
fixed ammount of time ahead/behind the video, and that gap remains
constant, you just set an audio delay to fix it.  If the delay is
continally increasing, then the framerate can be changed to accomodate
that.

The first thing to try, is playing it, and/or reencoding it with
different values of -mc.  Many sync problems I've come across have been
fixed simply by re-encoding the video with: mencoder -oac copy
-ovc copy -mc 0.  That's the most likely culprit, and you should try
that first.  Try at least -mc 0, 0.001, 1, 10.

If that doesn't work, try the -delay and -audio-delay flags, to get it
closer to matching up.  When you get it closer, then the a/v sync code
make kick-in, and fix the rest of it.




More information about the MPlayer-users mailing list