[Ffmpeg-devel] Seeking with in an MPEGTS

Måns Rullgård mru
Tue Jun 21 15:48:39 CEST 2005


Nico Sabbi said:
> Andy Parkins wrote:
>
>>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.
>>
>>Andy
>>
>>
>
> isn't there a way to reset the decoders in lavc before seeking,
> and tell them to reprise decoding from the next keyframe?

avcodec_flush_buffers might be what you want.

-- 
M?ns Rullg?rd
mru at inprovide.com





More information about the ffmpeg-devel mailing list