0

i have a difficult situation. i need to make an app with moviepy that add image overlay on the video such as lower 3rd or logo.

in every tutorial and articles only show how to add text over video. not image.

i use composite video but its not give alpha channel as mask only outside the imageclip is transparent.

enter image description here

the result is always give me white color in the middle of image. the image file is png with alpha but

def mp_overlay():
    video = VideoFileClip("videoEditingCaches/process2.mp4")

    logo = (ImageClip("242-2420130_davidandcecil-photo-booth-picture-frame.png", transparent=True).set_duration(video.duration).resize(height=video.w).rotate(90))          
    
    # logo = (ImageClip("242-2420130_davidandcecil-photo-booth-picture-frame.png", transparent=True)
    #       .set_duration(video.duration)
    #       .resize(height=video.w)
    #       .rotate(90) # if you need to resize...
        
    #       .set_pos(("right","top")))
   
    video = video.add_mask()

    final = CompositeVideoClip([video, logo.set_position("center")], use_bgclip=True)
    final.write_videofile("videoEditingCaches/process3.mp4", preset="ultrafast")

when i add is mask = true, the error is showing up


def mp_overlay():
    video = VideoFileClip("videoEditingCaches/process2.mp4")

    logo = (ImageClip("242-2420130_davidandcecil-photo-booth-picture-frame.png", transparent=True).set_duration(video.duration).resize(height=video.w).rotate(90))          
    
    # logo = (ImageClip("242-2420130_davidandcecil-photo-booth-picture-frame.png", is_mask = True, transparent=True)
    #       .set_duration(video.duration)
    #       .resize(height=video.w)
    #       .rotate(90) # if you need to resize...
        
    #       .set_pos(("right","top")))
   
    video = video.add_mask()

    final = CompositeVideoClip([video, logo.set_position("center")], use_bgclip=True)
    final.write_videofile("videoEditingCaches/process3.mp4", preset="ultrafast")

please help

0 Answers0