Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Masking and Motion Tracking

  • Masking and Motion Tracking

    Posted by Adrianna Merlucci on February 6, 2008 at 7:33 pm

    Hi All,

    I have some interview footage that was shot with a horrible background. I want to mask out the background and just have the video of the interview subject so I can place it on any background I choose. Since the footage was not shoot on greensceen (or any other solid background) I can’t do a simple color key. I believe, and correct me if I’m wrong, that the only way to do it is to mask.

    Problem is, since this is video I need the mask to be motion tracked. I have been researching how to do this and have found some possible answers, such as this thread:
    https://forums.creativecow.net/readpost/2/916999

    However, in doing this research I have also read people saying to draw a mask only on a solid layer. Why? And would that apply to my situation?

    Any help would be appreciated…my work with motion tracking and masking is extremely new.

    Steve Roberts replied 18 years, 3 months ago 2 Members · 9 Replies
  • 9 Replies
  • Steve Roberts

    February 6, 2008 at 9:41 pm

    Yes — unless the background is a solid colour not present in the foreground, you have to mask. It’s called “rotoscoping”.

    When you track, you generally track a visible point (or more) in a footage layer, and apply that tracked motion to another layer, so that layer moves the same way the tracked point did.

    So if you want a mask to move that way, it has to be on a separate layer, that is, a solid. That’s okay, since if you want that mask to cut out the footage layer, you just set the Alpha Matte of the footage layer to be the masked solid above it. Check the help on “track matte”.

    I’m not sure we’re done yet — let us know if you have any more problems.

  • Adrianna Merlucci

    February 6, 2008 at 9:55 pm

    Thanks for responding.

    I’m still a bit confused as to the concept of masking a solid…? I don’t see how it will “knock out” the background.

    Do you think you could give step by step directions? Sorry to be a pain.

    Thanks again!

  • Steve Roberts

    February 6, 2008 at 10:10 pm

    1. add the footage to the comp.
    2. make a new solid, making sure it lies above the footage layer.
    3. make the solid partly transparent, so you can see the footage below somewhat.
    4. select the solid, then the pen tool.
    5. draw a mask on the solid around a desired footage area that you can see … such as the talent.
    6. make the solid 100% opaque
    7. make sure the Modes panel (column) is visible in the timeline. F4 is the toggle.
    8. select the footage layer, and under TrkMat, select “alpha matte”.
    9. The solid should disappear, cutting a hole in the footage below.

    It should be in the Help, under “Track Matte” as I wrote.

  • Adrianna Merlucci

    February 6, 2008 at 10:57 pm

    Thanks Steve, that worked perfectly…now for the motion track. From what I gathered here and elsewhere is this what I am supposed to do (i copied an pasted some of this from the original thread i linked to in my initial post):

    1. make the mask on the first frame

    2. Select the layer with the Mask (the solid), File>Run Script>RotAE.jsx. (this is from the link i posted in my initial post – the roto script)

    2. then select the Mask again, and in the control panel that popped up, hit “Apply Tracker”

    3. run the motion track

    4. select the Tracker 1 and also select the Mask, then up in the Script’s Control panel, click ” Apply Mask”

    Thanks!

  • Steve Roberts

    February 7, 2008 at 5:09 pm

    Sorry Adrianna, I was wrong. I should have checked out the script — as you know, it tracks points on the footage and applies that motion to the mask points. In effect, it does the mask shape animation for you.

    It doesn’t require a separate layer, as I recommended. I was thinking that you were just moving the center of the mask with one tracking point. To do that, you need to move the solid layer’s position based on a tracking point’s motion, then make that solid a track matte. So, I was wrong. My sincere apologies.

    You can do all this by drawing one mask on your footage, then applying the script and following its instructions. No separate layer is needed. However, your instructions above will work just as well, with the additional one-click step of using the solid as a track matte, but you know about that.

    Sorry to have led you astray — you didn’t need to apply the mask to a separate solid, but it’s just a different way of doing the same thing. Sometimes we need to know more than one way to do something.

  • Adrianna Merlucci

    February 7, 2008 at 5:14 pm

    Hey Steve, no need to apologize- you have helped me a ton!

    I did scrap the idea of drawing the mask on a seperate layer on my own – it was getting to annoying to keep copying the trackers to the .mov file. Anyway, I was just wondering why its recommended to draw the mask on the solid instead of directly on the footage itself?

    As for the roto and the tracking: this method seems to work okay. The applied mask isnt perfect so I have been adjusting points (only about 4 compared with over 20) manually each frame. Do you have any tips on how to draw the original mask so that I won’t run into trouble later with the tracked points? It seems that making curves is troublesome but I don’t think its too avoidable when I am trying to draw a mask on a person…

  • Steve Roberts

    February 7, 2008 at 5:46 pm

    [Adrianna Merlucci] “Anyway, I was just wondering why its recommended to draw the mask on the solid instead of directly on the footage itself?”

    Sometimes it’s recommended, but not all the time, since generally you can just draw the mask on the footage layer. But consider this: when you rotate a mask using the mask transform tools, the mask changes shape as it rotates. This is because the mask vertices have to travel in a straight line between keyframes. If you want to avoid this distortion while rotating a mask, you need to draw the mask on a solid, then rotate the solid using rotation keyframes. Or sometimes you want a mask to follow another layer’s motion, so you might have to draw the mask on a solid then parent the masked solid to that layer … since you can’t parent masks, only layers.

    “As for the roto and the tracking: this method seems to work okay. The applied mask isnt perfect so I have been adjusting points (only about 4 compared with over 20) manually each frame. Do you have any tips on how to draw the original mask so that I won’t run into trouble later with the tracked points? It seems that making curves is troublesome but I don’t think its too avoidable when I am trying to draw a mask on a person…”

    Yep, rotoscoping is a pain. I like to use rotobezier and place vertices at points of inflection, that is, where the curve changes shape. And you need more points at sharp curves. It’s something that requires practice, but the aim is to get an accurate mask with as few points as possible. Hope that helps.

  • Adrianna Merlucci

    February 7, 2008 at 8:48 pm

    Now AE freezes up anytime I try to apply the mask. I only have 28 vertices…should I try to get it down from that? Do you think that is the problem?

  • Steve Roberts

    February 7, 2008 at 9:18 pm

    Ouch. Maybe — couldn’t hurt. Sorry, I’ve never used this script before today.

    Anybody else?

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy