Skip to content

Instantly share code, notes, and snippets.

@ViktorNova
Created August 8, 2016 21:33
Show Gist options
  • Save ViktorNova/1dd68a2ec99781fd9adca49507c73ee2 to your computer and use it in GitHub Desktop.
Save ViktorNova/1dd68a2ec99781fd9adca49507c73ee2 to your computer and use it in GitHub Desktop.
Rotate a video with FFmpeg (100% lossless, and quick)
$INPUTVIDEO='input.mp4'
$OUTPUTVIDEO='output.mp4'
ffmpeg -i $INPUTVIDEO -metadata:s:v rotate="-90" -codec copy $OUTPUTVIDEO
@willwillis
Copy link

I had success with this
ffmpeg -i input.mp4 -vf "transpose=1" output.mp4

@orion486
Copy link

orion486 commented Jun 1, 2024

This link explains the correct way to do it now (without reencoding), as the -metadata:s:v rotate="-90" method has been deprecated and removed from the most recent versions of ffmpeg.

@deponian
Copy link

deponian commented Jun 7, 2025

@orion486 Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment