[Ffmpeg-devel] Seeking with in an MPEGTS

Måns Rullgård mru
Tue Jun 21 15:42:32 CEST 2005

Andy Parkins said:
> On Tuesday 2005 June 21 14:24, M?ns Rullg?rd wrote:
>> > I've generated an MPEG transport stream containing an MPEG4 ES using
>> > libavformat.  When playing back using ffplay, it plays back perfectly
>> > until I perform a seek.  After that the stream breaks up for a bit, then
>> > settles down but I start to get lots of error messages from h263.c; for
>> > example.
>> MPEG TS doesn't contain information about key frames, so when you seek you
>> are likely to end up with some P/B frames before the next I frame.  Nothing
>> to be worried about.  You could junk the decoder output until the next I
>> frame comes around.  Look at AVFrame.key_frame.
> Thanks; but I don't think this is the case.  I'm happy with the messed up
> picture, which fixes as soon as there is a key frame.  However, the quoted
> error messages continue well after the next key frame has been passed.
> Something about seeking is throwing off the decoder permanently.

MPEG TS doesn't necessarily return complete frames, so after the seek you
are probably getting the end of a frame.  If the decoder parses this as the
start of a frame, I can imagine those errors occurring.  Apparently, this
leaves the decoder in a permanent state of confusion.  Michael?

M?ns Rullg?rd
mru at inprovide.com

More information about the ffmpeg-devel mailing list