[x264-devel] Send periodic IDR frames

Diego Carvalho diego.cdomingos2010 at gmail.com
Mon Oct 3 15:50:31 CEST 2011


Hi, I'm new on libx264. To encode the video I'm using the following
set of parameters:

x264_param_default_preset(m_X264Param, "ultrafast", "zerolatency");
m_X264Param->i_threads = 1;
m_X264Param->i_width = m_OutWidth;
m_X264Param->i_height = m_OutHeight;
m_X264Param->i_fps_num = m_Framerate;
m_X264Param->i_fps_den = 1;
// Intra refres:
m_X264Param->i_keyint_max = m_Framerate;
m_X264Param->b_intra_refresh = 1;
//Rate control:
m_X264Param->rc.i_rc_method = X264_RC_CRF;
m_X264Param->rc.f_rf_constant = 25;
m_X264Param->rc.f_rf_constant_max = 35;
//For streaming:
m_X264Param->b_repeat_headers = 1;
m_X264Param->b_annexb = 1;
m_X264Param->i_slice_max_size = m_SliceMaxSize;
x264_param_apply_profile(m_X264Param, "baseline");

But then I discovered that setting m_X264Param->b_intra_refresh = 1;
makes the library send only SPS and PPS and do not send the IDR. Then
I set m_X264Param->b_intra_refresh = 0 (or don't explicit set it); Now
it sends the IDR but wireshark shows the SPS as a malformed packet.
Does anybody know the reason? Thanks in advance.


More information about the x264-devel mailing list