[FFmpeg-devel] [RFC] mpegts: Provide a monotonic timestamp to the outside world

Harald Axmann harald.axmann at hotmail.com
Mon Oct 22 23:39:34 CEST 2012

On 22.10.2012 16:38, Joakim Plate wrote:
> I do agree that that would be optimal. But it's very unlikely a patch 
> for a
> complete solution  will surface anytime soon since it will get so much 
> more
> complex.
> Unless Harald Axmann is up for the task, I suppose we'll have to keep
> something like this in our local clone of ffmpeg for the time being.
> mpegts is mostly used for broadcast in our use case, and recordings
> longer than the timestamp wrapping are very very unlikely, while
> wrapping once somewhere in them are likely.

What I could do is have a look if it is possible to change XBMC's 
seeking algorithm to a byte-based version for file formats allowing 
discontinuities. Perhaps this would be the cleanest solution for XBMC. 
But I'm afraid, I definitely don't have enough time to implement the 
mentioned perfect solution. This would be surely a tough piece of work.

But just as a fundamental question: Is there any reason to keep the 
original time stamp, as Hendrik Leppkes requested. What is the benefit? 
IMHO the TS time stamp is arbitrary and it does not matter, if an offset 
is applied or not, as long as the final value is wrapped again with 33 
bits. The important thing seems to be the relation of the DTS and the 
PTS to the PCR. With the proposed patch all files should be playable as 
before, even if the time stamp saved at the beginning for correction is 
wrong. For any TS discontinuity or whatever the behavior would be 
identical to the current one.

But it would make things easier for XBMC and perhaps also for other 
applications as long as we don't have a perfect solution. After all I 
must say, that time-based search really works great on DVB MPEG-TS 
files, as they generally have nice monotonic time stamps.

More information about the ffmpeg-devel mailing list