On Mon, Sep 02, 2019 at 01:01:50PM -0700, Darren Mo wrote:
> 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?

stepwise searching for the keyframe in forward direction while taking steps
backward
......................k.K.................v-start
                                     A--->
                            B------->
            C-------->k-K-->
            
there is code somewhere in git to do something similar already
this should be faster than always searching for keyframes during bisection as
long as the initial step is reasonable in relation to the keyframe distance

also as both approaches are quite similar one could even choose which
way to do it depending on the expected cost of seeks and bandwidth and
if some statistics on the keyframe distance are known and or the
search direction

thx

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

There will always be a question for which you do not know the correct answer.

Attachment: signature.asc
Description: PGP signature

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to