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

Nicolas George nicolas.george at normalesup.org
Wed Oct 6 23:40:38 CEST 2010


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?

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

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?

Regards,

-- 
  Nicolas George
-------------- 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/20101006/3ff9cb9c/attachment-0001.pgp>


More information about the MPlayer-dev-eng mailing list