obs-ffmpeg: Only set codec ids if format non-null
In the settings if you select default container then the format becomes null. If null then audio/video codec ids should not be set on the output format as they will both be AV_CODEC_ID_NONE causing a context with no streams specified to be created (error).
This commit is contained in:
@@ -458,10 +458,12 @@ static bool ffmpeg_data_init(struct ffmpeg_data *data,
|
||||
data->output->oformat->video_codec = AV_CODEC_ID_H264;
|
||||
data->output->oformat->audio_codec = AV_CODEC_ID_AAC;
|
||||
} else {
|
||||
data->output->oformat->video_codec =
|
||||
data->config.video_encoder_id;
|
||||
data->output->oformat->audio_codec =
|
||||
data->config.audio_encoder_id;
|
||||
if (data->config.format_name) {
|
||||
data->output->oformat->video_codec =
|
||||
data->config.video_encoder_id;
|
||||
data->output->oformat->audio_codec =
|
||||
data->config.audio_encoder_id;
|
||||
}
|
||||
}
|
||||
|
||||
if (!data->output) {
|
||||
|
Reference in New Issue
Block a user