<p>The basic form will be</p>

<pre><code>ffmpeg -i video.mp4 -i image.png -filter_complex "[1:v]scale=320:-1[top];[top][0:v]vstack" output.mp4
</code></pre>

<p>A label of the form <code>1:v</code>, equivalent to <code>1:v:0</code> within filters, is a stream specifier - it means use the first video stream of the 2nd input. <code>0:v</code> refers to the first video stream of the first input.</p>

<p>The <code>bottom</code> in your command and <code>top</code> in mine are arbitrary labels assigned to the result of the scale filter.</p>

<p>Then that resulting stream is fed first to the vstack so that it gets stacked on top.</p>

CC BY-SA 4.0
2018-09-15T15:53:32.567Z
Thank you for the quick response! Now looking at it it seems so clear but you have no idea how many different orderings of the first command that I tried to no avail!
Stephen Johnston
CC BY-SA 4.0
2018-09-15T15:40:09.477Z
2018-09-15T15:40:09.477Z
Gyan
<p>Apologies for being a ffmpeg noob, but I'm having trouble with modifying the answer to </p>

<p><a href="https://video.stackexchange.com/questions/14519/add-image-under-the-video-with-ffmepg/14532#14532?newreg=4a36ee24267d464390a1582c3b5f3221">Add image under the video with ffmepg</a> </p>

<p>to place the image above instead of below the video... </p>

<p>My questions is in regard to modifying the command </p>

<pre><code>ffmpeg -i video.mp4 -i image.png -filter_complex "[1:v]scale=320:-1[bottom];[0:v][bottom]vstack" output.mp4
</code></pre>

<p>I tried many different variations of this command to no avail and I think its my misunderstand of filter_complex and the meaning of "[1:v]" "[bottom]" and "[0:v]"</p>

<p>Thanks in advance for your help!</p>

<ffmpeg>
Add image above the video with ffmepg
Stephen Johnston
# Add image above the video with ffmepg

(Asked by: username_0 on 2018-09-15)

Apologies for being a ffmpeg noob, but I'm having trouble with modifying the answer to 
Add image under the video with ffmepg 
to place the image above instead of below the video... 
My questions is in regard to modifying the command 
ffmpeg -i video.mp4 -i image.png -filter_complex "[1:v]scale=320:-1[bottom];[0:v][bottom]vstack" output.mp4

I tried many different variations of this command to no avail and I think its my misunderstand of filter_complex and the meaning of "[1:v]" "[bottom]" and "[0:v]"
Thanks in advance for your help!

**Tags:** ffmpeg


---

## 1 answers

### Answer by username_1 on 2018-09-15. Score: 0 | Accepted answer

The basic form will be
ffmpeg -i video.mp4 -i image.png -filter_complex "[1:v]scale=320:-1[top];[top][0:v]vstack" output.mp4

A label of the form 1:v, equivalent to 1:v:0 within filters, is a stream specifier - it means use the first video stream of the 2nd input. 0:v refers to the first video stream of the first input.
The bottom in your command and top in mine are arbitrary labels assigned to the result of the scale filter.
Then that resulting stream is fed first to the vstack so that it gets stacked on top.

> **Comments:**
> **username_0**: Thank you for the quick response! Now looking at it it seems so clear but you have no idea how many different orderings of the first command that I tried to no avail!  

---

