[MPlayer-dev-eng] How do I synchronize audio and video stream correctly after a seek in .rm

Arpi arpi at thot.banki.hu
Wed Nov 19 11:42:07 CET 2003


Hi,

> As some of you may have noticed I am experimenting with realmedia
> streams from omroep.nl.
> Yesterday I discovered how to detect keyframes in a real rtsp stream,
> and I fixed indexing and seeking within a (-dumpstreamed) real stream
> (No SEGV anymore for me :-).
> 
> The next problem is synchronizing the audio and video stream correctly.
> The audio and video keyframes are not there at the same time. Not even
> close. It happens a lot of time that they are about 2 seconds apart
> from each other.
> After the seek the resulting 'A-V' figure is 'a bit' off. This is
> corrected very quickly if I use '-mc 10 -autosync 1' but I would like a
> better solution.

No, in G1 it's the only way now, unless you change the a-v sync core :(

> Is it possible that
> 1. after a seek one stream waits for the other to catch up
> 2. decoded audio is skipped until it matches the timestamp of video
> 3. silence is inserted in audio until video catches up.
> 4. or something else?

probably the best would be moving the audio block reordering from ad_read to
demux_real, so you could seek audio stream more accurate.
currently you seek to big block boundary, which blcok is constructed from
reordered small (few 100 bytes) sub-blocks.

it should be done anyway, as libavcodec's real decoders expect reordered
blocks.

btw, we have demux_realaudio and demux_real, so we should first merge them
to avoid code duplication (block reorders for various formats)


A'rpi / Astral & ESP-team

--
Developer of MPlayer G2, the Movie Framework for all - http://www.MPlayerHQ.hu



More information about the MPlayer-dev-eng mailing list