also convert m4a, they are lossless

master
lub 5 years ago
parent 45bd756ce2
commit 689dc052a8

@ -14,10 +14,10 @@ cd "$source"
find . -type d -exec mkdir -p "$destination/{}" \;
# copy existing files
find . -type f -and \( -name '*.mp3' -or -name '*.ogg' -or -name '*.m4a' -or -name '*.opus' \) -exec cp -a --reflink=always "{}" "$destination/{}" \;
find . -type f -and \( -name '*.mp3' -or -name '*.ogg' -or -name '*.opus' \) -exec cp -a --reflink=always "{}" "$destination/{}" \;
# set +e because ffmpeg errors on .jpg, .txt, etc.
# compress with mp3
set +e
find . -type f -not -name '*.mp3' -not -name '*.ogg' -not -name '*.m4a' -not -name '*.opus' | parallel --eta --progress 'nice -n19 ffmpeg -v 0 -n -i ""{}"" -c:a mp3 -b:a 320 -map_metadata 0 ""$destination/{.}.mp3""'
find . -type f -not -name '*.mp3' -not -name '*.ogg' -not -name '*.opus' | parallel --eta --progress 'nice -n19 ffmpeg -v 0 -n -i ""{}"" -c:a mp3 -b:a 320 -map_metadata 0 ""$destination/{.}.mp3""'
#set -e

Loading…
Cancel
Save