Question / Help Is there a way to create a floating mask?

Mumford67

New Member
Is it possible to create a moveable or resizable mask over a live video or window capture? I am cropping a section of the source video and want to be able to apply the mask to the cropped area vs to the full source image.

FWIW, I know I can use the crop filter and then apply the matte to that area, but what I am looking for is something akin to a moveable spotlight across the video.

Any suggestions are appreciated.

Many thanks,
Stuart
 
Last edited:

carlmmii

Active Member
Sadly, not using masks. Unless I'm missing something big, masks can only be applied as a direct filter using a media file... and even then, even if it's animated it will only use the first frame.

What you could possibly do is something of a cheat... bear with me.

Create a group (call this "spotlight"), add your source video in this.

In photoshop (or whatever you use), create an image that's 2.5x-3x your canvas width/height, and fill it with a specific color (magenta preferably -- #ff00ff)… in the middle of this image, cut out a transparent area the size of the spotlight you want to create.

Back in OBS, add this image into the "spotlight" group right above the source video, call it "mask".

Now add a color key filter to the "spotlight" group itself, and set it to your color used for the mask.


Basically, instead of using a direct mask via filters, you're using a movable color layer to perform the masking dynamically via the color key filter.
 

koala

Active Member
Might work. You create a source with your (static) spotlight mask and move this source around in the preview with the mouse, so you move the spotlight around. You make the source 2.5 times the size of the canvas, so you still cover the leftmost side of the canvas with the mask if you move the spotlight to the rightmost side of the canvas. Great idea @carlmmii !
Resizing the spotlight could be done by resizing the source that contains the mask.
 

Mumford67

New Member
Thank you so much...you are a lifesaver. This cheat works great. Only minor issue is a bit of magenta fringe around the mask, but since I am adding a frame on top of the mask, it won't be noticeable.
 

carlmmii

Active Member
There should be a setting to eliminate the color fringe (can't remember the name of it, but it should be the 3rd slider).
 

upgradeQ

Member
Create new scene


Add target source (e.g color source )


Add green(#00FF00) mask


Add that scene as a source to your current scene


Apply chromakey filter to that source


This is what I came up with for creating spotlight effect in my mouse script (link)
 

Highend

New Member
so, this is really great but, can we also do this wtih only 1 color mask?

i want to mask a white text source over an animated lower third, so making the text visable after the animation is done with a move filter.

Or even better, make the text only visible if there is a blue background behind that text in that group/scene.
The text is dynamicly changed so i can't put it in the pre-made animation
 
Top