Rotate video 90 degrees
video filters
// what it does
The `transpose` filter rotates the frame 90 degrees and swaps width/height: `transpose=1` is 90 clockwise, `transpose=2` is 90 counter-clockwise. Use it to fix sideways footage or reorient for a target aspect. For 180 you chain two, e.g. `transpose=2,transpose=2`.
// shell
$ ffmpeg -i input.mp4 -vf "transpose=1" output.mp4$ ffmpeg -i input.mp4 -vf "transpose=2" output.mp4// gotcha
Modern ffmpeg auto-applies a clip's rotation metadata on decode, so phone videos already display upright — adding `transpose` then double-rotates them. Check with `ffprobe` and strip the display-matrix rotation if needed.