diff --git a/arch-config/scripts/pieces/multi-ffmpeg.sh b/arch-config/scripts/pieces/multi-ffmpeg.sh index a080c18b..06d2fca4 100644 --- a/arch-config/scripts/pieces/multi-ffmpeg.sh +++ b/arch-config/scripts/pieces/multi-ffmpeg.sh @@ -1,32 +1,31 @@ #!/bin/bash set -euo pipefail -#change into music raw folder +# change into music raw folder cd "$HOME/MusikRaw" # number of parallel jobs can be set on as an argument numjobs="$1" # get directories -#ls -d */ | awk '{gsub(/ /,"\\ ")}8' - > directories ls -d */ > directories while read -r dir; do - echo "$dir" + #echo "$dir" # if there are $numjobs or more, dont spawn any new processes while [[ $(jobs | wc -l) -gt $numjobs ]] ; do sleep 1 ; done cd "$dir" # convert m4a if [[ $(ls | grep ".m4a") ]]; then - ffmpeg-normalize *.m4a -v -pr -c:a libopus -ext opus & + ffmpeg-normalize *.m4a -v -pr -c:a libopus -ar 92 -ext opus & fi # convert flac if [[ $(ls | grep ".flac") ]]; then - ffmpeg-normalize *.flac -v -pr -c:a flac -ext flac & + ffmpeg-normalize *.flac -v -pr -c:a flac -ar 88.2 -ext flac & fi # convert opus if [[ $(ls | grep ".opus") ]]; then - ffmpeg-normalize *.opus -v -pr -c:a libopus -ext opus & + ffmpeg-normalize *.opus -v -pr -c:a libopus -ar 92 -ext opus & fi cd "$HOME/MusikRaw" # create directory