-
Notifications
You must be signed in to change notification settings - Fork 2
/
vidrotate
executable file
·22 lines (19 loc) · 694 Bytes
/
vidrotate
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash
# (c) 2020 Leif Sawyer
# License: GPL 3.0 (see https://github.com/akhepcat/)
# Permanent home: https://github.com/akhepcat/Miscellaneous/
# Direct download: https://raw.githubusercontent.com/akhepcat/Miscellaneous/master/vidrotate
#
if [ -z "$1" ]
then
echo "usage: $0 [file] [flip]"
echo " 0 = 90CounterCLockwise and Vertical Flip"
echo " 1 = 90Clockwise"
echo " 2 = 90CounterClockwise (default)"
echo " 3 = 90Clockwise and Vertical Flip"
else
FLIP=${2:-2} # Default to 90-degrees CCW (left)
FLIP=${FLIP//[^0-3]/}
TIMEBASE="-r 65535/2733" # work around timebase errors
ffmpeg -noautorotate -i "${1}" -acodec copy -q:v 10 -vf "transpose=${FLIP}" "rot-${1}"
fi