We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e579532 commit 10ec6c5Copy full SHA for 10ec6c5
zsh/custom/video.zsh
@@ -7,3 +7,19 @@ trim_video() {
7
fi
8
ffmpeg -i $1 -ss $2 -to $3 -c:v copy -c:a copy $4
9
}
10
+
11
+fix_rotation() {
12
+ # Fix wrong rotation metadata in a video.
13
+ # Custom Android ROMs can sometimes give wrong orientation sensor data,
14
+ # resulting in wrong orientation metadata in video recordings.
15
+ if [ $# -lt 1 ]; then
16
+ echo "Usage: fix_rotation <source paths>"
17
+ fi
18
+ for ARG in "$@"; do
19
+ NAME="${ARG%.*}"
20
+ SUFFIX="${ARG##*.}"
21
+ OLD_NAME="${NAME}-old.${SUFFIX}"
22
+ mv "${ARG}" "${OLD_NAME}"
23
+ ffmpeg -display_rotation 0 -i "${OLD_NAME}" -c copy "${ARG}"
24
+ done
25
+}
0 commit comments