[Libav-user] Problem facing while decoding

pavan kumar kumar.pavan463 at gmail.com
Thu May 19 14:17:48 CEST 2011


hi

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",
gotpicture,len);

            }
            if (gotpicture) {
                printf("Got The Picture  %d\n", gotpicture);
                }
            avpkt.size -= len;
            avpkt.data += len;
        }

my other doubt is
if the decoding is sucessful the decoded data is saved in the 2nd parameter
of the function, how check the saved data in that variable

please help me out on this issue
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20110519/e74b343d/attachment.html>


More information about the Libav-user mailing list