|
|
|
@ -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 '*.opus' \) -exec cp -a --reflink=always "{}" "$destination/{}" \;
|
|
|
|
|
find . -type f -and \( -name '*.mp3' -or -name '*.m4a' -or -name '*.ogg' -or -name '*.opus' \) -exec cp -a --reflink=always "{}" "$destination/{}" \;
|
|
|
|
|
|
|
|
|
|
# set +e because ffmpeg errors on .jpg, .txt, etc.
|
|
|
|
|
set +e
|
|
|
|
|
# compress with opus
|
|
|
|
|
find . -type f -not -name '*.mp3' -not -name '*.ogg' -not -name '*.opus' | parallel --jobs $(($(nproc) - 1)) --eta --progress 'nice -n19 opusenc --bitrate 128 --music ""{}"" ""$destination/{.}.opus""'
|
|
|
|
|
find . -type f -not -name '*.mp3' -not -name '*.m4a' -not -name '*.ogg' -not -name '*.opus' | parallel --jobs $(($(nproc) - 1)) --eta --progress 'test -f ""$destination/{.}.opus"" || nice -n19 opusenc --bitrate 128 --music ""{}"" ""$destination/{.}.opus""'
|
|
|
|
|
#set -e
|
|
|
|
|