[Libav-user] Problem facing while decoding

Bruce Wheaton bruce at spearmorgan.com
Fri May 20 18:14:05 CEST 2011


On May 19, 2011, at 10:15 PM, pavan kumar wrote:

>  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;
>         }


You are trying to increment the size and data of the avpkt - you shouldn't be touching it, and that would not work anyway. You need to get a new packet from the stream, then call decode_video one time only on the packet's data.

Bruce
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20110520/beb0805e/attachment.html>


More information about the Libav-user mailing list