Skip to content

Commit

Permalink
Lock h264 into High profile
Browse files Browse the repository at this point in the history
  • Loading branch information
ns6089 committed Jul 11, 2023
1 parent 3b82773 commit 3dce4cb
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/nvenc/nvenc_base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 3dce4cb

Please sign in to comment.