From 13446c6d89a5655844e1ec70b916ea8397f57528 Mon Sep 17 00:00:00 2001 From: fabian Date: Sat, 27 May 2023 18:12:52 +0200 Subject: [PATCH] use opus since it yields better audio quality --- scripts/{transcode_m4a.sh => transcode_opus.sh} | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) rename scripts/{transcode_m4a.sh => transcode_opus.sh} (57%) diff --git a/scripts/transcode_m4a.sh b/scripts/transcode_opus.sh similarity index 57% rename from scripts/transcode_m4a.sh rename to scripts/transcode_opus.sh index ee2aa95..8ca6e3a 100755 --- a/scripts/transcode_m4a.sh +++ b/scripts/transcode_opus.sh @@ -13,12 +13,14 @@ while [[ $# > 0 ]]; do done # ensure existence of destination folder -dest=../transcode_m4a +dir="$(pwd)" +dest=${dir%/*}/${dir##*/}_ogg if [[ !(-d $dest) ]]; then mkdir $dest fi for file in ./*.$file_suffix; do - echo "ffmpeg -i '$file' -c:a libfdk_aac -profile:a aac_he -b:a 64k $map -movflags +faststart '$dest/${file%$file_suffix}m4a'"; - ffmpeg -i "$file" -c:a libfdk_aac -profile:a aac_he -b:a 64k $map -movflags +faststart "$dest/${file%$file_suffix}m4a"; + # `-vbr on -application audio` should be default, but let's be sure + echo "ffmpeg -i '$file' -c:a libopus -b:a 64k -vbr on -application audio $map '$dest/${file%$file_suffix}ogg'"; + ffmpeg -i "$file" -c:a libopus -b:a 64k -vbr on -application audio $map "$dest/${file%$file_suffix}ogg"; done