Skip to content

Commit df32754

Browse files
committed
libavcodec NVENC: set p4 also for HEVC
NVENC 12.0 and above supports Split Frame Encoding up to p4 so it is perhaps better to set default as such. See also: https://docs.nvidia.com/video-technologies/video-codec-sdk/nvenc-video-encoder-api-prog-guide/#multi-nvenc-split-frame-encode
1 parent 1274775 commit df32754

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/video_compress/libavcodec.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,7 @@ struct setparam_param {
120120
map<string, string> &lavc_opts; ///< user-supplied options from command-line
121121
};
122122

123-
constexpr string_view DEFAULT_NVENC_PRESET_H264 = "p4";
124-
constexpr string_view DEFAULT_NVENC_PRESET_HEVC = "p7";
123+
constexpr const char *DEFAULT_NVENC_PRESET = "p4";
125124
constexpr const char *DEFAULT_NVENC_RC = "cbr";
126125
constexpr const char *DEFAULT_NVENC_TUNE = "ull";
127126
constexpr const char *FALLBACK_NVENC_PRESET = "llhq";
@@ -1816,7 +1815,7 @@ void set_forced_idr(AVCodecContext *codec_ctx, int value)
18161815

18171816
static void configure_nvenc(AVCodecContext *codec_ctx, struct setparam_param *param)
18181817
{
1819-
const char *preset = codec_ctx->codec_id == AV_CODEC_ID_H264 ? DEFAULT_NVENC_PRESET_H264.data() : DEFAULT_NVENC_PRESET_HEVC.data();
1818+
const char *preset = DEFAULT_NVENC_PRESET;
18201819

18211820
// important: if "tune" is not supported, then FALLBACK_NVENC_PRESET must be used (it is correlated). If unsupported preset
18221821
// were given, setting would succeed but would cause runtime errors.

0 commit comments

Comments
 (0)