[Libav-user] decoding video frames
Bob Self
bobslf at gmail.com
Thu May 10 19:40:38 CEST 2012
On Thu, May 10, 2012 at 1:08 PM, Alex Cohn <alexcohn at netvision.net.il> wrote:
> This code implies that the actual compressed packets are of the size
> that fits precisely into INBUF_SIZE. Otherwise, when you reach the end
> of first buffer you got from fread(), you will have a non-complete
> packet. The decoder cannot handle such case. You should put this
> remaining chunk aside and append the data you read from the file so
> that the compressed packets that go to decoder are always complete.
>
> The trick is, you don't know the actual size of the next packet,
> therefore you cannot decide whether to read another piece of data from
> the file, or not. This is why it is preferred to use avformat
> functions to read the file.
>
> BR,
> Alex Cohn
> _______________________________________________
> Libav-user mailing list
> Libav-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/libav-user
That makes sense. I am using the example in the doc/examples
directory. It uses fread(). Can you point me to an example that uses
the avformat functions? I've been trying to find examples, but haven't
had any luck.
More information about the Libav-user
mailing list