[Libav-user] H.264 nal decode

srikanta mondal srkntmondal at gmail.com
Tue Apr 10 13:26:58 CEST 2012


Thanks all for reply. However I have got the H.264 compression using
libX264 from *
http://stackoverflow.com/questions/2940671/how-to-encode-series-of-images-into-h264-using-x264-api-c-c
* and it is working fine for making video.

@NITIN GOYAL I have found in each nal frame contain the starting code 0 0 0
1. But still it is not working.

@Alex Cohn   I have omitted first 4 bytes and reduce the size. But still
avcodec_decode_video2() cann't decode the encoded array.

@Kalileo  Sorry I have not try H.264 compression with ffmpeg library and if
possible please give me some suggestion how can I do with ffmpeg library.
I have use     avcodec_decode_video2( m_pContext, picture, &gotpicture,
pkt);
                    where AVCodecContext* m_pContext;
                             AVPacket *pkt = new AVPacket();
                             av_init_packet(pkt);
                             ................
                             ..................
                             pkt->data = (heders[0].p_payload+4);
                             pkt->size = i_frame_size - 4;
                             int gotpicture;
                             AVFrame* picture = avcodec_alloc_frame();

I have fill up the parameters with these values and pass it to
avcodec_decode_video2()


Thanks and regards
Srikanta Mondal



On Tue, Apr 10, 2012 at 12:37 PM, Kalileo <kalileo at universalx.net> wrote:

>
> On Apr 10, 2012, at 13:19 , srikanta mondal wrote:
>
> > Thank you for reply.
> > @kalileo   I have simply got the UDP socket and get the byte array from
> it.
>
> you could also use the ffmpeg libraries to do that.
>
> > Now that byte array is basically the x264_nal_t*(p_payload[0]) from
> sender side.
>
> Is it? or is it in a container, such as mpegts? Then you should demux
> first.
>
> > That encoded byte array come to client side. Now I want to decode that
> array with its corresponding parameter values. I think it can be done by
> using avcodec_decode_video2().
>
> How are you passing that byte array to avcodec_decode_video2()?
>
>
>
> _______________________________________________
> Libav-user mailing list
> Libav-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/libav-user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20120410/939fcdd1/attachment.html>


More information about the Libav-user mailing list