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