[FFmpeg-devel] Splitting an h.264 encoded stream in NALs?

Luca Abeni lucabe72
Sat Nov 10 13:26:05 CET 2007


Hi Luca,

On Sat, 2007-11-10 at 13:05 +0100, Luca Barbato wrote:
[...]
> > I have an H.264 stream (from linbx264), and I need to split it in NALs
> > (yes, I am working on H.264 support in the RTP muxer :).
> > I wrote my own code for this (and it seems to work well), but I am
> > wondering if we have some function in libavcodec that I can call for
> > this (I had a look at libavcodec/h264.c, and it does not seem to call
> > ff_find_start_code()).
> 
> it is a bit convoluted inside that file, you may just take the
> h264_parse from feng and change the parameters to fit ffmpeg.
> 
> http://live.polito.it/gitweb/?p=feng.git;a=blob;f=mediathread/h264.c;h=1db11b264e7dfc051bca1b45b2a2a7b3ab8bbef3;hb=HEAD

Thanks; I just had a look at it. It seems that your parser is using the
same code as libavcodec/h264.c (and my one is similar to it, too ;-)

BTW, I have a question about it: isn't the NAL start code composed by 4
bytes: "0x00 0x00 0x00 0x01"? It looks like your code is searching for a
3-bytes start code?


			Thanks,
				Luca





More information about the ffmpeg-devel mailing list