Body: <p>I have a png and would like to add there video, so png is my case is something like a border.</p>
  <p>I trying :</p>
  <pre><code>ffmpeg -i cat.mp4 -framerate 30 -i dem.png -filter_complex &quot;[0]pad=1920:1080:500:0[vid];[vid][1]overlay&quot; -c:a copy -movflags +faststart out2.mp4
  </code></pre>
  <p>But png is not a transparent and video hiding behind the picture. How can i set order or &quot;z-index&quot; position of the video to see it OVER the image?</p>
  <p><a href="https://i.sstatic.net/qheSl.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/qheSl.png" alt="enter image description here" /></a></p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-07-28T04:11:25.417Z
Comments.Text: Change `[vid][1]` to `[1][vid]`
Comments.UserDisplayName: Gyan
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-07-28T07:39:24.383Z
Comments.Text: @Gyan, in this case - png is not shown : https://c2n.me/4gfPjBc.png
Comments.UserDisplayName: Nigrimmist
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-07-28T10:10:55.353Z
Comments.Text: Likely because your png is smaller than the video. Pad the image, not the video, OR downscale the video.
Comments.UserDisplayName: Gyan
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-07-28T13:56:09.043Z
Comments.Text: @Gyan, png size is 600x554, mp4 is 148x114. I uploaded my files in case you would like to check them... https://drive.google.com/drive/folders/1gKJCyVU0IgJ8g3zWFhCA-L93lDOWyOS-?usp=sharing
Comments.UserDisplayName: Nigrimmist
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-07-28T17:27:43.667Z
Comments.Text: `-i cat.mp4 -framerate 30 -i dem.png -filter_complex "[1][0]overlay=x=W*.27:y=H*.58" -c:a copy -movflags +faststart out2.mp4`
Comments.UserDisplayName: Gyan
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-07-29T10:18:23.497Z
Comments.Text: @Gyan oh, man! thank you a lot! so magic :)
Comments.UserDisplayName: Nigrimmist
Tags: <ffmpeg>
Title: Add video in front of image (background) using ffmpeg?
UserDisplayName: Nigrimmist
ThreadText: # Add video in front of image (background) using ffmpeg?
  
  (Asked by: username_0 on 2022-07-27)
  
  I have a png and would like to add there video, so png is my case is something like a border.
  
  I trying :
  
  ```
  ffmpeg -i cat.mp4 -framerate 30 -i dem.png -filter_complex "[0]pad=1920:1080:500:0[vid];[vid][1]overlay" -c:a copy -movflags +faststart out2.mp4
  
  ```
  
  But png is not a transparent and video hiding behind the picture. How can i set order or "z-index" position of the video to see it OVER the image?
  
  [![enter image description here](https://i.sstatic.net/qheSl.png)](https://i.sstatic.net/qheSl.png)
  
  **Tags:** ffmpeg
  
  > **Comments:**
  > **username_1**: Change `[vid][1]` to `[1][vid]`  
  > **username_0**: @username_1, in this case - png is not shown : https://c2n.me/4gfPjBc.png  
  > **username_1**: Likely because your png is smaller than the video. Pad the image, not the video, OR downscale the video.  
  > **username_0**: @username_1, png size is 600x554, mp4 is 148x114. I uploaded my files in case you would like to check them... https://drive.google.com/drive/folders/1gKJCyVU0IgJ8g3zWFhCA-L93lDOWyOS-?usp=sharing  
  > **username_1**: `-i cat.mp4 -framerate 30 -i dem.png -filter_complex "[1][0]overlay=x=W*.27:y=H*.58" -c:a copy -movflags +faststart out2.mp4`  
  > **username_0**: @username_1 oh, man! thank you a lot! so magic :)  
  
  ---
  
  ## 0 answers
  
  