[Libav-user] H.264 nal decode

Alex Cohn alexcohn at netvision.net.il
Mon Apr 9 13:39:03 CEST 2012


On Mon, Apr 9, 2012 at 13:56, srikanta mondal <srkntmondal at gmail.com> wrote:
> Dear all, Thank you for reply. I have used x264 library. And I have the
> following code ....
[..]
> void decoding(uint8_t *data, int size)
> {
>     AVPacket *pkt;
>     pkt = new AVPacket();
>     int gotpicture;
>
>     av_init_packet(pkt);
>     avcodec_get_frame_defaults(picture);
>
>     pkt->data = data;
>     pkt->size = size;
>     int outSize = avcodec_decode_video2(m_pContext, picture, &gotpicture,
> pkt);
> }
>
> This is my brief code sniff.Please guide me how could I able to decode
> directly without using file.
>
> Thanks and regards
> Srikanta Mondal

h264 decoder produces output after some delay. Minimum delay for
simple Profile is one frame, but if you allow B frames, the delay is
even longer. So, it's OK if you see that the first call to decoding()
function above does not generate a picture.

BR,
Alex


More information about the Libav-user mailing list