From 60befe0b3a14606e3d5573f635c92c0a29c64b08 Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Thu, 11 Jul 2024 14:29:07 +0200 Subject: [PATCH] vcomp/lavc: add cmdline doc for libsvtav1 examples + remarks for svtav1-param option --- src/video_compress/libavcodec.cpp | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/video_compress/libavcodec.cpp b/src/video_compress/libavcodec.cpp index 320023492..1b4104490 100644 --- a/src/video_compress/libavcodec.cpp +++ b/src/video_compress/libavcodec.cpp @@ -445,7 +445,9 @@ void usage(bool full) { col() << "\t" << SBOLD(get_codec_name(param.first)) << " - " << avail << "\n"; } - col() << "\nUse '" << SBOLD("-c libavcodec:encoder=:help") << "' to display encoder specific options, works on decoders as well (also use keyword \"encoder\").\n"; + col() << "\nUse '" << SBOLD("-c lavc:enc=:help") + << "' to display encoder specific options/examples; works\nfor " + "decoders as well (use the keyword \"enc[oder]\", anyways).\n"; col() << "\n"; col() << "Libavcodec version (linked): " << SBOLD(LIBAVCODEC_IDENT) << "\n"; const char *swscale = "no"; @@ -2113,6 +2115,24 @@ void show_encoder_help(string const &name) { if (name == "hevc_qsv" || name == "h264_qsv") { col() << "\n\t- " << SBOLD("rc") << " - [UltraGrid specific] rate control mode: " << SBOLD("cbr") << ", " << SBOLD("cqp") << ", " << SBOLD("icq") << ", " << SBOLD("qvbr") << " or " << SBOLD("vbr") << "\n"; } + if (name == "libsvtav1") { + color_printf("\nIf using " TBOLD("svtav1-params") ", the option " + "separator (':') must be replaced with '\\:'.\n" + "It is also recommended to consult its default value " + "(see UG output for the encoder).\n"); + color_printf("\nExamples:\n"); + color_printf(TBOLD("\tuv -c lavc:enc=libsvtav1") + "\n\t - use SVT AV1 with default RC CRF 35\n"); + color_printf(TBOLD("\tuv -c lavc:enc=libsvtav1:crf=30") + "\n\t - use SVT AV1 with CRF=30\n"); + color_printf(TBOLD("\tuv -c lavc:enc=libsvtav1:cqp=30") + "\n\t - use SVT AV1 with QP=30\n"); + color_printf(TBOLD("\tuv -c lavc:enc=libsvtav1:crf=35:bitr=3M") + "\n\t - use SVT AV1 with QP=35 and Maximum Bitrate 3 Mbps\n"); + color_printf(TBOLD("\tuv -c lavc:enc=libsvtav1:bitr=3M") + "\n\t - use SVT AV1 in VBR mode with 3 Mbps (not " + "recommended at the moment, increases latency)\n"); + } } static void setparam_vp8_vp9(AVCodecContext *codec_ctx, struct setparam_param *param)