做网站图片和文字字体侵权,vi设计公司排行,免费推广软件平台,html5网站后台制作案例
原始图片
# 输出帧数#xff0c;默认25帧/秒#xff0c;25*4 代表4秒
# s1280x80 # 输出视频比例#xff0c;可以设置和输入图片大小一致
# zoom0.002 表示每帧放大的倍数#xff0c;下面代码是25帧/每秒 * 4秒#xff0c;共1000帧
# 最终是 0.002*25*4 0.2…案例
原始图片
# 输出帧数默认25帧/秒25*4 代表4秒
# s1280x80 # 输出视频比例可以设置和输入图片大小一致
# zoom0.002 表示每帧放大的倍数下面代码是25帧/每秒 * 4秒共1000帧
# 最终是 0.002*25*4 0.2最终是放大1.2倍
ffmpeg -i ./sdout/1.jpg \
-filter_complex \
zoompanzzoom0.002:d25*4:s600x380 \
out.gif 只是改变Z坐标的话图片将会从左上角开始变化
也可以指定x,y,默认值是0
如果想缩放到图片右边可以指定 xiw-iw/zoom 图片的宽-缩放后的宽
如果想缩放到图片底部指定 yih-ih/zoom
如果想缩小图片需要初始化图片尺寸比如 zif(eq(on,1),1.2,zoom-0.002)
ffmpeg -i ./sdout/1.jpg \
-filter_complex \
zoompanxiw-iw/zoom:yih-ih/zoom:zif(eq(on,1),1.2,zoom-0.002):d25*4:s600x338 \
out1.gif # 如果zoom 1.0, z1.5 否则 z (1.001 和 zoom-0.0015)中大的
# 最终效果就是 从 1.5 倍数缩小到 1.001ffmpeg -i ./sdout/1.jpg \
-filter_complex \
zoompanzif(lte(zoom,1.0),1.5,max(1.001,zoom-0.0015)):d25*4:s600x380 \
out2.gif 聚焦中心点
# 聚焦到图片center中心点时长4秒
ffmpeg -i ./sdout/1.jpg \
-filter_complex \
zoompanxiw/2*(1-1/zoom):yih/2*(1-1/zoom):zzoom0.002:d25*4:s600x338 \
out3.gif# zoompan拆解
zoompanxiw/2*(1-1/zoom): # iw/2 代表要聚焦的x轴zoom 下面放大的比例yih/2*(1-1/zoom): # ih/2 代表要聚焦的y轴z2: # 聚焦放大的比例这里代表2倍d25*4: # 输出帧数默认25帧/秒25*4 代表4秒s640x360 # 输出视频比例可以设置和输入图片大小一致 参数
# 以下是命令参数
zoom, z 放大倍数1到10默认1
x,y 坐标默认0
d 总帧数默认90
s 输出图片尺寸默认hd720
fps 帧率默认25# 以下是参数里的常量
in_w, iw 输入宽
in_h, ih 输入高
out_w, ow 输出宽
out_h, oh 输出高
in 输入帧数
on 输出帧数
in_time, it The input timestamp expressed in seconds. It’s NAN if the input timestamp is unknown.
out_time, time, ot The output timestamp expressed in seconds.
x,y Last calculated ’x’ and ’y’ position from ’x’ and ’y’ expression for current input frame.
px,py ’x’ and ’y’ of last output frame of previous input frame or 0 when there was not yet such frame (first input frame).
zoom 上一帧 z 值
pzoom Last calculated zoom of last output frame of previous input frame.
duration Number of output frames for current input frame. Calculated from ’d’ expression for each input frame.
pduration number of output frames created for previous input frame
a Rational number: input width / input height
sar sample aspect ratio
dar display aspect ratio
表达式
Expression Evaluation - FFmpeg
# x,y 中取大值
max(x, y)# x y 返回 1 否则返回 0
lte(x, y) 参考
FFmpeg滤镜效果--镜头聚焦和移动走位 - 知乎
FFmpeg Filters Documentation
Ken Burns Effect Slideshows with FFMPeg | mko.re