[Libav-user] invalid AVPacket size in av_read_frame usage.
daggs at gmx.com
Mon Apr 27 10:15:47 CEST 2015
> Sent: Monday, April 27, 2015 at 12:10 AM
> From: "Carl Eugen Hoyos" <cehoyos at ag.or.at>
> To: libav-user at ffmpeg.org
> Subject: Re: [Libav-user] invalid AVPacket size in av_read_frame usage.
> 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.
> I wonder why you need the rawvideo decode function
> at all if you want the libraries to encode bgra
> frames that your application provides.
> I would have expected that you have your bgra frame
> in memory and either use an encoder that supports
> bgra and send the frame directly to the encoder
> function or call libswscale to get yuv420p frames
> for an encoder that does not support bgra.
well I want to spread the workload, I have one thread that captures the screen, it passes the frame to another thread 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. I need to keep the quality.
More information about the Libav-user