Audio codec: improved help

+ mention that the bitrate is per channel
This commit is contained in:
Martin Pulec
2019-10-08 09:27:25 +02:00
parent bc25e1bc0e
commit ad6ea541e6

View File

@@ -58,11 +58,14 @@
#include "utils/misc.h"
#include "lib_common.h"
#include "rang.hpp"
#include <algorithm>
#include <climits>
#include <unordered_map>
using rang::fg;
using rang::style;
using namespace std;
static const unordered_map<audio_codec_t, audio_codec_info_t, hash<int>> audio_codec_info = {
@@ -113,13 +116,17 @@ std::vector<std::pair<std::string, bool>> get_audio_codec_list(void){
void list_audio_codecs(void) {
printf("Syntax:\n");
printf("\t--audio-codec <audio_codec>[:sample_rate=<sampling_rate>][:bitrate=<bitrate>]\n");
printf("\n");
cout << style::bold << fg::red << "\t--audio-codec <codec_name>" << fg::reset << "[:sample_rate=<sampling_rate>][:bitrate=<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");
}