[Libav-user] rewind file
sithruk sana
get2jils at gmail.com
Fri Jun 20 07:38:46 CEST 2014
How about creating a queue and keep the packet in it, you can get whenever
you want from queue, and decode it ?.
On Thu, Jun 19, 2014 at 1:15 AM, Camera Man <i.like.privacy.too at gmail.com>
wrote:
> On 06/18/2014 03:54 PM, Slash wrote:
>
> I have tried using av_seek_frame(pFormatCtx, videoStream, 0,
>> AVSEEK_FLAG_ANY) to jump back to the beginning but apparently I
>> didn't get any new decoded data so it is not doing what I need.
>>
>
> You need to flush the decoder context by calling
> avcodec_flush_buffers(your_codeccontext) after calling av_seek. Also,
> make sure that your stream starts with an SPS+PPS pair followed by an
> I-frame. Until you've decoded those, you can't decode any picture. If you
> seek to the beginning of a properly encoded file, they would be there;
> however, if the file is not properly encoded, you seek to the middle, or
> you are using a recorded RTSP stream, they might come later or not at all
> (in RTSP they may arrive in a side channel)
>
> (It is AVCodecContext that references B and P frames, not AVPacket as
> someone suggested).
>
>
> _______________________________________________
> Libav-user mailing list
> Libav-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/libav-user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://ffmpeg.org/pipermail/libav-user/attachments/20140620/1b5acfd5/attachment.html>
More information about the Libav-user
mailing list