[libav-api] invalid AVPacket size in av_read_frame usage.

Luca Barbato lu_zero at gentoo.org
Sat Apr 25 11:16:48 CEST 2015


On 23/04/15 15:34, daggs 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?

We'd need to see more code.

lu



More information about the libav-api mailing list