Log in

View Full Version : Trouble with Overlay masking script


Forensic
6th October 2013, 09:09
I want a circular section of "secondVideo" to replace the pixels of "firstVideo". Both videos are RGB32 and of the same size, speed and length. The mask is a white circle on a black background and has a 100 pixel diameter (which is smaller than the videos). Any advice as to what I am doing wrong?


maskimage = ImageSource("circle.png").ConvertToRGB32
maskVideo = firstVideo.blankclip.layer(maskimage, x=100, y=100) #to make the mask match the videos
Overlay(firstVideo, secondVideo, mask=ShowAlpha(maskVideo), y=100, x=100, mode="blend", opacity=1)


Note: the above is a simplified version of what I actually need but, if I get this to work, I can figure the rest out. Thank you.

Gavino
6th October 2013, 10:31
maskimage = ImageSource("circle.png").ConvertToRGB32.ResetMask()
maskVideo = firstVideo.blankclip.layer(maskimage, x=100, y=100) #to make the mask match the videos
Layer(firstVideo, secondVideo.Mask(maskVideo))
# could also use:
# Overlay(firstVideo, secondVideo, mask=maskVideo)

Forensic
7th October 2013, 05:37
Resetmask was the solution (and I had never heard of it). :thanks: