From 0725294e8c0035e49e42bfeadcc6ca0585916a1c Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Mon, 15 Apr 2024 16:39:49 +0200 Subject: [PATCH] vcompress/lavc: suggest preset opt for libsvt_hevc in case of insufficient performance --- src/video_compress/libavcodec.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/video_compress/libavcodec.cpp b/src/video_compress/libavcodec.cpp index b4e29106c..20667e94b 100644 --- a/src/video_compress/libavcodec.cpp +++ b/src/video_compress/libavcodec.cpp @@ -1176,11 +1176,18 @@ static void check_duration(struct state_video_compress_libav *s, time_ns_t dur_p if (s->lavc_opts.find("delay") == s->lavc_opts.end()) { hint = "\"delay=\" option to NVENC compression (2 suggested)"; } - } if (strcmp(s->codec_ctx->codec->name, "libaom-av1") == 0) { + } else if (strcmp(s->codec_ctx->codec->name, "libaom-av1") == 0) { if (s->lavc_opts.find("cpu-used") == s->lavc_opts.end()) { hint = "\"cpu-used=8\" option for quality/speed trade-off to AOM AV1 compression (values 0-8 allowed)"; quality_hurt = "quality"; } + } else if (strcmp(s->codec_ctx->codec->name, "libsvt_hevc") == 0) { + if (s->lavc_opts.find("preset") == s->lavc_opts.end()) { + hint = + "\"preset=12\" option for quality/speed trade-off " + "to libsvt_hevc compression (values 0-12 allowed)"; + quality_hurt = "quality"; + } } else if ((s->codec_ctx->thread_type & FF_THREAD_SLICE) == 0 && (s->codec_ctx->codec->capabilities & AV_CODEC_CAP_FRAME_THREADS) != 0) { hint = "\"threads=FS\" option with small or 0 (nr of logical cores) to compression"; } else if (s->codec_ctx->thread_count == 1 && (s->codec_ctx->codec->capabilities & AV_CODEC_CAP_OTHER_THREADS) != 0) {