Rotate a video with FFmpeg

Rotates the picture in 90-degree steps and clears the rotation metadata so players do not rotate it again.

ffmpeg -i https://cdn.rendobar.com/assets/examples/sample.mp4 -vf transpose=1 -metadata:s:v rotate=0 -c:a copy -t 5 out.mp4
Encode
2125 ms
Output
504.5 KB
Cost
$0.0036
Result
720x1280

job_5078cb5aaeec40ce

The part everyone gets wrong

A phone video usually stores its rotation as display-matrix side data rather than in the pixels. Rotating the pixels without clearing that metadata means the player rotates it a second time and the result lands sideways. The -metadata:s:v rotate=0 is not optional on that footage.

Frequently asked questions

How do I rotate video ffmpeg?

Rotates the picture in 90-degree steps and clears the rotation metadata so players do not rotate it again.

What goes wrong most often?

A phone video usually stores its rotation as display-matrix side data rather than in the pixels. Rotating the pixels without clearing that metadata means the player rotates it a second time and the result lands sideways. The -metadata:s:v rotate=0 is not optional on that footage.

Do I need FFmpeg installed?

Not with Rendobar. The command on this page ran through the API against a URL, with no local FFmpeg and no server. The job id below it is the job that produced these numbers.

Run this without installing FFmpeg

This exact command ran through the API against a URL.