Hi Alex.

I thought I may need to add NAL units That why I added 0x00000001.

Please see the  code: Let me know If I am missing..

av_register_all();
codec = avcodec_find_decoder(CODEC_ID_H264);
                codecCtx = avcodec_alloc_context3(codec);

                codecCtx->width = width;
                codecCtx->height = height;

                codecCtx->extradata = (uint8_t*)av_malloc([frameData length]);
                codecCtx->extradata_size = [frameData length];
                [privateData getBytes:codecCtx->extradata 
length:codecCtx->extradata_size];
                codecCtx->pix_fmt = PIX_FMT_YUV420P;

                srcFrame = avcodec_alloc_frame();
                dstFrame = avcodec_alloc_frame();

        if(codec->capabilities&CODEC_CAP_TRUNCATED)
            codecCtx->flags|= CODEC_FLAG_TRUNCATED;

                int res = avcodec_open2(codecCtx, codec,NULL);
                if (res < 0)
                {
                        NSLog(@"Failed to initialize decoder");
                }

      packet.data = (uint8_t*)[frameData bytes];
        packet.size = [frameData length];

         int frameFinished = 0;

    int res = avcodec_decode_video2(codecCtx, srcFrame, &frameFinished,
&packet);


Regards,
KP
> ----- Original Message -----
> From: "Alex Cohn" <[email protected]>
> To: "This list is about using libavcodec, libavformat,
> libavutil,libavdevice
> and libavfilter." <[email protected]>
> Sent: Monday, April 23, 2012 3:03 AM
> Subject: Re: [Libav-user] Fw: Getting "No frame: error
>
>
>> On Mon, Apr 23, 2012 at 09:23,  <[email protected]> wrote:
>>> Hi,
>>>
>>> I have prefixed each frame with 0x00000001 &
>>
>> Why?
>>
>>> I am getting Following error
>>>
>>> [h264 @ 0x906e400] non-existing PPS 0 referenced
>>>
>>>>>> VLC player able to play the input video. I will check with ffmpeg
>>>>>> util
>>
>> are you decoding a stream or a file? What is the file/stream format
>> (mpeg4, mkv, mp4)?
>>
>>>>>>> I have linked ffmpeg & live555 library to my IOS application.
>>>>>>> I am receiving the h264 encoded frame and sending the frame to
>>>>>>> dcoder.
>>>>>>> But Decoder throws the error:
>>>>>>>
>>>>>>> [h264 @ 0x8a4ac00] no frame!
>>
>> how do you initialize your decoder?
>>
>> BR,
>> Alex
>> _______________________________________________
>> Libav-user mailing list
>> [email protected]
>> http://ffmpeg.org/mailman/listinfo/libav-user
>
>

_______________________________________________
Libav-user mailing list
[email protected]
http://ffmpeg.org/mailman/listinfo/libav-user

Reply via email to