Last active
January 23, 2017 16:48
-
-
Save shrwnsan/a4db057270bd41fdcf30f16177595433 to your computer and use it in GitHub Desktop.
Batch rotate videos. Note: This will stream copy the bitstreams, so no encoding is performed. Only the metadata of the first video stream (v:0) is changed here and the player will show the video in a rotated way. (Not all players will support this.)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Works on the latest ffmpeg | |
# Source, Stackoverflow http://bit.ly/2k960G7 | |
# brew install ffmpeg | |
# Default for iPhone | |
ext=m4v | |
# Set your directory | |
for f in /some/dir/*.$ext; do | |
new=${f/%.$ext/-rotated.$ext}; | |
ffmpeg -i "$f" -c copy -metadata:s:v:0 rotate=270 "$new" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment