[Libav-user] Decoding/encoding api

Steve musicspeedchanger at gmail.com
Fri Sep 16 13:52:07 EEST 2016


Timur Guseynov wrote
> So I can write something like this and it would be ok?
> 
> AVCodecContext *codecContext;
> AVPacket *packet;
> AVFrame *frame;
> // allocating codec context, getting packet
> .................................
> //
> avcodec_send_packet(codecContext, packet);
> while(avcodec_receive_frame(codecContext, frame) == 0)
> {
>       av_frame_unref(frame);
> }

No, that's where the doc you were referring to comes in, av_frame_unref is
called for you. But you have to handle the packet, so:

avcodec_send_packet(codecContext, packet);
while(avcodec_receive_frame(codecContext, frame) == 0)
{
    ..
}
 av_packet_unref(packet);





--
View this message in context: http://libav-users.943685.n4.nabble.com/Libav-user-Decoding-encoding-api-tp4662664p4662679.html
Sent from the libav-users mailing list archive at Nabble.com.


More information about the Libav-user mailing list