[FFmpeg-user] invalid AVPacket size in av_read_frame usage.

Lou lou at lrcd.com
Thu Apr 23 00:23:44 CEST 2015

On Wed, 22 Apr 2015 08:37:24 +0200
daggs <daggs at gmx.com> wrote:

> Greetings,
> I'm writing a program that needs to sample the screen in bgra format.
> the problem is what I try to read an av frame, I get this error:
> [rawvideo @ 0x1403aa0] Invalid buffer size, packet size 1228800 < expected frame_size 8294400	
> looking at the code I see that unless stated else, 1228800 is the max len so I went on and wrote the code below:
> if (avs->av_pkt_buff_len) {
>    if (av_new_packet(&av_packet, avs->av_pkt_buff_len)) {
>       ERROR("av packet with paylod size %d has failed.", avs->av_pkt_buff_len);
>       return -1;
>    }
> } else
>    av_init_packet(&av_packet);
> and set av_pkt_buff_len to 8294400 but I still get that error.
> any ideas what I'm doing wrong?

I'm not sure if you'll get much help here since this is the mailing
list for the various FFmpeg cli tools. The libav-user mailing list is
the place to ask FFmpeg library usage questions.

More information about the ffmpeg-user mailing list