How to add Photos in background to a Video using FFMPEG I saw one app and I'm willing to add photos similar to how that app does.

Following is the screenshot of the video that I got from that app:

I'm not sure what is the black part in there on the right-hand side.

Below is the end result after a photo has been added:

Now the photo that I've added seems like it's behind the video, so any help how to do that and an answer to what the black part the right side of the video is, then it will be great and highly appreciated.
I'm going to call the video/image on top, overlay, and the bottom one, the photo.

ffmpeg -i photo -i overlay
       -filter_complex "[1]split=2[color][alpha];
                        [color]crop=iw/2:ih:0:0[color];[alpha]crop=iw/2:ih:iw/2:0[alpha];
                        [color][alpha]alphamerge[ovrly];
                        [0][ovrly]overlay=0:0" output.jpg


I assume that if the resolution of the video is WxH then the resolution of the photo is W/2 X H. If it's not, add a crop filter to the photo and then use that result in the overlay.

If the resulting video has uneven dimensions, add a scale filter after the overlay to rectify that: [0][ovrly]overlay=0:0,scale=2*trunc(iw/2):2*trunc(ih/2)



If you have a sequence of images of the same resolution, then you can use the concat demuxer.

First, create a text file,

file 'image1'
duration 2.0
file 'image2'
duration 4.0
file 'image3'
duration 2.0


Then,

ffmpeg -f concat -i text -i overlay
       -filter_complex "[0]fps=25[bg];
                        [1]split=2[color][alpha];
                        [color]crop=iw/2:ih:0:0[color];[alpha]crop=iw/2:ih:iw/2:0[alpha];
                        [color][alpha]alphamerge[ovrly];
                        [bg][ovrly]overlay=0:0,scale=2*trunc(iw/2):2*trunc(ih/2)" output.jpg