libx264编码部分参数说明

//代码示例
x264_param_default_preset(&m_x264param,"ultrafast","zerolatency"); //ultrafast cpu占用最小,zerolatency 不缓存帧
m_x264param.i_width = width;
m_x264param.i_height = height;
m_x264param.b_repeat_headers = 1; //每个关键帧前都发送sps和pps
m_x264param.b_cabac = 1; //自适应上下文算术编码,baseline 不支持
m_x264param.i_threads = 4;// 建议为cpu个数
m_x264param.i_fps_num = 25;
m_x264param.i_keyint_max=50;
m_x264param.i_fps_den=1;//帧率分母
m_x264param.i_fps_num=25;//帧率分子

m_x264param.rc.b_mb_tree=0;//不为0导致编码延时帧,实时编码是强烈建议为0
m_x264param.r_rf_constant=25;
m_x264param.r_rf_constant_max=45;
m_x264param.rc.i_rc_method=X264_RC_CQP; //码率控制参数 CQP 恒定质量 CRF 恒定码率 ABR 平均码率

x264_param_apply_profile(&m_x264param,"heigh");
m_x264param.i_level_idc = 30;
m_x264param.i_log_level = X264_LOG_DEBUG;
m_x264param.pf_log = x264_pf_log;
m_x264param.i_csp = X264_CSP_I422; // 不支持baseline
m_px264handle = x264_encoder_open(&m_x264param);

m_pPicIn = new x264_picture_t;
m_pPicOut = new x264_pictrue_t;
x264_picture_init(m_pPicOut);
x264_picture_alloc(m_pPicIn,X264_CSP_I422,m_x264param.i_width,m_x264param.i_height);



你可能感兴趣的:(libx264编码部分参数说明)