How to rotate video by 90°/180°/270° using ffmpeg

In order to rotate a video named input.mp4 using ffmpeg, use the following commands:

Rotate by 90° (clockwise)

ffmpeg -i input.mp4 -vf "transpose=1" rotated.mp4

Rotate by 180°

ffmpeg -i input.mp4 -vf "transpose=2" rotated.mp4

Rotate by 270° (clockwise)

This is equivalent to rotating 90° counter-clockwise.

ffmpeg -i input.mp4 -vf "transpose=3" rotated.mp4