H264 applicationb bitstream to flv mux ffmpeg library

I have an IP camera that provides a Bitstream H264 application through SDK calls. I want to pack this video stream into an FLV container. So far, I should have known the following: -

I need to convert an H264 application to H264 AVCC: To do this, I have to replace the NAL header byte (0x00000001) with the NALU size (large end format).

My question is: what should I do with SPS and PPS? Should I write (av_interleaved_write_frame) them, as after replacing the NAL header? or not to record these frames at all?

I read about AVCC requiring extra data. How to build it? where to transfer it?

+4
source share
2 answers

SPS/PPS . SPS/PPS AVCC extradata (. : / H.264)

AVCodecContext.extradata​​p >

void *extradata = /**/;
int extradata_size = /**/;
codecCtx->extradata_size = extradata_size;
codecCtx->extradata = av_malloc ( codecCtx->extradata_size );
memcpy ( codecCtx->extradata, extradata, codecCtx->extradata_size);

avcodec_open2

+4

- . H264 NALU ffprobe. , CodecContext . :

# 0, flv, 'rtmp://127.0.0.1/live/beam_0': № 0: 0: : (libx264) № 0: 1: : (aac)

, ( ffplay), (AAC) , . , . , , .

0

All Articles