FFmpeg视频的旋转rotate
时间:2019-02-16
本文章向大家介绍FFmpeg视频的旋转rotate,主要包括FFmpeg视频的旋转rotate使用实例、应用技巧、基本知识点总结和需要注意事项,具有一定的参考价值,需要的朋友可以参考一下。
在视频的播放时间内,将视频旋转360°
ffmpeg -i a3.mp4 -vf rotate=PI*2/T*t rotate8.mp4
rotate的第一个参数angle的单位是弧度
1°=π/180
360°=2π
例如将视频旋转90°
ffmpeg -i a3.mp4 -vf rotate=PI/2 rotate9.mp4
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.
- JavaScript 教程
- JavaScript 编辑工具
- JavaScript 与HTML
- JavaScript 与Java
- JavaScript 数据结构
- JavaScript 基本数据类型
- JavaScript 特殊数据类型
- JavaScript 运算符
- JavaScript typeof 运算符
- JavaScript 表达式
- JavaScript 类型转换
- JavaScript 基本语法
- JavaScript 注释
- Javascript 基本处理流程
- Javascript 选择结构
- Javascript if 语句
- Javascript if 语句的嵌套
- Javascript switch 语句
- Javascript 循环结构
- Javascript 循环结构实例
- Javascript 跳转语句
- Javascript 控制语句总结
- Javascript 函数介绍
- Javascript 函数的定义
- Javascript 函数调用
- Javascript 几种特殊的函数
- JavaScript 内置函数简介
- Javascript eval() 函数
- Javascript isFinite() 函数
- Javascript isNaN() 函数
- parseInt() 与 parseFloat()
- escape() 与 unescape()
- Javascript 字符串介绍
- Javascript length属性
- javascript 字符串函数
- Javascript 日期对象简介
- Javascript 日期对象用途
- Date 对象属性和方法
- Javascript 数组是什么
- Javascript 创建数组
- Javascript 数组赋值与取值
- Javascript 数组属性和方法