mirror of
https://github.com/obsproject/obs-studio.git
synced 2024-07-19 09:39:15 +00:00
obs-ffmpeg: Use muxer settings with AVIOContext
In the FFmpeg output, it was not passing the muxer settings to the AVIOContext, so some settings would not be properly passed to protocols.
This commit is contained in:
parent
f0a2ef49cf
commit
ee63fc69ac
|
@ -373,20 +373,6 @@ static inline bool open_output_file(struct ffmpeg_data *data)
|
|||
AVOutputFormat *format = data->output->oformat;
|
||||
int ret;
|
||||
|
||||
if ((format->flags & AVFMT_NOFILE) == 0) {
|
||||
ret = avio_open(&data->output->pb, data->config.url,
|
||||
AVIO_FLAG_WRITE);
|
||||
if (ret < 0) {
|
||||
blog(LOG_WARNING, "Couldn't open '%s', %s",
|
||||
data->config.url, av_err2str(ret));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
strncpy(data->output->filename, data->config.url,
|
||||
sizeof(data->output->filename));
|
||||
data->output->filename[sizeof(data->output->filename) - 1] = 0;
|
||||
|
||||
AVDictionary *dict = NULL;
|
||||
if ((ret = av_dict_parse_string(&dict, data->config.muxer_settings,
|
||||
"=", " ", 0))) {
|
||||
|
@ -405,10 +391,25 @@ static inline bool open_output_file(struct ffmpeg_data *data)
|
|||
AV_DICT_IGNORE_SUFFIX)))
|
||||
dstr_catf(&str, "\n\t%s=%s", entry->key, entry->value);
|
||||
|
||||
blog(LOG_INFO, "Using muxer settings:%s", str.array);
|
||||
blog(LOG_INFO, "Using muxer settings: %s", str.array);
|
||||
dstr_free(&str);
|
||||
}
|
||||
|
||||
if ((format->flags & AVFMT_NOFILE) == 0) {
|
||||
ret = avio_open2(&data->output->pb, data->config.url,
|
||||
AVIO_FLAG_WRITE, NULL, &dict);
|
||||
if (ret < 0) {
|
||||
blog(LOG_WARNING, "Couldn't open '%s', %s",
|
||||
data->config.url, av_err2str(ret));
|
||||
av_dict_free(&dict);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
strncpy(data->output->filename, data->config.url,
|
||||
sizeof(data->output->filename));
|
||||
data->output->filename[sizeof(data->output->filename) - 1] = 0;
|
||||
|
||||
ret = avformat_write_header(data->output, &dict);
|
||||
if (ret < 0) {
|
||||
blog(LOG_WARNING, "Error opening '%s': %s",
|
||||
|
|
Loading…
Reference in a new issue