FFmpeg Cookbook
JA

Rotate Video Tool

Turn a sideways or upside-down video the right way up: rotate it 90° right, 90° left or 180°, or flip it left-right or top-bottom.

Your file is not uploaded
Drag & drop a video, or tap to select
MP4 / MOV / WebM, up to 500 MB
—
—
90° CW
Clockwise
180°
Fix upside-down
90° CCW
Counter-CW
H-flip
Mirror
V-flip
Vertical mirror
The video is re-encoded to H.264. If the source has a rotation flag (as phone clips do), FFmpeg first turns the picture upright from it and then applies your choice, so the output has no rotation flag.
A clip that is upright on the phone but sideways on a PC cannot be fixed by choosing an angle here. Use “Burn into pixels” in the Mobile Video Playback Fixer.
Processing… 0%

Equivalent FFmpeg command

CLI command for your current settings. Updates live as you change controls.

ffmpeg -i input.mp4 -vf "transpose=1,scale=trunc(iw/2)*2:trunc(ih/2)*2" -c:v libx264 -preset fast -crf 20 -pix_fmt yuv420p -c:a copy -movflags +faststart output.mp4

Useful next tools

Popular uses
Fix phone video orientationRotate 90 degreesAvoid orientation metadata problems

How to use

  1. Drop the videoDrag and drop an MP4, MOV, WebM or similar file, up to 500 MB.
  2. Pick a directionChoose one of the 5 options. Judge by how the video looks on a phone or in a browser: if the top of the picture points left, choose 90° CW; if it points right, choose 90° CCW.
  3. RunClick Apply rotation. When it finishes, a preview appears and you can download the result.

Recommended settings

Upright on the phone, sideways only in a PC player
Not this tool: Burn into pixels in the Mobile Video Playback Fixer
The player ignores the rotation flag. This tool first turns the picture upright from that flag and then rotates it, so no option here fixes it. Use the Mobile Video Playback Fixer.
Recorded upside down by accident
180°
One pass turns it the right way up.
Left and right are reversed
Horizontal flip
Turns a mirrored picture back. If there is text in the picture, check that it reads correctly.

When it goes wrong

The result faces a different way than you chose

Cause: The source has a rotation flag (rotation metadata). FFmpeg first turns the picture upright from that flag, then applies your rotation.

Fix: Choose again based on how the video looks on a phone or in a browser. To make a clip that is upright on the phone play upright on a PC, use Burn into pixels in the Mobile Video Playback Fixer.

Slight quality drop after rotating

Cause: Rotating needs a video re-encode (H.264, CRF 20), which loses a little quality.

Fix: The re-encode cannot be avoided. Rotate once to the angle you need instead of several times.

Mirror flip made on-screen text unreadable

Cause: Mirroring flips text along with the rest of the frame.

Fix: Do not use the horizontal flip on video with text in it.

Questions

Should I rotate my phone clip or re-shoot?

No need to re-shoot. A phone records the way it was held as a rotation flag in the video. If the clip looks right on the phone or in a browser, the file is fine, and a PC player that shows it sideways is ignoring the flag: use the Mobile Video Playback Fixer. If it is sideways everywhere, rotate it here.

Two 90° rotations = 180°?

The direction ends up the same, but the video is re-encoded twice and loses quality each time. Choose 180° and do it in one pass.

Should I rotate before uploading to YouTube?

Not if the video already plays the right way up. If you want the picture itself upright instead of relying on the rotation flag, use Burn into pixels in the Mobile Video Playback Fixer.

Does audio change?

No. The audio is copied as is. Only audio that MP4 cannot hold (such as the PCM audio common in camera MOV files) is converted to AAC at 192 kbps.

Does file size change after rotation?

A 90° turn swaps the width and height (an odd side loses one pixel to become even). The file size can go up or down, because the video is re-encoded at CRF 20.

More detail (settings, limits, FFmpeg commands)

What each setting means

90° CW
Rotates 90° clockwise. A picture whose top points left ends up upright.
180°
Turns an upside-down picture the right way up.
90° CCW
Rotates 90° counter-clockwise. A picture whose top points right ends up upright.
Horizontal flip
Swaps left and right, like a mirror. Any text in the picture is mirrored too.
Vertical flip
Swaps top and bottom. Unlike a 180° rotation, left and right stay as they are.

Browsers and limits

  • Maximum file size: 500 MB
  • Output is MP4 only. It runs on your CPU, not the GPU, so long videos take a while

The same job with the FFmpeg command line

90° clockwise
ffmpeg -i input.mp4 -vf transpose=1 -c:v libx264 -crf 20 -pix_fmt yuv420p -c:a copy output.mp4
If the source has a rotation flag, FFmpeg first turns the picture upright from it and then rotates. The output has no rotation flag.
180° rotation
ffmpeg -i input.mp4 -vf "transpose=2,transpose=2" -c:v libx264 -crf 20 -pix_fmt yuv420p -c:a copy output.mp4
Horizontal flip (mirror)
ffmpeg -i input.mp4 -vf hflip -c:v libx264 -crf 20 -pix_fmt yuv420p -c:a copy output.mp4