How to rotate image to arbitrary angle with FFMpeg filter?

A rotate filter was recently added to FFmpeg, which allows rotation by an arbitrary angle. To use it, you can build the lastest version from git or download a recent snapshot build.

The angle is specified in radians; positive is clockwise and negative is counterclockwise. If you have degrees, multiply by PI/180 to convert to radians. For example, to rotate 3° counterclockwise:

ffmpeg -i in.mp4 -vf "rotate=-3*PI/180" out.mp4

Check out the documentation for more details and additional examples.


Another solution(but only for 90*n degrees):

Rotate 90 clockwise:

ffmpeg -i in.mov -vf "transpose=1" out.mov

For the transpose parameter you can pass:

0 = 90CounterCLockwise and Vertical Flip (default)
1 = 90Clockwise
2 = 90CounterClockwise
3 = 90Clockwise and Vertical Flip
Category: FFMpeg | Tags: Video image ffmepg | Read Count: 2562

登录 *

loading captcha image...
or Ctrl+Enter

Host by is-Programmer.com | Power by Chito 1.3.3 beta | Theme: Aeros 2.0 by TheBuckmaker.com