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)
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
#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,
|
||||
|
Reference in New Issue
Block a user