[Libav-user] problem facing while using the function avcodec_decode_video2()

kumar.pavan463 kumar.pavan463 at gmail.com
Thu May 19 07:48:16 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;

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

View this message in context: http://libav-users.943685.n4.nabble.com/problem-facing-while-using-the-function-avcodec-decode-video2-tp3534842p3534842.html
Sent from the libav-users mailing list archive at Nabble.com.

More information about the Libav-user mailing list