obs-ffmpeg: Allow using stream keys with muxer

(Jim) Allows the ability to use stream keys with ffmpeg-mux -- this will
enable the ability to use it with certain services (such as YouTube)
which allow different protocols (such as HLS)
This commit is contained in:
Maya Venkatraman
2020-10-13 13:42:35 -07:00
committed by jp9000
parent d7e673d23d
commit c4e71794d9
3 changed files with 27 additions and 3 deletions

View File

@@ -71,6 +71,7 @@ static void ffmpeg_mux_destroy(void *data)
os_process_pipe_destroy(stream->pipe);
dstr_free(&stream->path);
dstr_free(&stream->printable_path);
dstr_free(&stream->stream_key);
dstr_free(&stream->muxer_settings);
bfree(stream);
}
@@ -200,6 +201,14 @@ static void log_muxer_params(struct ffmpeg_muxer *stream, const char *settings)
av_dict_free(&dict);
}
static void add_stream_key(struct dstr *cmd, struct ffmpeg_muxer *stream)
{
dstr_catf(cmd, "\"%s\" ",
dstr_is_empty(&stream->stream_key)
? ""
: stream->stream_key.array);
}
static void add_muxer_params(struct dstr *cmd, struct ffmpeg_muxer *stream)
{
struct dstr mux = {0};
@@ -260,6 +269,7 @@ static void build_command_line(struct ffmpeg_muxer *stream, struct dstr *cmd,
}
}
add_stream_key(cmd, stream);
add_muxer_params(cmd, stream);
}