Masked video over another video

Hi,

I’d like overlay a video with a masked version of another video (no animation required). It works if I use the presets like rectangle or a circle, but I cannot find a way to use a customised mask (PNG) for this purpose.

What I did so far is the following:

  1. Load the original and complex EPS vector graphic into Inkscape, ungroup and delete everything I don’t want;

  2. Export the selection of the remaining vector elements as a PNG;

  3. Load the PNG into GIMP and create a shape, the shape itself (an ox head) being transparent and the rest in black;

  4. This works fine for creating a mask for one track (see screenshot). However, if I want to use the mask or the masked video inside another video with both videos being visible, I couldn’t find a way to do so.

Am I missing something or is that currently impossible with Shotcut?

Thanks in advance for any helpful answers.

Add the Mask: From File filter.
Choose File > Custom (inside the filter UI).
Pick your PNG.
Click Channel > Alpha (inside the filter UI).

2 Likes

Thanks a lot! Problem solved. I somehow missed the “Custom…” option.

It’d be great to be able to freely resize the mask in a future version.

Already there using Mask: Draw. That opens a new window with drawing and animation tools. You can import an image into that drawing and resize it.

Thanks again for the quick answer.

However, that doesn’t seem to solve my problem, because in Glaxnimate the image dimensions are displayed correctly. But when I use the PNG as a mask, it gets distorted to the dimensions of the video.

I can work around this by creating a appropriately dimensioned PNG file in Inkscape and GIMP, but it would be great to have an on-screen option to adjust the mask.

I have attached a screenshot of the result, another one on how it’s supposed to look as well as the mask file.



Addition: I know that I can resize the track inside the mask to get the correct dimensions, but that seems to be a bit complicated.

Again: on-screen resizing of the mask would be a great addition, but I know how to get what I need for now.

Your screenshots do not show Mask: Draw.

I can work around this by creating a appropriately dimensioned PNG file in Inkscape and GIMP

This is what Glaxnimate provides. And when you start within Shotcut’s Mask: Draw filter, it creates the drawing size the same resolution as your project.

it would be great to have an on-screen option to adjust the mask

The Glaxnimate integration provides that.

Look

Click New in the filter’s UI. Glaxnimate opens with an empty drawing and Shotcut’s video in the background:

I import your image, adjust the size and position, but your PNG has no transparency. I was assuming it would since you wrote that in the beginning:

the shape itself (an ox head) being transparent

Yeah, if you only want to work in black and white, Mask: Draw will not work for that since it is driven by the alpha channel. I will fix your PNG to have an alpha channel and show you

And now how it shows in Shotcut:

That is an image on an upper video track with transparency added. And here I thought you were asking about “Mask video over another video”

Here is the simple way I did your what I think you wanted with your original image:

And here is an example of using Glaxnimate to size and position it. I use Open Other > Animation with a black background. Glaxnimate opens and I add the image and adjust it. Here is after I added it to the timeline and reopen it from Properties where I can see the Shotcut video in Glaxnimate’s background:

Then, the Mask: Chroma Key video filter like previous:

1 Like

Yet another way without Glaxnimate is 2 filters:

  • Size, Position & Rotate
  • Mask: Chroma Key

Question: Why did you delete your previous last reply?

I actually try to use a custom mask for video over video. I only added the third screenshot to show how the mask is supposed to look, and in that case I used an image over a video.

Here’s a screenshot that shows the oxhead in Glaxnimate, and as you can see, it’s exactly where it’s supposed to be.

Oh, and for the last screenshot I used a PNG where the white has been converted to alpha.

I used Inkscape and GIMP to solve the issue, because the Glaxnimate way is a bit too tedious for my taste and this particular task, where I need the mask to be in a reliable and fixed position. However, I found that Glaxnimate is extremely useful for other tasks.

Thanks again for your help!

This topic was automatically closed after 90 days. New replies are no longer allowed.