[MPlayer-dev-eng] Re: [PATCH] dvr-ms fixes for pts, key frame detection and seeking

John Donaghy johnfdonaghy at gmail.com
Fri Feb 9 05:01:16 CET 2007

> i cant follow your reasoning, mpeg-ps provides timestamps starting at
> random
> values and does not even have to provide them for all I frames but rather
> just
> once in a while, and lavf has no problems producing correct timestamps for
> that
> by parsing MPEG-ES headers in an AVParser, so any dvr-ms issues would
> likely
> be in the asf demuxer providing wrong timestamps (compared to missing
> ones)
> do you have a dvr-ms sample which shows the problem with lavf?

I do have a sample that shows the AV sync issue with lavf (at least when
it's played with "mplayer -demuxer 35") and I've uploaded it to
ftp.mplayerhq.hu (it's called "9am with David and Kim_TEN
Digital_09_11_2006_10_49_52.dvr-ms"). This one has video pts values on
I-frames only.

I'm not even going to pretend to be an expert here - I know a little bit
about asf and dvr-ms and almost nothing about codecs. I dont know, for
example, if you can extract timings from the audio frames. But as far as I
can tell, where the timings come from seems to be the problem here. The ASF
container provides the pts values for audio and video that the current
libmpdeux asf demuxer uses. With this file, the 2 streams dont sync. The
lavf demuxer gets the video timings from the codec (right?) and I dont know
how it gets the audio timings - but I think it uses what the demuxer
supplies. In any case you get the same AV sync issue with both demuxers on
this file.

So I reasoned that the only way to sync the AV was to get correct pts values
for both streams from the container. And I firmly believe that this is what
the MS Players do to play dvr-ms files correctly. This is further backed up
by the fact that if I use the PTS values I found buried in the payload
extension system for both audio and video, then AV always syncs in all
samples that I (and a few others) have tried.

Maybe there is another way to do this and if so, I'm open to trying it, but
using the container pts values seems like the cleanest approach to me even
if a little bit of interpolation has to be applied between I-frames.

More information about the MPlayer-dev-eng mailing list