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.
Load your video into the project area and then drag and add it to your timeline.
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.
Now, move your play head to the first frame in your timeline. Click on your Adjustment Layer.
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.
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.
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.
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.
Drag the animation that you want behind your object into the timeline between your video and Mask layer.
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!