convert-videos-for-plex.sh

-affiche la version de handbrake
This commit is contained in:
2022-08-03 15:36:20 +02:00
parent d5020f5e55
commit 5d57207bb8

View File

@@ -80,6 +80,22 @@ GREEN='\033[0;32m'
BLUE='\033[0;34m' BLUE='\033[0;34m'
NC='\033[0m' # No Color NC='\033[0m' # No Color
version=$(ls /opt/homebrew/Cellar/handbrake 2>/dev/null)
if [ "$version" != "" ]; then
handbrake="/opt/homebrew/Cellar/handbrake/$version/bin/HandBrakeCLI"
echo "Handbrake $version"
else {
cli=$(which HandBrakeCLI)
if [ "$cli" != "" ]; then
handbrake="$cli"
version=$("$handbrake" --version 2>/dev/null | sed -n '1p')
echo "$version"
else
echo "handbrake not installed!"
fi
}
fi
function removeLock { function removeLock {
if [[ -f "$1" ]]; then if [[ -f "$1" ]]; then
rm "$1" rm "$1"
@@ -231,7 +247,8 @@ for i in "${path}"{,**/}*.*; do
fi fi
# Modified from http://pastebin.com/9JnS23fK # Modified from http://pastebin.com/9JnS23fK
HandBrakeCLI -i "${fileIn}" -o "${fileOut}""_processing""${ext}" --preset="${qualityPreset}" -O ${subtitle} ${audio} #HandBrakeCLI -i "${fileIn}" -o "${fileOut}""_processing""${ext}" --preset="${qualityPreset}" -O ${subtitle} ${audio}
"$handbrake" -i "${fileIn}" -o "${fileOut}""_processing""${ext}" --preset="${qualityPreset}" -O ${subtitle} ${audio}
# if HandBrake did not exit gracefully, continue with next iteration # if HandBrake did not exit gracefully, continue with next iteration
if [[ $? -ne 0 ]]; then if [[ $? -ne 0 ]]; then