Marc-André Lureau
2010-Apr-01 10:42 UTC
[theora] Ogg/theora a/v sync issue with liboggplay
Hi, The following url is being played with incorrect a/v sync in Firefox: http://195.10.10.216/flumotion/videodemo/med.ogg?token=c965dab73e5ed982821e01174e87925a4bb3134e4bb9aaec (it is time limited, but should work a few days, I could provide) Tested with 3.6.3pre on Linux (with and without PulseAudio) and Firefox 3.6 on Windows XP. Looking at firefox source code, I found the library that is supposed to do a/v sync for ogg is liboggplay. glut-player, compiled from git master (3901c1c38), shows the same a/v sync issue. I ran oggplay-info and noticed that the theora overrun histogram is quite important. Theora: Track 0 Worst overrun: 271 frames Average overrun: 263.202 frames Histogram bucket size: 13.550 Histogram: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 42 2022 SD of overrun: 3.162278 Vorbis: Track 1 Worst overrun: 23552 frames Average overrun: 10787.287 frames Histogram bucket size: 1177.600 Histogram: 94 109 109 116 107 108 156 118 107 115 109 119 117 128 118 107 96 77 39 13 2 SD of overrun: 6028.785367 Is the stream bad, or is liboggplay doing incorrect a/v sync? It looks to me like liboggplay should do correct sync, given the output of: $ oggplay-info demosite.ogg Reading 2 tracks ... Theora: Track 0 ... ok ... Vorbis: Track 1 ... ok ... track 0 required 1 times [1892128590] track 1 required 2 times [1892128593, 1892128614] thanks for your help -- Marc-Andr? Lureau
xiphmont at xiph.org
2010-Apr-02 09:39 UTC
[theora] Ogg/theora a/v sync issue with liboggplay
> Is the stream bad, or is liboggplay doing incorrect a/v sync?It appears that audio is substantially leading video in the stream. Although both are timestamped, this isn't strictly correct behavior; a stream is supposed to be multiplexed in time order. I'm guessing that liboggplay is simply assuming correct time multiplexing and assuming that each stream's start offset is to be corrected to a time of zero. So... there's a bug in both. Many live television streams start out as MPEG2, and MPEG2 can have a substantial A/V offset; whatever is doing the encoding is not accounting for it, and so the stream multiplex is way out of sync. BUT A decoder that is working properly should still account for that because it has the timestamps. It will have to buffer way more data then normal to cope, but it should still be capable of sync. Monty