<html><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:12pt"><div>I have an libAV program that decodes every 24-th frame.  This is for<br>a video editor so I can easily seek forward in the video, rather than<br>play all frames.<br><br>The high-level psuedo-code looks like this<br>    for (int f = 0 ; f < LargeNumber; f+= 24) {<br>        avformat_seek_file(ctx, 0, f, f, f, AVSEEK_FLAG_FRAME, AVSEEK_FLAG_ANY);<br>        av_read_frame(....)<br>        avcodec_decode_video2(....)<br>    }<br><br>If the input file is uncompressed AVI, then this works well.<br>However, if I compress the video with ffvhuff or huffvuy, then whenever I<br>seek forward 24 frames, the previous 12 frames are first decoded.  For
 example,<br>If I seek from frame 0 to 24 to 72 to 96, when I try to decode frame 96,<br>I first get frame 73, 74, 75, 76, 77, .... frame 83, then it decodes frame<br>96.<br><br>This problem only occurs with ffvhuff, or huffyuv.  Lossless jpeg doesn't have the<br>problem or any of the other lossless codecs I tried.  <br><br>Is this a known problem with the ffvhuff?  Is it something I can turn off?<br>Can I modify this behavior through the API?<br><br>If not, is there a place in the source code where I can easily change this?  Maybe<br>change the 12 pre-decoded frames to 2, or 1?<br><br>If not, is this a fundamental limitation in the way ffvhuff is implmented?  Does<br>it have to decode 12 frames at a time?<br><br>Or, if this a problem with the AVI file container?  If I use a different container,<br>can I avoid this problem?</div></div></body></html>