From 3dce4cb79bfed7a15e7ae6bec97a93d66c0b0d94 Mon Sep 17 00:00:00 2001 From: ns6089 <61738816+ns6089@users.noreply.github.com> Date: Tue, 11 Jul 2023 12:49:59 +0300 Subject: [PATCH] Lock h264 into High profile --- src/nvenc/nvenc_base.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/nvenc/nvenc_base.cpp b/src/nvenc/nvenc_base.cpp index b5a7ac916d3..6eac7c5ab41 100644 --- a/src/nvenc/nvenc_base.cpp +++ b/src/nvenc/nvenc_base.cpp @@ -165,7 +165,7 @@ namespace nvenc { } NV_ENC_CONFIG enc_config = preset_config.presetCfg; - enc_config.profileGUID = NV_ENC_CODEC_PROFILE_AUTOSELECT_GUID; // TODO: select specific profile? + enc_config.profileGUID = NV_ENC_CODEC_PROFILE_AUTOSELECT_GUID; enc_config.gopLength = NVENC_INFINITE_GOPLENGTH; enc_config.frameIntervalP = 1; enc_config.rcParams.enableAQ = 0; @@ -207,6 +207,13 @@ namespace nvenc { switch (client_config.videoFormat) { case 0: { // H.264 + if (buffer_format == NV_ENC_BUFFER_FORMAT_YUV444 || buffer_format == NV_ENC_BUFFER_FORMAT_YUV444_10BIT) { + enc_config.profileGUID = NV_ENC_H264_PROFILE_HIGH_444_GUID; + } + else { + enc_config.profileGUID = NV_ENC_H264_PROFILE_HIGH_GUID; + } + auto &format_config = enc_config.encodeCodecConfig.h264Config; set_common_format_config(format_config); format_config.entropyCodingMode = get_encoder_cap(NV_ENC_CAPS_SUPPORT_CABAC) ? NV_ENC_H264_ENTROPY_CODING_MODE_CABAC : NV_ENC_H264_ENTROPY_CODING_MODE_CAVLC;