From dc311f5ce6f0b522e28bc9a2fe9ee301027dafa1 Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Tue, 6 Oct 2020 15:35:06 +0200 Subject: [PATCH] encoder/ffmpeg: Don't use hardware encoding for unsupported formats --- source/encoders/encoder-ffmpeg.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/encoders/encoder-ffmpeg.cpp b/source/encoders/encoder-ffmpeg.cpp index 84bc2643..818af6ec 100644 --- a/source/encoders/encoder-ffmpeg.cpp +++ b/source/encoders/encoder-ffmpeg.cpp @@ -95,7 +95,8 @@ ffmpeg_instance::ffmpeg_instance(obs_data_t* settings, obs_encoder_t* self, bool if (is_hw) { // Abort if user specified manual override. if ((static_cast(obs_data_get_int(settings, KEY_FFMPEG_COLORFORMAT)) != AV_PIX_FMT_NONE) - || (obs_data_get_int(settings, KEY_FFMPEG_GPU) != -1) || (obs_encoder_scaling_enabled(_self))) { + || (obs_data_get_int(settings, KEY_FFMPEG_GPU) != -1) || (obs_encoder_scaling_enabled(_self)) + || (video_output_get_info(obs_encoder_video(_self))->format != VIDEO_FORMAT_NV12)) { throw std::runtime_error( "Selected settings prevent the use of hardware encoding, falling back to software."); }