当前位置:   article > 正文

FFmpeg视频的旋转rotate_ffmpeg rotate pi

ffmpeg rotate pi

ffmpeg命令目录


在视频的播放时间内,将视频旋转360°

在这里插入图片描述

//T为旋转一周的时长,如果为视频的时长,则旋转一圈,正好可以播放完
ffmpeg -i a3.mp4 -vf rotate=PI*2/T*t rotate8.mp4
  • 1
  • 2

rotate的第一个参数angle的单位是弧度
1°=π/180
360°=2π

例如将视频旋转90°,注意此种方式,并没有改变水平尺寸

ffmpeg -i a3.mp4 -vf rotate=PI/2 rotate9.mp4
  • 1

Rotate完整的参数

Rotate video by an arbitrary angle expressed in radians.

The filter accepts the following options:

A description of the optional parameters follows.

angle, a
Set an expression for the angle by which to rotate the input video clockwise, expressed as a number of radians. A negative value will result in a counter-clockwise rotation. By default it is set to "0".

This expression is evaluated for each frame.

out_w, ow
Set the output width expression, default value is "iw". This expression is evaluated just once during configuration.

out_h, oh
Set the output height expression, default value is "ih". This expression is evaluated just once during configuration.

bilinear
Enable bilinear interpolation if set to 1, a value of 0 disables it. Default value is 1.

fillcolor, c
Set the color used to fill the output area not covered by the rotated image. For the general syntax of this option, check the (ffmpeg-utils)"Color" section in the ffmpeg-utils manual. If the special value "none" is selected then no background is printed (useful for example if the background is never shown).

Default value is "black".

The expressions for the angle and the output size can contain the following constants and functions:

n
sequential number of the input frame, starting from 0. It is always NAN before the first frame is filtered.

t
time in seconds of the input frame, it is set to 0 when the filter is configured. It is always NAN before the first frame is filtered.

hsub
vsub
horizontal and vertical chroma subsample values. For example for the pixel format "yuv422p" hsub is 2 and vsub is 1.

in_w, iw
in_h, ih
the input video width and height

out_w, ow
out_h, oh
the output width and height, that is the size of the padded area as specified by the width and height expressions

rotw(a)
roth(a)
the minimal width/height required for completely containing the input video rotated by a radians.

These are only available when computing the out_w and out_h expressions.
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/知新_RL/article/detail/174734
推荐阅读
相关标签
  

闽ICP备14008679号