I am attempting to add an image behind a video using moviepy and cannot come up with any way to do it. My image dimension is (1080 x 720) and my video dimension is (200 x 200). I am trying to put the video file on top of the image file, place it in the midlle and export the final video with the dimensions of the image. This is a visual representation of what I am trying to achieve:
I tried doing this with the following code, but could not manage to get it to work. Any help is seriously appreciated :)
import moviepy
import moviepy.editor as mp
video = mp.VideoFileClip("/media/pi/vid.mp4")
logo = (mp.ImageClip("/media/pi/pic.png"))
# Preferably I would want the image to be the same duration as the video file.
# The following was just for testing.
final = mp.CompositeVideoClip([video, logo.set_duration(3)])
final.write_videofile("test.mp4")