Skip to content

Commit b17dad1

Browse files
committed
lavc: allow option listing also for decoders
1 parent f029f46 commit b17dad1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/video_compress/libavcodec.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ static void usage() {
400400
col() << "\t" << SBOLD("<slices>") << " number of slices to use (default: " << DEFAULT_SLICE_COUNT << ")\n";
401401
col() << "\t" << SBOLD("<gop>") << " specifies GOP size\n";
402402
col() << "\t" << SBOLD("<lavc_opt>") << " arbitrary option to be passed directly to libavcodec (eg. preset=veryfast), eventual colons must be backslash-escaped (eg. for x264opts)\n";
403-
col() << "\nUse '" << SBOLD("-c libavcodec:encoder=<enc>:help") << "' to display encoder specific options.\n";
403+
col() << "\nUse '" << SBOLD("-c libavcodec:encoder=<enc>:help") << "' to display encoder specific options, works on decoders as well (also use keyword \"encoder\").\n";
404404
col() << "\n";
405405
col() << "Libavcodec version (linked): " << SBOLD(LIBAVCODEC_IDENT) << "\n";
406406
const char *swscale = "no";
@@ -1941,6 +1941,9 @@ static void setparam_h264_h265_av1(AVCodecContext *codec_ctx, struct setparam_pa
19411941
void show_encoder_help(string const &name) {
19421942
col() << "Options for " << SBOLD(name) << ":\n";
19431943
auto *codec = avcodec_find_encoder_by_name(name.c_str());
1944+
if (codec == nullptr) {
1945+
codec = avcodec_find_decoder_by_name(name.c_str());
1946+
}
19441947
if (codec == nullptr) {
19451948
LOG(LOG_LEVEL_ERROR) << MOD_NAME << "Unable to find encoder " << name << "!\n";
19461949
return;

0 commit comments

Comments
 (0)