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;