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

Carl Eugen Hoyos cehoyos at ag.or.at
Mon Apr 27 10:20:45 CEST 2015


daggs <daggs at ...> writes:

> > > 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  <at>  0x1403aa0] Invalid buffer size, 
> > > packet size 1228800 < expected frame_size 8294400
> > 
> > Where does the packet come from that you pass to 
> > the video decode function?

?

> > What is the resolution of the video that you 
> > want to decode?
> 
> that is a raw packet of a 1920x1080 screen.

1920 x 1080 x 4 = 8,294,400 so the error seems correct 
to me.

[...]

> which encodes it to the required format (libx264rbg).
> 
> if I'm not mistaken, scaling the frame to yuv420p 
> will drop the quality of the frame which I don't 
> want to have.

That doesn't explain why you need the rawvideo decoder.
Or are you using libavformat to capture the screen?
(You didn't say so.)

Carl Eugen



More information about the Libav-user mailing list