1.07 - Use opusenc for opus conversion

master
RandomNinjaAtk 2 years ago committed by GitHub
parent cfc094bd12
commit a0a7cfbd6f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -2,7 +2,7 @@
export LC_ALL=C.UTF-8
export LANG=C.UTF-8
TITLESHORT="APP"
ScriptVersion="1.06"
ScriptVersion="1.07"
set -e
set -o pipefail
@ -156,6 +156,22 @@ Main () {
echo "Converting: $converttrackcount Tracks (Target Format: $targetformat (${targetbitrate}))"
for fname in "$1"/*.flac; do
filename="$(basename "${fname%.flac}")"
if [ "${ConversionFormat}" = OPUS ]; then
opusenc --bitrate ${bitrate} --vbr --music "$fname" "${fname%.flac}.temp.$extension";
echo "Converted: $filename"
if [ -f "${fname%.flac}.temp.$extension" ]; then
rm "$fname"
sleep 0.1
mv "${fname%.flac}.temp.$extension" "${fname%.flac}.$extension"
fi
continue
else
echo "Conversion failed: $filename, performing cleanup..."
rm -rf "$1"/*
sleep 0.1
exit 1
fi
if ffmpeg -loglevel warning -hide_banner -nostats -i "$fname" -n -vn $options "${fname%.flac}.temp.$extension"; then
echo "Converted: $filename"
if [ -f "${fname%.flac}.temp.$extension" ]; then

Loading…
Cancel
Save