0

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 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?

crackerbear
  • 148
  • 1
  • 1
  • 7
  • 1
    You say "which somewhat does what I want" but you do not say what it does and what is missing. Have you tried adding cropping to your lavfi parameters? – bugmenot123 Jun 03 '20 at 19:48

1 Answers1

1

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.

llogan
  • 121,796
  • 28
  • 232
  • 243