CodePudding user response:
You this is encoding, X264 coding has a lot of parameter can be set, specific see documents, ha haCodePudding 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 ffmpegCodePudding user response:
# 3 is the solution, before doing a H264/H265 camera project, is do it [to construct a avpacket to ffmpeg]