[Libav-user] avcodec_decode_video2

Alex Cohn alexcohn at netvision.net.il
Wed Dec 28 10:39:01 CET 2011


On Wed, Dec 28, 2011 at 01:19, Neil Menne <nhmenne42 at students.tntech.edu> wrote:
> How do I pass a raw buffer into this function?
>
> I find the appropriate codec and codec context, allocate the AVFrame, and
> initialize the packet. When I try and set the packet's data to the buffer:
> AVPacket packet;
> av_init_packet(&packet);
> packet.data = buf;
>
> where buf is the buffer received; I'm getting an error that seems to be
> unrelated. It says "no frame!" and returns -1.

Are you sure you receive -1 from the code above? maybe, some important
line of code is missing in your post?
-Alex

> If it helps, my AVFrame is initialized with:
> codecFrame = avcodec_alloc_frame();
>
> -Neil


More information about the Libav-user mailing list