The Corner Pin effect in Adobe After Effects

Masking the image

We can use the matte image to mask out the video and constrain it to the
billboard image. The technique involved relies on the matte image being placed
above the video track in the timeline.

After ensuring that this is the case, click the Switches / Modes
button.

The timeline display changes, allowing you to select Luma as the
video's matte type.

Luminance is the correct choice for qualityenglish.bmp because it
is a greyscale representation of a mask. You could choose Alpha if your matte
image had an alpha channel.

The video clip now displays masked correctly in the work area:

Rendering the movie

The final step is to render the movie by selecting Make Movie
from the Composition menu. As you can see from the screenshot below,
there's no need to select any special settings. Just render as you normally
do.