使用 ffmpeg 对输入视频进行多次裁剪操作 [英] multiple crop operations on input video using ffmpeg

查看:23
本文介绍了使用 ffmpeg 对输入视频进行多次裁剪操作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想有效地将​​视频文件(2048x2048px,100.000 帧)拆分为多个图块.通常,分成四个相同大小的象限(1024x1024px,100.000 帧).我可以使用 ffmpeg 的裁剪过滤器一个接一个地移动:

I would like to efficiently split a video file (2048x2048px, 100.000 frames) into multiple tiles. Typically, into four quadrants of equal size (1024x1024px, 100.000 frames). I can go one tile after the other using ffmpeg's crop filter:

ffmpeg -i in.avi -filter:v "crop=1024:1024:0:0" out1.mp4
ffmpeg -i in.avi -filter:v "crop=1024:1024:1023:0" out2.mp4

等等...

可以将其合并为一个命令以提高执行速度吗?

can this be combined into a single command to increase execution speed?

推荐答案

使用单个输入,裁剪然后映射到多个输出.两个图块的示例:

Use a single input, crop then map to multiple outputs. Example for two tiles:

ffmpeg -i in.avi -filter_complex 
"[0:v]crop=1024:1024:0:0[out1];[0:v]crop=1024:1024:1023:0[out2]" 
-map [out1] -map 0:a out1.mp4 
-map [out2] -map 0:a out2.mp4

这篇关于使用 ffmpeg 对输入视频进行多次裁剪操作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆