I have a C program that is using libav in a video editor.  I want to decode
every 24th frame of the video (and nothing else).  I wrote a loop which
uses avformat_seek_file() to seek to frame 0, then frame24, then frame 48,
then frame 72, etc.  My input file is AVI container with the ffvhuff codec.

The problem is that whenever I seek to frame N, it also decodes the next
12 frames after N (which I don't want).  This is slowing things down
by a factor of 12 since I don't need those extra frames.  What is the name of
this 'feature'?  (so I can search for it in the documentation)?  How can I tell 
libAV
to only decode frame N when I seek to frame N?

The high-level psuedo-code looks like this
    for (int f = 0 ; f < LargeNumber; f+= 24) {
        avformat_seek_file(ctx, 0, f, f, f, AVSEEK_FLAG_FRAME, AVSEEK_FLAG_ANY);
        av_read_frame(....)
        avcodec_decode_video2(....)
    }
In the above code, when I look at best_effort_timestamp for the decoded frame, 
it will equal the
seek position 'f' only for the first iteration of the loop, then the next 
decoded frame has
best_effort_timestamp of 1, then the next is 2, etc.  How can I tell libAV to 
turn off this
feature?

Thank you all.
_______________________________________________
Libav-user mailing list
[email protected]
http://ffmpeg.org/mailman/listinfo/libav-user

Reply via email to