[FFmpeg-devel] [PATCH 1/2] avformat/avformat: Introduced `AVInputFormat.read_timestamp2` to fix keyframe seeking for formats that rely on `read_timestamp` for seeking

Darren Mo fumoboy007 at me.com
Mon Sep 2 23:01:50 EEST 2019


That’s true. However, I think your approach would produce incorrect results when `AVSEEK_FLAG_BACKWARD` is used.

The bisection would find the frame just before the target time and then we would search for the next keyframe, which would be after the target time. Instead, we want to return the keyframe just before the target time.

Any ideas on how to do that more efficiently?

> On Sep 2, 2019, at 7:33 AM, Michael Niedermayer <michael at niedermayer.cc> wrote:
> 
> i think this is the wrong way to fix the issue unless iam missing something
> 
> Bisecting on only keyframe packets needs to read 
> framesize * goplength * log(all frames) 
> Bisecting on any frame and only at the end searching for the next keyframe needs  
> framesize * (log(all frames) + goplength)
> that is more than an order of magnitude less data to read even with
> small gop sizes
> 
> Thanks
> 
> [...]
> -- 
> Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
> 
> No human being will ever know the Truth, for even if they happen to say it
> by chance, they would not even known they had done so. -- Xenophanes
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".



More information about the ffmpeg-devel mailing list