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

user23994: There is a way to achieve this result that may be more relevant to your interests:
Problem: Resize videos centering them in the middle of a pre-determined rectangle, letterboxing if needed. 
Answer: https://superuser.com/questions/547296/resizing-videos-with-ffmpeg-avconv-to-fit-into-static-sized-player
The key line from the answer:
ffmpeg -i input -vf "scale=1280:720:force_original_aspect_ratio=decrease,pad=1280:720:(ow-iw)/2:(oh-ih)/2" output


user1871: 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]"


14592: <p>I am using the following <code>filter_complex</code> to put 2 videos of resolution <code>320 x 240</code>, one right next to the other:</p>

<pre><code>-filter_complex "[v1][v2]hstack=inputs=2[videoout]"
</code></pre>

<p>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).</p>

<p>How could I do that?</p>
 23994: <p>There is a way to achieve this result that may be more relevant to your interests:</p>

<p><strong>Problem</strong>: Resize videos centering them in the middle of a pre-determined rectangle, letterboxing if needed. </p>

<p><strong>Answer</strong>: <a href="https://superuser.com/questions/547296/resizing-videos-with-ffmpeg-avconv-to-fit-into-static-sized-player">https://superuser.com/questions/547296/resizing-videos-with-ffmpeg-avconv-to-fit-into-static-sized-player</a></p>

<p>The key line from the answer:</p>

<pre><code>ffmpeg -i input -vf "scale=1280:720:force_original_aspect_ratio=decrease,pad=1280:720:(ow-iw)/2:(oh-ih)/2" output
</code></pre>
 1871: <p>First, setup a color filter of the same height, and then add it to the hstack</p>

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

<p>See the options for the color filter <a href="https://ffmpeg.org/ffmpeg-utils.html#Color" rel="nofollow">here</a>.</p>

<hr>

<p>Alternate method is</p>

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