Rotate a Video 90 Degrees with FFmpeg
Turn a sideways or upside-down phone video upright using the transpose filter. One flag rotates clockwise, counterclockwise, or flips.
Run ffmpeg -i input.mp4 -vf "transpose=1" -c:a copy output.mp4 to rotate the video 90° clockwise (use transpose=2 for counterclockwise).
01Command
Command
$ ffmpeg -i input.mp4 -vf "transpose=1" -c:a copy output.mp402What it does
The transpose filter rotates the picture: 1 rotates 90° clockwise, 2 rotates 90° counterclockwise, and 3 rotates 90° clockwise plus a vertical flip (handy for mirrored phone recordings); run it twice for 180°. Only the video is re-processed, while -c:a copy keeps the audio untouched. If the phone already wrote a rotation metadata flag, players may auto-rotate and the result can look double-rotated — in that case strip the metadata with -metadata:s:v rotate=0 as well.
03Risk
!Warning: Rotating a 16:9 landscape clip to portrait swaps width and height; keep the vertical resolution even or some players and encoders will complain.
04Undo
✓No undo needed — this command does not change persistent state.
05Sources
- FFmpeg Filters Documentation (transpose filter)Evidence: transpose rotates video by 90 degrees counterclockwise (0), clockwise (1), or by 180 degrees via two passes; values 2 and 3 include the vertical flip.
- ffmpeg(1) — Linux manual pageEvidence: Documents -vf filter application and stream copy of audio with -c:a copy when the video is re-encoded.
Last verified: 2026-09-18 · Category: Media