In After Effects, Hitfilm or any other video editing program there is so called Set Matte filter. You can apply Set Matte to all kind of things videos, images. Once you apply it on one thing (inside effects options) you must specify what is “Matte” for that first thing. Imagine for example we have some video footage, and one image. Image can look like this:
and video on which we are applying Set Matte filter originally look like this (this is just his first frame).
As said, this could easily be an image instead of video.
I will explain how to set filter in Hitfilm but something similar apply to After Effects and other video editing programs. I added this two things to composite shot – image with circle and beach video. I don’t want that image is visible in the first place so I disable it’s visibility. The reason why we have this image in the composite shot is only because when we want to apply Set Matte effect this image will be offered to be Source Layer for Matte effect.
Final result look like this:
There is also another option Matte Source. I set it to Luminance. What it does in this example is that wherever was white background on original image with circle, beach is visible. On places where was dark gray color (center circle) beach is almost invisible.
Set Matte pulls a matte from the unmodified source of the layer you specify. This means any masks, effects or transformations you apply to the desired source layer will be ignored unless you precompose all that stuff inside another comp.
In some way, in this example, by using Set Matte filter we achieved same thing as we would using mask. But, unlike mask we can add all sort of things to image that serves as Matte, like animate it. However, to able to do that it is neccessary to make another composite shot that contains that image with applied effects and then that newly created composite shot will be Source Layer for Set Matte effect of the original video. This is what I mean:
After we are done with adding effects to circle-image we can add this composite shot -named Composite Shot 2 to the original beach video:
Final animation looks like this: