From d066dfc645f9d04bbc59caf97c24a51ad3dd7205 Mon Sep 17 00:00:00 2001 From: Stoppedpuma <58333920+Stoppedpuma@users.noreply.github.com> Date: Sun, 14 Apr 2024 01:58:21 +0200 Subject: Increase audio bitrate for all codecs Increases AAC to 160kbps, increases Opus and FLAC to 128kbps. Remove step from TODO. --- TODO | 2 -- src/main.cpp | 10 +++++----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/TODO b/TODO index d980aa4..6b7f9b8 100644 --- a/TODO +++ b/TODO @@ -119,5 +119,3 @@ Investigate if there is a way to do gpu->gpu copy directly without touching syst Maybe something with clEnqueueMigrateMemObjects? on AMD something with DirectGMA maybe? Fix opus/flac ( variable framerate audio :( ). - -Change aac bitrate by default to 160kbps and opus/flac to 128kbps and remove the -ab option. \ No newline at end of file diff --git a/src/main.cpp b/src/main.cpp index 9c6878a..5067f87 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -263,12 +263,12 @@ static AVSampleFormat audio_codec_get_sample_format(AudioCodec audio_codec, cons static int64_t audio_codec_get_get_bitrate(AudioCodec audio_codec) { switch(audio_codec) { - case AudioCodec::AAC: return 128000; - case AudioCodec::OPUS: return 96000; - case AudioCodec::FLAC: return 96000; + case AudioCodec::AAC: return 160000; + case AudioCodec::OPUS: return 128000; + case AudioCodec::FLAC: return 128000; } assert(false); - return 96000; + return 128000; } static AudioFormat audio_codec_context_get_audio_format(const AVCodecContext *audio_codec_context) { @@ -850,7 +850,7 @@ static void usage_full() { fprintf(stderr, " -ac Audio codec to use. Should be either 'aac', 'opus' or 'flac'. Defaults to 'opus' for .mp4/.mkv files, otherwise defaults to 'aac'.\n"); fprintf(stderr, " 'opus' and 'flac' is only supported by .mp4/.mkv files. 'opus' is recommended for best performance and smallest audio size.\n"); fprintf(stderr, "\n"); - fprintf(stderr, " -ab Audio bitrate to use. Optional, by default the bitrate is 96000 for opus and flac and 128000 for aac.\n"); + fprintf(stderr, " -ab Audio bitrate to use. Optional, by default the bitrate is 128000 for opus and flac and 160000 for aac.\n"); fprintf(stderr, " If this is set to 0 then it's the same as if it's absent, in which case the bitrate is determined automatically depending on the audio codec.\n"); fprintf(stderr, "\n"); fprintf(stderr, " -oc Overclock memory transfer rate to the maximum performance level. This only applies to NVIDIA on X11 and exists to overcome a bug in NVIDIA driver where performance level\n"); -- cgit v1.2.3