#else
params.i_width = width;
params.i_height = height;
#endif
params.vui.i_sar_width = 1;
params.vui.i_sar_height = 1; //设置长宽比
params.i_fps_num = fpsnum;//帧率分子
params.i_fps_den = fpsden;//帧率分母
params.i_timebase_num = 1;
params.i_timebase_den = 1000;//ms
params.i_keyint_max = fpsnum/fpsden;
params.i_keyint_min = fpsnum/fpsden;//X264_KEYINT_MIN_AUTO
params.b_repeat_headers = 0;//
params.b_annexb = 0;
params.b_deblocking_filter = 1;
params.rc.f_rf_constant = 33;
params.rc.i_bitrate = bitrate;
初始化编码器:
enc = x264_encoder_open(¶ms);
获取整个流的pps和SPS:
int s = x264_encoder_headers(enc, &nals, &nal_count);
x264编码:
初始化图片信息:
x264_picture_t picin, picout;
x264_picture_init(&picin);
对图片信息参数设定:
pi