[Libav-user] Problem facing while decoding

pavan kumar kumar.pavan463 at gmail.com
Fri May 20 07:15:29 CEST 2011

am using the below code for decoding the video am facing some problems while
using the below code
what the problem am facing is as am using in the while loop it is iterating
till the value grater than zero, till the last iteration of the loop, am
getting the value of len=-1 while coming out of the loop am getting the non
zero value, can u suggest me why the problem is getting (or is that a
problem or it is a right procedure only )

 while (avpkt.size > 0) {

            len = avcodec_decode_video2(c, frame, &gotpicture, &avpkt);
               printf("Value of len =%d \n ",len);
               if (len > 0) {
                fprintf(stderr, "Error while decoding frame %d, %d\n",

            if (gotpicture) {
                printf("Got The Picture  %d\n", gotpicture);
            avpkt.size -= len;
            avpkt.data += len;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20110520/9a48e013/attachment.html>

More information about the Libav-user mailing list