moviepy icon indicating copy to clipboard operation
moviepy copied to clipboard

I can't use Mask. Trying using 1 Image.png + 1 Video.mp4

Open webcrawlerBR opened this issue 2 years ago • 2 comments

I can't render video using a image mask, can anyone help me out with this

The error raised is: ValueError: operands could not be broadcast together with shapes (850,850,3) (850,850)

It seems is about alpha channel, but i don't know how to solve it

Image I'm using: https://ibb.co/LYQJNcX Video I`m using: https://we.tl/t-stEzMAwGgI

See my code below

image_mask = ImageClip('images/circle-mask.png', ismask=True) videoclip = VideoFileClip('videos/beach.mp4').set_mask(image_mask).resize(image_mask.size)

video = CompositeVideoClip(
    [
        videoclip,
        image_mask
    ],
    size=image_mask.size). \
    set_duration(5)`

webcrawlerBR avatar Aug 10 '22 15:08 webcrawlerBR

Have you tried using a normal black and white image instead? Usually just using a simple black and white image/video works fine for me.

stephan352 avatar Aug 12 '22 02:08 stephan352

OP, please always follow the issue template because info on OS and MoviePy version used is often relevant to trying to debug issues.

keikoro avatar Aug 18 '22 16:08 keikoro