[Libav-user] Video frames cannot be decoded after seek operation

Julian Herrera julian.herrera at tvgenius.net
Mon Mar 11 18:12:15 CET 2013


Hello all,

I've developed a video player based on libav and I've come across an 
issue with seeking operations. I've coded the player pretty much like 
the tutorial available on http://dranger.com/ffmpeg

What happens is that after an av_seek_frame() call and the corresponding 
avcodec_flush_buffers(), the next ~10 frames cannot be decoded by 
avcodec_decode_video2(). In fact the parameter "int *got_picture_ptr" 
returns false in those cases. This introduces an ugly slow down on the 
FPS rate until new video frames replace the undecoded ones in the queue. 
If I don't call avcodec_flush_buffers() after the seek operation, all 
frames are decoded but visual artifacts appear.

The video is an MPEG-TS file, codecs are mpeg2video and mp2. Can you 
shed some light on what I should look for?

Regards,

Julian


More information about the Libav-user mailing list