From ad6ea541e6d5c8fb76a45c200fcf92b570de6bad Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Tue, 8 Oct 2019 09:27:25 +0200 Subject: [PATCH] Audio codec: improved help + mention that the bitrate is per channel --- src/audio/codec.cpp | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/audio/codec.cpp b/src/audio/codec.cpp index cc5dfed5e..54b79a166 100644 --- a/src/audio/codec.cpp +++ b/src/audio/codec.cpp @@ -58,11 +58,14 @@ #include "utils/misc.h" #include "lib_common.h" +#include "rang.hpp" #include #include #include +using rang::fg; +using rang::style; using namespace std; static const unordered_map> audio_codec_info = { @@ -113,13 +116,17 @@ std::vector> get_audio_codec_list(void){ void list_audio_codecs(void) { printf("Syntax:\n"); - printf("\t--audio-codec [:sample_rate=][:bitrate=]\n"); - printf("\n"); + cout << style::bold << fg::red << "\t--audio-codec " << fg::reset << "[:sample_rate=][:bitrate=]\n" << style::reset; + cout << "\nwhere\n"; + cout << "\t" << style::bold << "codec_name " << style::reset << " - one of the list below\n"; + cout << "\t" << style::bold << "sample_rate" << style::reset << " - sample rate that will the codec used (may differ from captured)\n"; + cout << "\t" << style::bold << "bitrate " << style::reset << " - codec bitrate " << style::bold << "per channel" << style::reset << " (with optional k/M suffix)\n"; + cout << "\n"; printf("Supported audio codecs:\n"); for (auto const &it : get_audio_codec_list()) { - printf("\t%s", it.first.c_str()); - if(!it.second) { - printf(" - unavailable"); + cout << style::bold << "\t" << it.first << style::reset; + if (!it.second) { + cout << " - " << fg::red <<"unavailable" << fg::reset; } printf("\n"); }