From 75663f73a4573d88481b5955ecdd4e0dd88793d1 Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Mon, 6 Jul 2020 00:51:15 +0200 Subject: [PATCH] encoders/handlers/nvenc: Don't list 'each' mode for H.264 --- data/locale/en-US.ini | 2 +- source/encoders/handlers/nvenc_shared.cpp | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/data/locale/en-US.ini b/data/locale/en-US.ini index fa458ff3..a7487cdc 100644 --- a/data/locale/en-US.ini +++ b/data/locale/en-US.ini @@ -471,8 +471,8 @@ FFmpegEncoder.NVENC.Other="Other Options" FFmpegEncoder.NVENC.Other.BFrames="Maximum B-Frames" FFmpegEncoder.NVENC.Other.BFrames.Description="Maximum number of B-Frames to insert into the encoded bitstream.\nActual number of B-Frames may be lower depending on content and lookahead settings.\nOnly Turing NVENC supports B-Frames for HEVC." FFmpegEncoder.NVENC.Other.BFrameReferenceMode="B-Frame Reference Mode" -FFmpegEncoder.NVENC.Other.BFrameReferenceMode.Each="Each B-Frame will be used for references" FFmpegEncoder.NVENC.Other.BFrameReferenceMode.Middle="Only (# of B-Frames)/2 will be used for references" +FFmpegEncoder.NVENC.Other.BFrameReferenceMode.Each="Each B-Frame will be used for references" FFmpegEncoder.NVENC.Other.ZeroLatency="Zero Latency" FFmpegEncoder.NVENC.Other.ZeroLatency.Description="Enable zero latency operation, which ensures that there is no reordering delay." FFmpegEncoder.NVENC.Other.WeightedPrediction="Weighted Prediction" diff --git a/source/encoders/handlers/nvenc_shared.cpp b/source/encoders/handlers/nvenc_shared.cpp index f222569d..fafe9714 100644 --- a/source/encoders/handlers/nvenc_shared.cpp +++ b/source/encoders/handlers/nvenc_shared.cpp @@ -441,6 +441,10 @@ void nvenc::get_properties_post(obs_properties_t* props, const AVCodec* codec) obs_properties_add_list(grp, KEY_OTHER_BFRAMEREFERENCEMODE, D_TRANSLATE(ST_OTHER_BFRAMEREFERENCEMODE), OBS_COMBO_TYPE_LIST, OBS_COMBO_FORMAT_INT); for (auto kv : b_ref_modes) { + if (kv.first == nvenc::b_ref_mode::EACH && (static std::string_view("h264_nvenc") == codec->name)) { + // H.264 does not support using all B-Frames as reference. + continue; + } obs_property_list_add_int(p, D_TRANSLATE(kv.second.c_str()), static_cast(kv.first)); } }