可参考
滤镜及其效果
原素材:ffmpeg -i test.mp4 -ss 3 -t 2 output.gif
源视频
1.boxblur
- 功能:模糊处理。
- 接受参数有:
- luma_radius(lr): Radius of the luma blurring box (default "2")
- luma_power(lp):How many times should the boxblur be applied to luma (from 0 to INT_MAX) (default 2)
- chroma_radius(cr): Radius of the chroma blurring box
- chroma_power(cp):ow many times should the boxblur be applied to chroma (from -1 to INT_MAX) (default -1)
- alpha_radius:Radius of the alpha blurring box
- alpha_power:How many times should the boxblur be applied to alpha (from -1 to INT_MAX) (default -1)
另外参数值可以使用:可以使用w,h等变量表达式。
-
使用举例:
ffplay -i input.mp4 -vf boxblur=2:1:cr=0:ar=0
2. blend
blend是视频叠加,在代码中无法直接使用之前的初始化滤镜使用,查看过ffmpeg实现之后发现其实现就是历遍每个yuv值,通过两个视频帧的权重来加权叠加。