[FFmpeg-devel] [RFC] mpegts: Provide a monotonic timestamp to the outside world
tomas.hardin at codemill.se
Mon Oct 22 13:28:51 CEST 2012
On Mon, 2012-10-22 at 08:04 +0000, Joakim Plate wrote:
> Hendrik Leppkes <h.leppkes <at> gmail.com> writes:
> > Hi,
> > I handle the wrapping in my application directly, and IMHO thats the
> > proper thing to do. The demuxer should expose the timestamps as they
> > are specified in the file, and anyone trying to consume a MPEG-TS file
> > needs to be able to deal with these kinds of timestamps (timestamps in
> > MPEG-TS are not really guaranteed to be fully continuous, i have
> > plenty samples where it just jumps around in the middle of the
> > stream).
> > If any such hacky mode is added to "invent" new timestamps, it should
> > be purely optional (controlled by a private option, for example), and
> > not be enabled by default.
> While I technically agree, this implies that the seeking code in ffmpeg could
> handle wrapping timestamps, which it currently can't (real cause of this patch,
> since flat playback works fine).
For MPEG-TS you probably want to do a byte seek. You can't seek in a TS
file by timestamp in general.
IMO any timestamp correction/guessing belongs in a library that runs on
top of lavf, since other formats may have this issue too. That or some
function in lavf/utils.c that returns "nicer" timetamps (which already
happens without the user's control).
More information about the ffmpeg-devel