Home > other >  FFMPEG parsing H264 video
FFMPEG parsing H264 video

Time:10-13

H264 agreement is as follows: frame 256, long frame head length is 3, tail frame, I use FFMPEG parsing, should how to set the data frame structure in it?

CodePudding user response:

You this is encoding, X264 coding has a lot of parameter can be set, specific see documents, ha ha

CodePudding user response:

Ffmpeg decoding H264? Do not need to set up the frame information,

 AVCodec * pCodec=avcodec_find_decoder (AV_CODEC_ID_H264); 
if (! PCodec)
{
Printf (" Codec not found. \ n ");
return -1;
}

M_pAVCodecCtx=avcodec_alloc_context3 (pCodec);
if (! M_pAVCodecCtx)
{
Printf (" Could not the allocate AVCodecContext \ n ");
return -1;
}

//open the decoder
If (avcodec_open2 (m_pAVCodecCtx pCodec, NULL) & lt; 0)
{
Printf (" Could not open the codec. \ n ");
return -1;
}


Then you can decode,

CodePudding user response:

To construct a avpacket ffmpeg

CodePudding user response:

# 3 is the solution, before doing a H264/H265 camera project, is do it [to construct a avpacket to ffmpeg]
  • Related