Add files via upload
This commit is contained in:
parent
e420190156
commit
a162880eea
1 changed files with 18 additions and 0 deletions
18
to_opus.sh
Normal file
18
to_opus.sh
Normal 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
|
Loading…
Reference in a new issue