当前位置: 首页> 汽车> 时评 > 网络设计网站_河北疫情第二波最新消息_外贸新手怎样用谷歌找客户_seo优化方案报价

网络设计网站_河北疫情第二波最新消息_外贸新手怎样用谷歌找客户_seo优化方案报价

时间:2025/7/12 9:36:56来源:https://blog.csdn.net/u014686399/article/details/143212662 浏览次数: 0次
网络设计网站_河北疫情第二波最新消息_外贸新手怎样用谷歌找客户_seo优化方案报价

滤镜简述

crop

官网链接 => FFmpeg Filters Documentation

crop滤镜可以对视频进行裁剪,并且这个滤镜可以接受一些变量比如时间和帧数,这样我们实现动态裁剪,从而实现一些特效。

滤镜使用

参数
out_w             <string>     ..FV.....T. set the width crop area expression (default "iw")w                 <string>     ..FV.....T. set the width crop area expression (default "iw")out_h             <string>     ..FV.....T. set the height crop area expression (default "ih")h                 <string>     ..FV.....T. set the height crop area expression (default "ih")x                 <string>     ..FV.....T. set the x crop area expression (default "(in_w-out_w)/2")y                 <string>     ..FV.....T. set the y crop area expression (default "(in_h-out_h)/2")keep_aspect       <boolean>    ..FV....... keep aspect ratio (default false)exact             <boolean>    ..FV....... do exact cropping (default false)
  • out_w 和 out_h 这两个参数是要裁剪的宽度和高度. w和h是这两个参数的别名。
  • x和y 是开始裁剪的位置
  • keep_aspect:等比例裁剪,要保持图片的原比例
  • exact:这个参数理解太清楚,按照翻译是精确裁剪的意思,不使用近似值进行裁剪。
可以接受的常量
in_w,in_h,iw,ih输入图片的宽和高。iw和ih是in_w和in_h的缩写。
out_w,out_h,ow,oh输出图片的宽和高。ow和oh是out_w和out_h的缩写。
aiw / ih
n第几帧
t视频的第几秒
案例

原图

ffmpeg -y -i ffm_media/air.jpg -filter_complex "crop=100:100:12:34"  result/crop/crop_test_01.jpg

从图片的(12,34)位置开始裁剪图片,裁剪后的图片是100*100

ffmpeg -y -i ffm_media/air.jpg -filter_complex "crop=out_w=in_h"  result/crop/crop_test_03.jpg

从图片的中心位置开始裁剪,获取剩余的全部,相当于将图片分为四份,获取右下角部分

ffmpeg -y -i ffm_media/short_dancer.mp4 -filter_complex "crop=in_w/2:in_h/2:(in_w-out_w)/2+((in_w-out_w)/2)*sin(n/10):(in_h-out_h)/2 +((in_h-out_h)/2)*sin(n/7)"  result/crop/crop_test_06.mp4

基于帧数,使用运镜特效,大家可以找个视频试试,这里上传视频不太方便,也可以进群找我要一下啊。

ffmpeg -y -i ffm_media/short_dancer.mp4 -filter_complex "crop=in_w/2:in_h/2:(in_w-out_w)/2+((in_w-out_w)/2)*sin(t*10):(in_h-out_h)/2 +((in_h-out_h)/2)*sin(t*13)"  result/crop/crop_test_07.mp4

基于时间戳,使用运镜特效,大家可以找个视频试试,这里上传视频不太方便。

## 祝你好运hope("大神多多指点")
topic("有问题可以交流呀")
concat("求求QUN", "61480", "9646")

关键字:网络设计网站_河北疫情第二波最新消息_外贸新手怎样用谷歌找客户_seo优化方案报价

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

责任编辑: