>FFmpegLab Start free
FFmpeg Guide

How to rotate & flip video with FFmpeg

Fix sideways phone footage, turn a clip 90 or 180 degrees, or mirror it left-to-right — with transpose, hflip, and vflip, plus a lossless metadata-only option.

There are two ways to "rotate" a video. You can re-encode with the transpose filter, which actually rewrites the pixels, or you can flip an orientation flag in the metadata, which is instant and lossless but relies on the player honoring it. Both have their place.

Key takeaways

Rotate 90° (clockwise / counter-clockwise)

ShareRenders{ } CodeConfig
Generated CodeLogsCustomize
# 90° clockwise
ffmpeg -i in.mp4 -vf "transpose=1" -c:a copy out.mp4

# 90° counter-clockwise
ffmpeg -i in.mp4 -vf "transpose=2" -c:a copy out.mp4

The values: 0 = 90° CCW + vertical flip, 1 = 90° CW, 2 = 90° CCW, 3 = 90° CW + vertical flip.

Rotate 180°

ShareRenders{ } CodeConfig
Generated CodeLogsCustomize
ffmpeg -i in.mp4 -vf "transpose=2,transpose=2" -c:a copy out.mp4
# equivalent, often faster:
ffmpeg -i in.mp4 -vf "hflip,vflip" -c:a copy out.mp4

Mirror (flip) a video

ShareRenders{ } CodeConfig
Generated CodeLogsCustomize
# horizontal mirror (selfie-style)
ffmpeg -i in.mp4 -vf "hflip" -c:a copy out.mp4

# vertical flip (upside down)
ffmpeg -i in.mp4 -vf "vflip" -c:a copy out.mp4

Fix sideways phone video losslessly

Phones often record sideways and set a rotation flag. To re-tag without re-encoding the pixels — instant and lossless — set the orientation metadata instead:

ShareRenders{ } CodeConfig
Generated CodeLogsCustomize
ffmpeg -i in.mp4 -metadata:s:v rotate=90 -c copy out.mp4

If a player ignores the flag, fall back to a real transpose re-encode above.

Rotate visually instead

FFmpegLab rotates and flips with a click and writes the matching transpose/hflip command, so you can fix orientation without remembering filter values — running fully offline. Then compress or convert for delivery.

✦  Fresh from the render queue

Better FFmpeg workflows, delivered.

Get practical commands, new templates, and deep-dive guides for the edits that are usually hardest to get right.

✓  Copy-pasteable commands    ✓  Editor templates    ✓  No noise
One useful email at a time.

Rotate, flip, and fix orientation — in your browser.

Free in your browser — nothing to install, nothing uploaded.