提交 87810bcf 编写于 作者: J jp9000

rtmp-services: Add the ability to specify custom x264 opts

Certain services may request certain x264-specific options (such as
scenecut=0 to prevent additional keyframes from being generated)
上级 ac23ec83
#include <util/platform.h>
#include <util/dstr.h>
#include <obs-module.h>
#include <jansson.h>
......@@ -344,6 +345,22 @@ static void apply_video_encoder_settings(obs_data_t *settings,
obs_data_set_int(settings, "buffer_size", max_bitrate);
}
}
item = json_object_get(recommended, "x264opts");
if (item && json_is_string(item)) {
const char *x264_settings = json_string_value(item);
const char *cur_settings =
obs_data_get_string(settings, "x264opts");
struct dstr opts;
dstr_init_copy(&opts, cur_settings);
if (!dstr_is_empty(&opts))
dstr_cat(&opts, " ");
dstr_cat(&opts, x264_settings);
obs_data_set_string(settings, "x264opts", opts.array);
dstr_free(&opts);
}
}
static void apply_audio_encoder_settings(obs_data_t *settings,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册