<p>The stack filters don't insert any padding. Your videos probably have empty space in them. You'll need the crop filter to remove the dead space.</p>

<p>The stack filters require the video edge along the join axis to have the same dimensions i.e. height for hstack and width for vstack. So, don't crop those aspects.</p>

CC BY-SA 3.0
2017-05-14T05:55:48.510Z
2017-05-14T05:55:48.510Z
Gyan
<p>The hstack feature works great, but it pads the videos. That is, it puts black space between them. I use a command like this:</p>

<pre><code>ffmpeg -i 1.mp4 -i 2.mp4  -filter_complex "hstack" out.mp4
</code></pre>

<p>How do I remove the black space separating the component videos?</p>

<p>Perhaps related, how do I control the size of the output video? If I could change the width of the output video, I imagine that would make the padding go away. But I couldn't find a way to combine the <code>scale=</code> parameter with hstack.</p>

CC BY-SA 3.0
2017-05-10T04:56:32.130Z
The stack filters don't insert any padding. Your videos probably have empty space in them. You'll need the crop filter. Show the full console output of your command.
Gyan
CC BY-SA 3.0
2017-05-10T16:46:05.003Z
Yes, you're right.  I missed that. Dumb of me. If you put your comment as an answer, I'll accept it. Thanks.
Bob Woodley
<ffmpeg>
Stack videos with ffmpeg without padding
Bob Woodley
# Stack videos with ffmpeg without padding

(Asked by: username_0 on 2017-05-10)

The hstack feature works great, but it pads the videos. That is, it puts black space between them. I use a command like this:
ffmpeg -i 1.mp4 -i 2.mp4  -filter_complex "hstack" out.mp4

How do I remove the black space separating the component videos?
Perhaps related, how do I control the size of the output video? If I could change the width of the output video, I imagine that would make the padding go away. But I couldn't find a way to combine the scale= parameter with hstack.

**Tags:** ffmpeg

> **Comments:**
> **username_1**: The stack filters don't insert any padding. Your videos probably have empty space in them. You'll need the crop filter. Show the full console output of your command.  
> **username_0**: Yes, you're right.  I missed that. Dumb of me. If you put your comment as an answer, I'll accept it. Thanks.  

---

## 1 answers

### Answer by username_1 on 2017-05-14. Score: 2 | Accepted answer

The stack filters don't insert any padding. Your videos probably have empty space in them. You'll need the crop filter to remove the dead space.

The stack filters require the video edge along the join axis to have the same dimensions i.e. height for hstack and width for vstack. So, don't crop those aspects.


---

