Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 6th October 2013, 09:09   #1  |  Link
Forensic
Registered User
 
Join Date: Apr 2008
Location: California, USA
Posts: 129
Trouble with Overlay masking script

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?

Code:
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.
Forensic is offline   Reply With Quote
Old 6th October 2013, 10:31   #2  |  Link
Gavino
Avisynth language lover
 
Join Date: Dec 2007
Location: Spain
Posts: 3,380
Code:
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)
__________________
GScript and GRunT - complex Avisynth scripting made easier
Gavino is offline   Reply With Quote
Old 7th October 2013, 05:37   #3  |  Link
Forensic
Registered User
 
Join Date: Apr 2008
Location: California, USA
Posts: 129
Wow

Resetmask was the solution (and I had never heard of it).
Forensic is offline   Reply With Quote
Reply

Tags
mask, opacity, overlay, script, showalpha

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 12:58.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.