Add --audio-bit-rate option

Add an option to configure the audio bit-rate.
This commit is contained in:
Romain Vimont
2023-02-18 18:32:43 +01:00
parent d2447ab54e
commit 153b17390b
58 changed files with 576 additions and 6 deletions

View File

@@ -59,6 +59,7 @@
#define OPT_NO_POWER_ON 1039
#define OPT_VIDEO_CODEC 1040
#define OPT_NO_AUDIO 1041
#define OPT_AUDIO_BIT_RATE 1042
struct sc_option {
char shortopt;
@@ -99,6 +100,14 @@ static const struct sc_option options[] = {
.longopt = "always-on-top",
.text = "Make scrcpy window always on top (above other windows).",
},
{
.longopt_id = OPT_AUDIO_BIT_RATE,
.longopt = "audio-bit-rate",
.argdesc = "value",
.text = "Encode the audio at the given bit-rate, expressed in bits/s. "
"Unit suffixes are supported: 'K' (x1000) and 'M' (x1000000).\n"
"Default is 196K (196000).",
},
{
.shortopt = 'b',
.longopt = "bit-rate",
@@ -1426,6 +1435,11 @@ parse_args_with_getopt(struct scrcpy_cli_args *args, int argc, char *argv[],
return false;
}
break;
case OPT_AUDIO_BIT_RATE:
if (!parse_bit_rate(optarg, &opts->audio_bit_rate)) {
return false;
}
break;
case OPT_CROP:
opts->crop = optarg;
break;