使用ffmpeg对输入视频进行多种裁剪操作 [英] multiple crop operations on input video using ffmpeg
本文介绍了使用ffmpeg对输入视频进行多种裁剪操作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想有效地将视频文件(2048x2048像素,100.000帧)分割成多个图块。通常,分为四个相同大小的象限(1024×1024像素,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屋!
查看全文