[Libav-user] Problems with ffvhuff and huvvyuv

James Board jpboard2 at yahoo.com
Tue Oct 15 16:33:06 CEST 2013


I have an libAV program that decodes every 24-th frame.  This is for
a video editor so I can easily seek forward in the video, rather than
play all frames.

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(....)
    }

If the input file is uncompressed AVI, then this works well.
However, if I compress the video with ffvhuff or huffvuy, then whenever I
seek forward 24 frames, the previous 12 frames are first decoded.  For example,
If I seek from frame 0 to 24 to 72 to 96, when I try to decode frame 96,
I first get frame 73, 74, 75, 76, 77, .... frame 83, then it decodes frame
96.

This problem only occurs with ffvhuff, or huffyuv.  Lossless jpeg doesn't have the
problem or any of the other lossless codecs I tried.  

Is this a known problem with the ffvhuff?  Is it something I can turn off?
Can I modify this behavior through the API?

If not, is there a place in the source code where I can easily change this?  Maybe
change the 12 pre-decoded frames to 2, or 1?

If not, is this a fundamental limitation in the way ffvhuff is implmented?  Does
it have to decode 12 frames at a time?

Or, if this a problem with the AVI file container?  If I use a different container,
can I avoid this problem?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20131015/458b088b/attachment.html>


More information about the Libav-user mailing list