Add black (or other color) padding when doing vstack (or hstack) I am using the following filter_complex to put 2 videos of resolution 320 x 240, one right next to the other:

-filter_complex "[v1][v2]hstack=inputs=2[videoout]"


This works great, but now I was wondering how could I do it, so that I could add a small padding between them. Let's say for instance 5 black pixels (even though I would love to be able to customize the color or at least the distance).

How could I do that?
First, setup a color filter of the same height, and then add it to the hstack

-filter_complex "color=black:5x240[c];[v1][c][v2]hstack=inputs=3:shortest=1[videoout]"


See the options for the color filter here.



Alternate method is

-filter_complex "[0]pad=iw+5:ih:color=black[0v];[0v][v2]hstack[videoout]"