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

Joakim Plate elupus at ecce.se
Mon Oct 22 16:38:41 CEST 2012


Michael Niedermayer <michaelni <at> gmx.at> writes:

> 
> yes and
> Supporting seeking per time with timestamp discontinuous files would
> be nice to have but its not so easy as this patch.
> It should be outside any single demuxer as its not just mpegts, it
> should be optional and it should handle more than 1 timestamp
> discontinuity.

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.

Separating it out to external file might be doable thou.

> In practice this would require keeping track of all encountered
> discontinuities and adjusting timestamps according to that list.
> That is both what is output and for and during seeking.
> The price one has to pay for such a feature would be that if its
> enabled timestamp would not be guranteed to be stable, that is when
> one seeks to the end one gets a timestamp E and if one now seeks back
> to the begin and plays the whole file then any subsequent seeks to the
> end could easily result in different value from E when more
> discontinuities where encountered between

For the simple wrapping case (ie only wraps on timestamp overflow), you
could deduce timestamp wrapping points based on bitrate with reasonable
certainty.

Note that this patch would not really break support for a "proper"
discontinuity handling since those would pass unscathed (apart from a offset).

Joakim




More information about the ffmpeg-devel mailing list