After Effects masking not aligned

Yo. I’m messing around in after effects for the first time and I’ve hit a snag…

I’ve got a base movie with a TV screen on it. I’m overlaying another video on to the TV so that it looks like that’s playing on the TV. There’s a lot of camera movement in the base movie so i have used corner pins and keyframes to keep the overlayed movie lined up.

At certain points there are things in the base movie that go in front of the screen and so I’m trying to mask out the replacement video accordingly. After trying Layer>Mask>New mask I thought I was close, but it’s masking my video as if it’s not been aligned and animated. The mask works but only if I position it relative to an invisible staic version of the video. These images should make things clearer.


(Mask set to subtract)


Same view but with fx hidden. The mask doesn’t seem to be working with the efffects as well as the video?

I’m sure this is my fault for doing stupid things with stupid tools, so thanks in advance for any help!

<"))))><

Thanks for that, that sounds as if that’s exactly my problem. In the end I bodged it (Same outcome, waaay too much work) so thanks for the advice about working with comps like that. I’d never considered it.