MPV(FFmpeg)堆叠2个视频,然后裁剪输出而无需重新编码? [英] MPV (FFmpeg) stack 2 videos and then crop output without re-encoding?

查看:105
本文介绍了MPV(FFmpeg)堆叠2个视频,然后裁剪输出而无需重新编码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个16:9比例的视频,我想将它们水平堆叠,然后在mpv内播放该视频的同时,从右边框裁剪出约900px的结果视频输出,而无需重新编码.

I have two 16:9 ratio videos, I want to horizontally stack them, but then crop the resulting video output by about 900px from the right border whilst playing it within mpv and without re-encoding.

Libavfilter 确实具有裁剪功能,但在所有我要实现的目标的直观表示形式)

Libavfilter does have a crop functionality, but in all examples I've found, the cropping happens before stacking. (Visual representation of what I want to achieve)

我目前有这个功能,可以满足我的要求

I currently have this which somewhat does what I want:

mpv "F:\1.mp4" --external-file="F:\2.mp4" --lavfi-complex="[vid1] scale=1920x1080:flags=spline [vid1_scale]; [vid2] scale=1920x1080:flags=spline [vid2_scale]; [vid1_scale][vid2_scale] hstack [vo]"

堆叠后是否可以裁剪视频输出?

Is it possible to crop the video output after stacking?

推荐答案

在hstack之后立即添加农作物:

Add crop immediately after hstack:

mpv "F:\1.mp4" --external-file="F:\2.mp4" --lavfi-complex="[vid1] scale=1920x1080:flags=spline [vid1_scale]; [vid2] scale=1920x1080:flags=spline [vid2_scale]; [vid1_scale][vid2_scale] hstack,crop=iw-900:ih:0:0 [vo]"

或在其中一个秤后立即种植.没关系.

Or crop immediately after one of the scales. Doesn't really matter.

这篇关于MPV(FFmpeg)堆叠2个视频,然后裁剪输出而无需重新编码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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