MPV (FFmpeg) 堆叠 2 个视频然后在不重新编码的情况下裁剪输出?
MPV (FFmpeg) stack 2 videos and then crop output without re-encoding?
我有两个 16:9 比例的视频,我想水平堆叠它们,然后在 mpv 中播放时将生成的视频输出从右边界裁剪约 900 像素,无需重新编码。
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)
我目前有这个可以满足我的要求:
mpv "F:.mp4" --external-file="F:.mp4" --lavfi-complex="[vid1] scale=1920x1080:flags=spline [vid1_scale]; [vid2] scale=1920x1080:flags=spline [vid2_scale]; [vid1_scale][vid2_scale] hstack [vo]"
是否可以在叠加后裁剪视频输出?
在 hstack 之后立即添加裁剪:
mpv "F:.mp4" --external-file="F:.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]"
或者在其中一个尺度之后立即裁剪。没关系。
我有两个 16:9 比例的视频,我想水平堆叠它们,然后在 mpv 中播放时将生成的视频输出从右边界裁剪约 900 像素,无需重新编码。
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)
我目前有这个可以满足我的要求:
mpv "F:.mp4" --external-file="F:.mp4" --lavfi-complex="[vid1] scale=1920x1080:flags=spline [vid1_scale]; [vid2] scale=1920x1080:flags=spline [vid2_scale]; [vid1_scale][vid2_scale] hstack [vo]"
是否可以在叠加后裁剪视频输出?
在 hstack 之后立即添加裁剪:
mpv "F:.mp4" --external-file="F:.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]"
或者在其中一个尺度之后立即裁剪。没关系。