做网站哪家好哪家好,网站免费优化平台,理财网站建设方案书,网站结构如何优化滤镜简述
crop官网链接 FFmpeg Filters Documentation
crop滤镜可以对视频进行裁剪#xff0c;并且这个滤镜可以接受一些变量比如时间和帧数#xff0c;这样我们实现动态裁剪#xff0c;从而实现一些特效。
滤镜使用
参数 out_w string ..…滤镜简述
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_win_hiwih输入图片的宽和高。iw和ih是in_w和in_h的缩写。out_wout_howoh输出图片的宽和高。ow和oh是out_w和out_h的缩写。aiw / ihn第几帧t视频的第几秒
案例
原图 ffmpeg -y -i ffm_media/air.jpg -filter_complex crop100:100:12:34 result/crop/crop_test_01.jpg
从图片的12,34位置开始裁剪图片裁剪后的图片是100*100 ffmpeg -y -i ffm_media/air.jpg -filter_complex cropout_win_h result/crop/crop_test_03.jpg
从图片的中心位置开始裁剪获取剩余的全部相当于将图片分为四份获取右下角部分 ffmpeg -y -i ffm_media/short_dancer.mp4 -filter_complex cropin_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 cropin_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)