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

The Wanderer inverseparadox at comcast.net
Tue Apr 4 15:57:31 CEST 2006

wim delvaux wrote:

> HI all.,
> I have some recordings where audio and video are out of sync.

Out of sync how?

Is the audio a fixed amount of time ahead of (or behind) the video? If
so, the solution is the '-delay' option; read the man page.

Is either the audio or the video played too fast, such that they start
out in sync but get farther and farther apart as playback continues? If
so, the problem is almost certainly that the file's claimed or detected
FPS is wrong, and the solution is to pass the correct frame rate to the
'-fps' option.

Does the sync vary wildly over the course of the movie - in sync
sometimes, video ahead of audio other times, audio ahead of video other
times? If so, then the problem is almost certainly a bad file, and there
is no certain solution available that I know of; the only potential
answer I can think of, which is less than ideal, is to fiddle with
various values for the '-mc' option and see if the problem becomes small
enough to be safely ignored.

> Except for complex cut and past editing there might be a solution for
> this but I do not know how I can acchieve this with mencoder.
> my idea is as follows,
> 1, split video and audio

mplayer input_file-ao pcm:filename=output_file.wav

Then use the '-nosound' option whenever dealing with the original file
alone, and the '-audiofile' option whenever you want to mix in audio
from your new external file.

> 2. truncate audio (which is faster than video so there should be
> excess audio)

Should be asily enough done with whatever WAV-handling program you have

The fact that "audio is faster than video" makes this sound like the
second of the cases I listed above, in which case all of this should be
unnecessary if you can get the frame rate correct.

> 3. now I have and good length video and audio file.

Although you've quite possibly/probably lost relevant information, if
something which should have been played during the video has now been
chopped off of the end...

> 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.

No ready way to do this that I know of, short of the "complex cut and
paste editing" you mentioned.

> So would this work and how can I do this ?

Maybe, and aside from the above, no idea. It shouldn't be necessary,
though - you're probably making matters more complex than they need to

       The Wanderer

Warning: Simply because I argue an issue does not mean I agree with any
side of it.

Secrecy is the beginning of tyranny.

More information about the MPlayer-users mailing list