Adding an animation behind an object in your video can give it that extra character in an otherwise static scene. To achieve this snazzy look, you need to mask out the object from your video, and then you can add in graphics or words behind it.

Today we’ll intro you into basic masking (or rotoscoping), using the pen tool and animating a path. 

Let’s get started. 

How to mask in After Effects

For this very basic overview, we will be masking the beautiful Vimeo HQ building as it has a unique shape that will require us to use curves. 

Step 1:

Load your video into the project area and then drag and add it to your timeline.

 Step 2:

Now, add an adjustment layer above your video on your timeline. Go to Layer > New > Adjustment Layer.

Pro-tip: Name this layer “Mask.” Do this instead of masking directly onto your video. This is an ultra-secure method of saving your work. That way you’ll always have your original video file unharmed if something goes wrong.

Step 3:

Now, move your play head to the first frame in your timeline. Click on your Adjustment Layer.

Step 4:

On the top left corner of the screen, click on the pen icon. Click and drag your pen tool to begin outlining the object you want to mask out. Take your time to get your lines just right and make sure you close the path. Do this by connecting back to the first node you made. The mask won’t work if the path isn’t closed. You’ll know the path is closed when a small circle appears next to the pen tool when you hover over the node.

Pro-tip: If you don’t have a lot of experience with the pen tool, practice! The more you do it, the easier it gets. You can get the hang of it drawing with it on a Shape Layer

Step 5:

When you started drawing on this Adjustment Layer, you will notice a Mask appear in the layer’s dropdown menu. Go to Properties and click the stopwatch symbol next to Mask Path. You will see a keyframe (small diamond) appear on the timeline.

Step 6:

Move your playhead 4-6 frames ahead on your timeline. You will see that either your object or the shot moves. You’ll need to move the mask to make it perfectly outline your object. Adjust your path while making sure you see another keyframe appear on the timeline. Then, move your nodes around to outline your shape again. Yes, it’s tedious, but the end results are totally worth it.

Pro-tip: To edit your path, click outside the path the nodes will become tiny filled-in circles. Now when you click on them, you can move them and adjust the handles as you please.

Step 7:

Repeat Step 6 over and over and over! How ever many frames it takes. By the end you will be an absolute wizard at the pen tool. 

Step 8:

Drag the animation that you want behind your object into the timeline between your video and Mask layer. 

Step 9:

Finally, toggle on the Track Matte function on your animation timeline. To display your Track Matte options, click the little icon in the bottom left corner that looks like a circle and square overlapping(it’s the middle of the three). This will reveal a TrkMat column. In that dropdown menu select None > Alpha Inverted Matte “Mask”.

Make sure your alpha inverted matte is on, and play it back to see your animation in action!

More Video School lessons