moviepy
moviepy copied to clipboard
I can't use Mask. Trying using 1 Image.png + 1 Video.mp4
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)`
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.
OP, please always follow the issue template because info on OS and MoviePy version used is often relevant to trying to debug issues.