命令将视频水平或垂直切成两半,然后再重新加入 [英] Commands to cut videos in half horizontally or vertically, and rejoin them later

查看:54
本文介绍了命令将视频水平或垂直切成两半,然后再重新加入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用ffmpeg将视频按分辨率垂直或水平切成两半;因此,对于640 x 480的视频,我想将其分成分辨率为320 x 480的两半,或者将其水平分成640 x 240的两半;之后,我需要能够再次加入分开的视频,以制作具有原始分辨率的单个视频.该怎么办?

How can I use ffmpeg to cut video in half, vertically or horizontally by resolution; so for a 640 x 480 video, I want to separate that into two halves with a resolution of 320 x 480, or to separate it into two halves horizontally with a resolution of 640 x 240; and afterward, I need to be able to join the separated videos again to make a single video with the original resolution. How can this be done?

推荐答案

分成两半

使用作物过滤器:

ffmpeg -i input -filter_complex "[0]crop=iw:ih/2:0:0[top];[0]crop=iw:ih/2:0:oh[bottom]" -map "[top]" top.mp4 -map "[bottom]" bottom.mp4

垂直

ffmpeg -i input -filter_complex "[0]crop=iw/2:ih:0:0[left];[0]crop=iw/2:ih:ow:0[right]" -map "[left]" left.mp4 -map "[right]" right.mp4

加入分开的视频

使用使用ffmpeg垂直或水平堆叠多个视频的vstack/hstack过滤器?

这篇关于命令将视频水平或垂直切成两半,然后再重新加入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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