问题描述
众所周知,现在 ffmpeg 支持 intel 硬件编码(h264 qsv)。 但是不支持“超快”,有没有什么设置可以提高编码速度?
m_encoder = avcodec_find_encoder_by_name("h264_qsv");
if(m_encoder == nullptr){
LOG(ERROR)<<"Find H264 Encoder Failed";
return false;
}
m_ctx = avcodec_alloc_context3(m_encoder);
m_ctx->bit_rate = bitrate_kbps*1024;
m_ctx->width = m_width;
m_ctx->height = m_height;
m_ctx->time_base = { 1,(int)fps };
m_ctx->qmin = 10;
m_ctx->qmax = 35;
m_ctx->gop_size = fps;
m_ctx->max_b_frames = 0;
m_ctx->has_b_frames = false;
m_ctx->codec_id = m_encoder->id;
m_ctx->codec_type = AVMEDIA_TYPE_VIDEO;
m_ctx->pix_fmt = m_h264InputFormat;
AVDictionary *param = nullptr;
av_dict_set(¶m,"look_ahead","0",0);
av_dict_set(¶m,"look_ahead_depth","8","preset","veryfast","tune","zerolatency",0);
int ret = avcodec_open2(m_ctx,m_encoder,¶m);
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)