<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">2015-06-21 20:26 GMT+03:00 Don Moir <span dir="ltr"><<a href="mailto:donmoir@comcast.net" target="_blank">donmoir@comcast.net</a>></span>:<br><br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class=""><br></span>
Hi Gonzalo,<br>
<br>
You can try to set skip_loop_filter to AVDISCARD_NONREF and there could be some other flags you can set to speed things up just slightly. decoding can be intense and probably the slowest thing you need to deal with.<br>
<br>
For scrubbing though, I am thinking you don't need to decode every single frame. For example, if video is at 25 FPS, it may be you could get away with like 10 FPS or less. When user is scrubbing it is not likely you would be able to display every frame anyway.<br>
<br>
I am also interested in this and have not yet investigated it so I would be interested in what you come up with. <br><div class=""><div class="h5">
_______________________________________________<br>
Libav-user mailing list<br>
<a href="mailto:Libav-user@ffmpeg.org" target="_blank">Libav-user@ffmpeg.org</a><br>
<a href="http://ffmpeg.org/mailman/listinfo/libav-user" rel="noreferrer" target="_blank">http://ffmpeg.org/mailman/listinfo/libav-user</a><br>
</div></div></blockquote></div><br><br></div><div class="gmail_extra">I have implemented this. The best approach to performance depends on codec. But if we are talking about something like avc with reasonable keyframe interval (order of 100), I came up with this:<br></div>1) If I can reach desired frame by decoding forward less than ~100 frames, I just decode all these frames (even if most of them are already cached).<br><div class="gmail_extra">2) Every decoded frame is cached within window of 2*keyframe interval frames<br></div><div class="gmail_extra">3) If I need to go backward, I seek to previous keyframe and decode everything forward until desired frame (and cache all decoded frames)<br></div><div class="gmail_extra">4) If I can go backward and all frames until previous key are already cached, I speculatively decode frames which are further away.<br></div><div class="gmail_extra">This way if I move sequentially (backward or forward), for each frame step there is exactly one frame decode. The frame cache allows to hide the fact that frames are always decoded forward while you request them backward.</div><div class="gmail_extra"> <br></div><div class="gmail_extra">Then there are other tiny details with seeking. To perform it realistically you best deal with single stream at a time (multistream seeking is really not designed for scrubbing). And you have to have proper keyframe index to know how to seek to keyframes and measure distances.<br></div><div class="gmail_extra"><br>You can check how it works within virtualdub, there is source code<br> <a href="https://sourceforge.net/projects/vdcachingdriver/">https://sourceforge.net/projects/vdcachingdriver/</a><br><br></div></div>