correct application of playlists rules

This commit is contained in:
Gabriel Radureau
2025-10-16 17:18:58 +02:00
parent d2e2028610
commit 78313ffbef
17 changed files with 1098 additions and 247 deletions

View File

@@ -2,25 +2,21 @@ get_rotation_filter() {
local f="$1"
local rotation
rotation=$(exiftool -Rotation -n "$f" | awk '{print $3}')
# echo $rotation $f >> "rotations.txt"
case "$rotation" in
# 90) echo "transpose=1" ;;
# 270) echo "transpose=2" ;;
# 180) echo "hflip,vflip" ;;
# *) echo "" ;;
*) echo "transpose=1" ;;
esac
}
export -f get_rotation_filter
reencode_with_rotation() {
set -x
local src="$1"
local dst="$2"
local filter
filter="$(get_rotation_filter "$src")"
if [ -n "$filter" ]; then
echo " Correction dorientation (rotation=${filter})"
#echo " Correction dorientation (rotation=${filter})"
if ffmpeg -encoders 2>/dev/null | grep -q 'h264_videotoolbox'; then
ffmpeg -nostdin -i "$src" -vf "$filter" \
-c:v h264_videotoolbox -b:v 5M -c:a aac -map_metadata -1 -y "$dst"
@@ -42,5 +38,6 @@ reencode_with_rotation() {
fi
fi
fi
set +x
}
export -f reencode_with_rotation