-
-
Save mmarkus13/6bf41e2772a293fa5819bad7a1ef6e5e to your computer and use it in GitHub Desktop.
Rotate a video with FFmpeg (100% lossless, and quick)
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
| $INPUTVIDEO='input.mp4' | |
| $OUTPUTVIDEO='output.mp4' | |
| ffmpeg -i $INPUTVIDEO -metadata:s:v rotate="-90" -codec copy $OUTPUTVIDEO |
Author
Author
rotate90ALL:
for file in ./*.MP4
do
rotate90 "$file"
done
Author
I was too lazy to copy the already rotated files to a new folder;
- so I've modified the above script to ignore these files (and automatically skip asking me if I want to overwrite each already rotated file...).
while true; do echo no; done | for file in $(ls | grep -i ".MP4" | grep -v "+90"); do rotate90 "$file"; done
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
(using the example above: from
myVideo.MP4->myVideo+90.MP4)In order to be able to use the above 'shortcut':
To change the rotation angle edit the script
/home/$USER/rotate904th line variablerotate="90"'s value to the desired one.( ex.: -270; -90; 180; ... )