[Libav-user] invalid AVPacket size in av_read_frame usage.
daggs
daggs at gmx.com
Sun Apr 26 18:21:49 CEST 2015
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?
More information about the Libav-user
mailing list