obs-x264: Remove VFR mode as an advanced option
VFR encoding mode was originally added experimentally, but in truth, it's nothing but a detriment because it can cause wild bitrate fluctuations. It's still a constant framerate even when VFR mode is on anyway.
This commit is contained in:
@@ -35,6 +35,8 @@
|
||||
#define info(format, ...) do_log(LOG_INFO, format, ##__VA_ARGS__)
|
||||
#define debug(format, ...) do_log(LOG_DEBUG, format, ##__VA_ARGS__)
|
||||
|
||||
//#define ENABLE_VFR
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
struct obs_x264 {
|
||||
@@ -96,7 +98,9 @@ static void obs_x264_defaults(obs_data_t *settings)
|
||||
obs_data_set_default_int (settings, "buffer_size", 2500);
|
||||
obs_data_set_default_int (settings, "keyint_sec", 0);
|
||||
obs_data_set_default_int (settings, "crf", 23);
|
||||
#ifdef ENABLE_VFR
|
||||
obs_data_set_default_bool (settings, "vfr", false);
|
||||
#endif
|
||||
obs_data_set_default_string(settings, "rate_control","CBR");
|
||||
|
||||
obs_data_set_default_string(settings, "preset", "veryfast");
|
||||
@@ -202,7 +206,9 @@ static obs_properties_t *obs_x264_props(void *unused)
|
||||
obs_property_list_add_string(list, TEXT_NONE, "");
|
||||
add_strings(list, x264_tune_names);
|
||||
|
||||
#ifdef ENABLE_VFR
|
||||
obs_properties_add_bool(props, "vfr", TEXT_VFR);
|
||||
#endif
|
||||
|
||||
obs_properties_add_text(props, "x264opts", TEXT_X264_OPTS,
|
||||
OBS_TEXT_DEFAULT);
|
||||
@@ -409,10 +415,13 @@ static void update_params(struct obs_x264 *obsx264, obs_data_t *settings,
|
||||
int height = (int)obs_encoder_get_height(obsx264->encoder);
|
||||
int bf = (int)obs_data_get_int(settings, "bf");
|
||||
bool use_bufsize = obs_data_get_bool(settings, "use_bufsize");
|
||||
bool vfr = obs_data_get_bool(settings, "vfr");
|
||||
bool cbr_override= obs_data_get_bool(settings, "cbr");
|
||||
enum rate_control rc;
|
||||
|
||||
#ifdef ENABLE_VFR
|
||||
bool vfr = obs_data_get_bool(settings, "vfr");
|
||||
#endif
|
||||
|
||||
/* XXX: "cbr" setting has been deprecated */
|
||||
if (cbr_override) {
|
||||
warn("\"cbr\" setting has been deprecated for all encoders! "
|
||||
@@ -447,7 +456,11 @@ static void update_params(struct obs_x264 *obsx264, obs_data_t *settings,
|
||||
if (!use_bufsize)
|
||||
buffer_size = bitrate;
|
||||
|
||||
#ifdef ENABLE_VFR
|
||||
obsx264->params.b_vfr_input = vfr;
|
||||
#else
|
||||
obsx264->params.b_vfr_input = false;
|
||||
#endif
|
||||
obsx264->params.rc.i_vbv_max_bitrate = bitrate;
|
||||
obsx264->params.rc.i_vbv_buffer_size = buffer_size;
|
||||
obsx264->params.rc.i_bitrate = bitrate;
|
||||
@@ -510,16 +523,14 @@ static void update_params(struct obs_x264 *obsx264, obs_data_t *settings,
|
||||
"\tfps_den: %d\n"
|
||||
"\twidth: %d\n"
|
||||
"\theight: %d\n"
|
||||
"\tkeyint: %d\n"
|
||||
"\tvfr: %s\n",
|
||||
"\tkeyint: %d\n",
|
||||
rate_control,
|
||||
obsx264->params.rc.i_vbv_max_bitrate,
|
||||
obsx264->params.rc.i_vbv_buffer_size,
|
||||
(int)obsx264->params.rc.f_rf_constant,
|
||||
voi->fps_num, voi->fps_den,
|
||||
width, height,
|
||||
obsx264->params.i_keyint_max,
|
||||
vfr ? "on" : "off");
|
||||
obsx264->params.i_keyint_max);
|
||||
}
|
||||
|
||||
static bool update_settings(struct obs_x264 *obsx264, obs_data_t *settings)
|
||||
|
Reference in New Issue
Block a user