I want to combine two videos using hstack in ffmpeg. The problem is that the two videos have different heights. And the heights can vary as the sources are dynamic. So how can I equalise the video heights to the maximum height of them and hstack them.
You'll need to run the scale2ref
filter twice.
Basic template is
ffmpeg -i in1 -i in2 -filter_complex
"[0][1]scale2ref='oh*mdar':'if(lt(main_h,ih),ih,main_h)'[0s][1s];
[1s][0s]scale2ref='oh*mdar':'if(lt(main_h,ih),ih,main_h)'[1s][0s];
[0s][1s]hstack,setsar=1" output
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With