[MPlayer-dev-eng] [PATCH] Detect and compensate pts reset in MPEG streams

Michael Niedermayer michaelni at gmx.at
Thu Oct 7 02:52:56 CEST 2010


On Wed, Oct 06, 2010 at 11:40:38PM +0200, Nicolas George wrote:
> Le quintidi 15 vendémiaire, an CCXIX, Michael Niedermayer a écrit :
> > if its the authoring tools then mplayers native demuxer should return equal
> > dts too
> 
> I am not sure we are really speaking about the same thing. The stream I took
> as a working example looks like that as seen by lavf (and ffprobe, and vim
> for reformatting):
> 
> stream 1 (audio) pts=87.164000 dts=87.164000 duration=0.032000 flag=K
> stream 1 (audio) pts=87.196000 dts=87.196000 duration=0.032000 flag=K
> stream 0 (video) pts=87.180000 dts=87.180000 duration=0.040000 flag=_
> stream 0 (video) pts=N/A       dts=87.220000 duration=0.040000 flag=_
> stream 0 (video) pts=87.260000 dts=87.260000 duration=0.040000 flag=_
> stream 0 (video) pts=87.300000 dts=87.300000 duration=0.040000 flag=_
> stream 0 (video) pts=N/A       dts=87.340000 duration=0.040000 flag=_
> stream 0 (video) pts=87.380000 dts=87.380000 duration=0.040000 flag=_
> stream 1 (audio) pts=87.228000 dts=87.228000 duration=0.032000 flag=K
> stream 1 (audio) pts=87.260000 dts=87.260000 duration=0.032000 flag=K
> stream 1 (audio) pts=87.292000 dts=87.292000 duration=0.032000 flag=K
> <snip 90 audio packets>
> stream 1 (audio) pts=90.204000 dts=90.204000 duration=0.032000 flag=K
> stream 1 (audio) pts=90.236000 dts=90.236000 duration=0.032000 flag=K
> stream 1 (audio) pts=90.268000 dts=90.268000 duration=0.032000 flag=K
> stream 0 (video) pts= 0.135267 dts= 0.095267 duration=0.040000 flag=K
> stream 0 (video) pts=N/A       dts= 0.135267 duration=0.040000 flag=_
> stream 1 (audio) pts= 0.135267 dts= 0.135267 duration=0.032000 flag=K
> stream 1 (audio) pts= 0.167267 dts= 0.167267 duration=0.032000 flag=K
> 
> As you can see, the audio stream jumps from 90.268000 to 0.135267 for no
> reason at all, and this is completely uncorrelated to the duration of the
> packet. Maybe the authors really wanted 0.135267 seconds worth of silence,
> who knows?

These numbers look perfectly valid, i see nothing odd in there


> 
> The patch I submitted decodes it as:
> 
> stream 1 (audio) pts=90.268000 dts=90.268000 duration=0.032000 flag=K
> stream 0 (video) pts=90.403267 dts= 0.095267 duration=0.040000 flag=K
> stream 0 (video) pts=N/A       dts= 0.135267 duration=0.040000 flag=_
> stream 1 (audio) pts=90.403267 dts= 0.135267 duration=0.032000 flag=K
> stream 1 (audio) pts=90.435267 dts= 0.167267 duration=0.032000 flag=K

the dts in there surely dont match the pts


> 
> That is obviously not perfect, but it is reasonable, and I do not think
> anything could be perfect with such bad input. In that case, keeping things
> simple may be the best course.
> 
> > ill try to look into it
> > a small sample file that shows the problem so i can confirm that it fixes it
> > would be usefull
> 
> Again, I am not sure what problem you want to investigate: timestamps resets
> or seeking in DVDs with the lavf demuxer?

seeking in dvds, is there a small sample somewhere on mphq that shows the
problem

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Those who are best at talking, realize last or never when they are wrong.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20101007/39ae3c50/attachment.pgp>


More information about the MPlayer-dev-eng mailing list