mirror of
https://github.com/obsproject/obs-studio.git
synced 2024-07-08 12:24:09 +00:00
obs-ffmpeg: Add FFmpeg Options for VA-API
This commit is contained in:
parent
58fb63030c
commit
17cb966c62
|
@ -29,6 +29,7 @@
|
|||
#ifdef ENABLE_HEVC
|
||||
#include <obs-hevc.h>
|
||||
#endif
|
||||
#include <opts-parser.h>
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
|
@ -356,6 +357,14 @@ static bool vaapi_update(void *data, obs_data_t *settings, bool hevc)
|
|||
|
||||
enc->height = enc->context->height;
|
||||
|
||||
const char *ffmpeg_opts = obs_data_get_string(settings, "ffmpeg_opts");
|
||||
struct obs_options opts = obs_parse_options(ffmpeg_opts);
|
||||
for (size_t i = 0; i < opts.count; i++) {
|
||||
struct obs_option *opt = &opts.options[i];
|
||||
av_opt_set(enc->context->priv_data, opt->name, opt->value, 0);
|
||||
}
|
||||
obs_free_options(opts);
|
||||
|
||||
info("settings:\n"
|
||||
"\tdevice: %s\n"
|
||||
"\trate_control: %s\n"
|
||||
|
@ -367,10 +376,11 @@ static bool vaapi_update(void *data, obs_data_t *settings, bool hevc)
|
|||
"\tkeyint: %d\n"
|
||||
"\twidth: %d\n"
|
||||
"\theight: %d\n"
|
||||
"\tb-frames: %d\n",
|
||||
"\tb-frames: %d\n"
|
||||
"\tffmpeg opts: %s\n",
|
||||
device, rate_control, profile, level, qp, bitrate, maxrate,
|
||||
enc->context->gop_size, enc->context->width, enc->context->height,
|
||||
enc->context->max_b_frames);
|
||||
enc->context->max_b_frames, ffmpeg_opts);
|
||||
|
||||
return vaapi_init_codec(enc, device);
|
||||
}
|
||||
|
@ -945,6 +955,10 @@ static obs_properties_t *vaapi_properties_internal(bool hevc)
|
|||
20, 1);
|
||||
obs_property_int_set_suffix(p, " s");
|
||||
|
||||
obs_properties_add_text(props, "ffmpeg_opts",
|
||||
obs_module_text("FFmpegOpts"),
|
||||
OBS_TEXT_DEFAULT);
|
||||
|
||||
return props;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue