Is there a way of knowing whether I seek outside of a video when using the 
SEEK_BACKWARD flag?

I noticed that when I change the flag for av_seek_frame to something else than 
AVSEEK_FLAG_ANY, I always get 0 returned. If I seek somewhere beyond the video 
length, I can even can call avcodec_decode_video2 afterwards and get a frame 
decode (just zeros it seems), without any complains. Only sws_scale() later in 
the pipeline gives a warning about incorrect image pointers.

For now I worked around by calling av_seek_frame with AVSEEK_FLAG_ANY and if 
that is successful, seek again with SEEK_BACKWARD. But ideally, I would like to 
seek only once. Is there reason why only AVSEEK_FLAG_ANY detects if a seek was 
successful? I.e. is there a possibility that ticket #1607 [0] could be fixed?


Is there maybe a function I have overlooked that I can call to query the video 
length?


Cheers,

Peter

[0] https://trac.ffmpeg.org/ticket/1607 <https://trac.ffmpeg.org/ticket/1607>
_______________________________________________
Libav-user mailing list
[email protected]
http://ffmpeg.org/mailman/listinfo/libav-user

Reply via email to