x264_param_t 结构中是否有参数,或者我必须将帧发送到 x264 dll 两次..?因为我只使用 encoder_encode 函数并且返回 nal units 。我猜它应该是一个参数的组合,并使用了 encoder_encode 两次。
这是我如何初始化参数并链接到 libx264
InitializeSettings(){
x264_param_default_preset(&m_pXParam, "medium", "zerolatency");
x264_param_apply_profile(&m_pXParam, "baseline");
m_pXParam.i_width = cx;
m_pXParam.i_height = cy;
m_pXParam.i_fps_num = fps;
m_pXParam.i_fps_den = 1;
// rate control
m_pXParam.i_keyint_max = fps - 5;
//m_pXParam.rc.f_rf_constant_max = fps + 5;
// rate control
m_pXParam.rc.i_qp_constant=18;
m_pXParam.rc.i_qp_min=18;
m_pXParam.rc.i_qp_max=18;}
x264_picture_alloc(&m_xPicture, X264_CSP_I420 , m_pXParam.i_width, m_pXParam.i_height);
m_xPicture.img = x264img;
m_iframe_size = x264_encoder_encode(m_xEncoder, &m_xNals, &m_iNal, &m_xPicture, &m_xPictureOut);
@nobody555 谢谢!我对 x264_param_apply_fastfirstpass 函数还有另一个问题:
/* x264_param_apply_fastfirstpass:
* If first-pass mode is set (rc.b_stat_read == 0, rc.b_stat_write == 1),
* modify the encoder settings to disable options generally not useful on
* the first pass. */
他们在谈论什么选择?