Add files via upload

This commit is contained in:
Leaced 2023-03-24 11:16:18 +01:00 committed by GitHub
parent e420190156
commit a162880eea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

18
to_opus.sh Normal file
View file

@ -0,0 +1,18 @@
#!/usr/bin/env bash
shopt -q globstar; globstar_set=$?
((globstar_set)) && shopt -s globstar
shopt -q extglob; extglob_set=$?
((extglob_set)) && shopt -s extglob
# Note, 0 (true) from shopt -q is "false" in a math context.
FORMATS=$@
for file in **/*.@(${FORMATS// /|}); do
ffmpeg -threads 4 -i "$file" -c:a libopus -b:a 128k "${file%.*}.opus" && rm "$file"
done
((globstar_set)) && shopt -u globstar
((extglob_set)) && shopt -u extglob
exit 0