[MPlayer-users] Bad audio-video sync with a FLV

Nicolas George nicolas.george at normalesup.org
Fri Jul 25 16:31:36 CEST 2008

Le quintidi 5 thermidor, an CCXVI, Vladimir Mosgalin a écrit :
> All in all, usually there _is_ some way to play such files in sync. The
> question I'm actually interested in, is there way to fix such files with
> ffmpeg or mencoder (without re-encoding, of course). When I tried
> remuxing .avi which required -mc 0 for correct sync a while ago, the
> resulting avi wasn't in sync when played back without -mc 0 too. That's
> the most annoying thing about all these sync problems - even if you know
> the solution, there is no way to "apply" it permanently.

I think the answer to that question is not the same whether the original
video is actually correct or not.

First of all, there may be demuxer bugs that case mplayer to work with wrong
PTS. This case is easy: demuxer bugs should be fixed.

Possibility #2 is that the original video file is incoherent. For example,
the video stream could announce PTS = 1 while the actual number of decoded
samples is only 47999. In that case, the video needs to be fixed.

For the next case, I would like to introduce the "ideal player": it is an
imaginary video player that manages to display each frame at exactly its
intended timestamp. Then we have:

Case #3: the video would play fine in an ideal player.

Case #4: the video would be desynced in an ideal player.

My natural reaction is to consider that case #3 means that the video
correct, and that mplayer should be able to play it, while case #4 mens that
the video is broken and needs to be repaired.

But it may happen that utterly broken videos are so common and so hard to
recognize that it is best for the user to play them correctly and break on a
few correct video. I do not know.

Are there examples of videos that play fine without options, but not with
-mc 100 or some other huge value? I would also like to study a video that
needs -mc 0 to play correctly.

Broken videos in case #4 could probably be repaired by remuxing it, but I do
not know which tool allow to manipulate timestamps really freely. If no such
tool exists, it must be created.

I think it would be very useful to start a catalogue of all known sort of
audio-video desync with technical explanations and ways to fix. Some sort of
wiki would probably be the best medium. Maybe somewhere inside

For example, the entry for the problem at the beginning of this thread would
look like:

Short description: small time base and irregular frame timestamps

Known affected players: mplayer

Known unaffected players: ffplay

Technical explanation: The time base of the video stream is quite small,
typically 1 ms, and the timestamps of the video frames are not perfectly
regular (maybe due to successive rounding in incompatible time bases). For
some reason probably linked to the irregularity of the timestamps, mplayer
needs to apply a small correction to each frame, typically about 0.5 ms.
Unfortunately, the default maximum correction is 10% of the time base, which
is too small (0.1 ms in our example).

Solution to play correctly: mplayer -mc 1

Solution to fix the video: unknown


  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-users/attachments/20080725/37bea4f3/attachment.pgp>

More information about the MPlayer-users mailing list