Back to Blog

Tutorial: Tracking and Keying in After Effects | Part 1

No items found.

Learn to effectively track and key using After Effects.

After Effects is not just for Motion Graphics, it's also a compositing tool. If you want to become a MoGraph Ninja you're going to need to know some basic compositing, and that's what this two part tutorial series is all about. There's a ton of info packed into just this first part where you'll learn how to remove an object from a hand held shot, do planar tracking with Mocha in After Effects, keying, and color correcting our composited shot.Make sure you check out the resources tab for info on where you can get some greenscreen footage to practice you keying skills with. And for a background plate, whip out your smart phone… it will be plenty good enough to play around with this technique. So much to learn, so little time. Let’s get cracking!

{{lead-magnet}}

-----------------------------------------------------------------------------------------------------------------------------------

Tutorial Full Transcript Below 👇:

Music (00:00):

[intro music]

Joey Korenman (00:20):

Well, hello there, Joey, here at School of Motion and welcome to day 20 of 30 days of after effects. Today's video is part one of a two part series where we're actually going to do something that's not very motion graphic. See, it's more compositing. Now, when I say compositing, what I'm really talking about is visual effects, which is something after effects is used for all the time. Now, the next two videos are going to cover a lot of important techniques that every MoGraph artist should know, because you never really know when you're going to need to pull them out of your bag of tricks. We're going to cover tracking, removing things from the background, keying color correction, a whole bunch of stuff. I want to give a quick thank you to the Baltimore Orioles who do spring training right here in Sarasota for letting me use the clip of their mascot and this tutorial.

Joey Korenman (01:05):

And this was actually shot in the green screen studio at the Ringling college of art and design, which happens to be an awesome college that I used to teach at. Don't forget to sign up for a free student account. So you can grab the project files from this lesson as well as assets from any other lesson on the site. All right. Let's hop into after effects and get started. So here's the final clip that we'll be producing. And, uh, like I said before, it's going to take two videos to do this. And I'm going to show you guys a lot of tricks, a lot of hopefully pretty cool techniques to do compositing with. Let me start by showing you the two raw clips that we're going to be working with. So here's the first clip. Now, this clip was shot in the green screen studio at Ringling.

Joey Korenman (01:48):

This was actually for a class project that happened during the 2013, 2014 school year, and the Baltimore Orioles have their spring training in Sarasota. So a lot of times what'll happen is Ringling will bring in companies and organizations that have roots here and create class projects out of that. So this was one of those and it was pretty cool. Some players came down, the mascot came down, this was shot on Ringlings red camera, one of the red cameras and a shot in the green screen studio. So one thing I made sure to note before I went and shot the background was I made sure to figure out where the main light was coming from. The key light is that's the term. So I could match that when I shot a background. So if you notice here's the key light. So I made sure that when I shot this footage, I made sure the sun was over here, at least on this side of the screen, so that shadows would fall on that side.

Joey Korenman (02:46):

And the brightest part of the bird would, would make sense. So that's really important. Now this is the raw shot. All right. And it's actually a much longer than the clip I showed you guys. I used to just sort of this little piece right here, looking at the grass, looking up and there's the bird there he is now. He'll notice my, uh, my four year olds, little Adirondack chairs. They're uh, this bright pink chair. Now, why did I do that? Well, I knew I wanted to track the bird to the ground and it would be pretty tricky to do that. If I didn't have some reference, something that I could track on the ground. Now I'm going to show you some different sort of tracking techniques with these videos. The grass is actually trackable, but really it's going to, it's going to be mainly trackable as like a large area.

Joey Korenman (03:40):

Um, and we are going to do that, but if I want to actually position something right on the ground, I knew I wanted a reference object. So I thought this would be a good reference object because you cannot have any more contrast than between green grass and a pink Adirondack chair. All right. So this is what we started with, um, in, you know, beautiful sunny, Florida, just sort of outside my house. So here we go. Let's start by taking this clip and making a new comps. I'm just going to drag it down here and make a new comp with it. And the first thing I want to do is just trim this. So I only have the piece of the shot that we're going to use because I shot for like a minute. And I wasn't sure what piece of that I wanted to use.

Joey Korenman (04:22):

So I ended up starting about here. So I'm gonna hit be set my end point there, and then I'm going to go forward and we'll just go, maybe, you know, somewhere in there. I mean, I guess we could just use the rest of the shot. So now let me trim this comp, let me write a control click, or right. Click up here, say trim comp to work area. So now that's the only little piece of the shot that we're going to use. Okay. And what I need to do first, I need to get rid of the chair. And, um, you know, there's, there's a bunch of different ways to do this, but I'm going to show you the easiest way I can think of. And we're actually going to do the whole thing. Just using tools that come with after effects. I don't want to use any third party stuff for this tutorial.

Joey Korenman (05:11):

You can, but, but Y you know, this is 30 days of after effects. So what we need to do to remove this chair is first get a good track for the scene. Uh, there's, there's a lot of new tools now for after effects. The, let you do a fancy trick called camera projection, and camera projection is extremely useful for removing objects from scenes. The problem is it requires a very good camera track. And to be honest, after effects, camera tracker is just not that great. I mean, it works in some cases, and it might even work in this case. Uh, but I don't like to use it. I like to use a different camera tracker that, that doesn't come with after effects. So I don't want to do that. So what we're going to use is a program called mocha and mocha comes with kind of a light version and it's ships with after effects.

Joey Korenman (06:02):

So here's how it works. Select your clip, go up to animation, say track in mocha, AE, E what's going to happen is it's going to open up mocha and it's going to start a new project. And so let's just name this project. Uh, I don't know, like backyard or something. And what it does by default is it saves a MOCA project file, uh, in, in, uh, you know, in whatever location you have here. And by default, it's going to save it in the same location as your after effects project. One thing I always like to make sure I have checked is in this advanced tab, make sure cash clip is enabled. And when you do that, when you hit, okay, the first thing that happens is MOCA loads, the clip into memory, you can see that's what it's doing. And this makes the whole process coasts so much faster.

Joey Korenman (06:54):

It takes, you know, a minute on the front end, but now I can play this clip with the space bar. I can play it in real time and it will track much, much faster too. So we're actually going to do two tracks for this. Okay. So we're going to, the first track we're going to do is we're going to track the grass and I'll, and I'll explain why mocha is a planar tracker. And what that means is it tracks instead of individual points, it tracks planes. So if you think of a plane as sort of an area, you know, a flat area that is kind of all on the same 3d plane, that's what mocha can track. So what I want to do is try and track a big patch of grass. And I want to try and pick an area of grass that is relatively flat, specifically, that's on the same plane as the area, this chair isn't.

Joey Korenman (07:43):

So I don't know if you guys can tell from the footage, but this part of the lawn right here, it goes up a little bit. There's a little bit of a hill there, so I don't want to track that part, but for the most part, the rest of this is pretty flat. So here's what I'm gonna do. Uh, you can see that MOCA actually sees the entire clip, but there's an in and out point that match up perfectly to my in and out and after effects. So I'm going to go to the last frame here, and if you've never used mocha, uh, I'll talk you through some of the hotkeys and I'll show you where the buttons are. The, it looks really complicated. There's actually not that many things you have to deal with those. It's pretty nice. So I'm going to click this button here, right in the middle.

Joey Korenman (08:22):

These are your main play controls. And if you click this guy with the little line on the right side, takes you to the last frame. So now on that last frame, I'm going to go up here to my tools. And I'm looking at these pen tools, the X and the B, they both pretty much do the same thing. They let you draw a shape, the X draws, sort of a normal spline that you're used to, right? You click, and then you, you can sort of actually, sorry, I'm, I'm saying it wrong. X draws an XPLAN, which is kind of a neat spline that MOCA lets you do where you, you draw a spline and then use these handles to dictate how curvy that part of the spline is or how not curvy. Um, so that's kinda neat. And then you can also hit this B and draw Bezier curve.

Joey Korenman (09:06):

And this is probably more like what you're used to, right? So I'm gonna, I'm going to delete this. And every time you make a shape, it adds a layer over here. And then you can select that layer, hit the trash can to delete it. So let's just use this little Xplain cause it's a little faster to draw. And what I want to do is draw a shape and I don't want to include the chair. And the reason is the chair is sticking straight up and down. It's perpendicular to the grass. And I don't want to track that plan. I want to track the grasses plan, the ground plane. So I'm just going to sort of draw a rough shape, something like this. And it may seem weird, but mocha is smart enough to figure out, you know, by drawing this shape, I'm telling it that everything inside the shape is on the same plane.

Joey Korenman (09:55):

And now I want you to track that plane. So now I'm gonna hit the track button and I'm going to track backwards cause I'm on the last frame. So here's your tracking buttons. The leftmost one will start tracking backwards. This one tracks one frame backwards. So I'm just gonna click this one and let it start going. Okay. And you can see that it's app. It's absolutely amazing how well mocha can track stuff. All right, let me pause it for a minute. I mean, just look at this image here. There's like as your, your human eye is going to have trouble picking out one spot on this grass, but MOCA is able to track pretty seamlessly. And another cool thing you can do with MOCA is in the middle of a track, you can expand out this, this mask a little bit and just give it now more information to track and it will keep tracking and it doesn't mess up.

Joey Korenman (10:45):

What's already been tracked. It's just now giving it more information to look for. Uh, and in general, the more information it's tracking, the more accurate the track is going to be. Now, as we get to the beginning of this shot, the camera's going to start to, to, uh, to tilt down. And so, as it tilts down, I want to make sure I expand this. So now it can track all this new ground that's being revealed. And so I'll keep tracking backwards and you can see it slows down and I'm gonna hit space bar to pause it. And I'm just gonna adjust the shape. Now you can see this transform box around here. I can't see the top of it. So I want to move this whole thing down. And in aftereffects, she holds space bar and that lets you sort of move your entire workspace in MOCA. It's X, you hold the X key and now you can move it. And the Z key lets you zoom in and out. So I'll hold X and now I can shrink this shape down. Now keep in mind. I'm not screwing anything up. I'm just telling mocha now track this part, but it's still all on the same plane. So I'll keep tracking and mocha so good. It can even track when stuff goes off screen, it can figure out where stuff should be. Um, and let me just adjust this now and then we'll keep tracking.

Joey Korenman (12:08):

All right. And we get to that end point and now it will stop. If I scrub through, you can see that right now. It's kind of hard to tell what mark has done because the shape is, you know, it's been key framed. It's automatically, you know, set key frames when I changed the shape, but it's tracked it very well. Now. Here's what you actually do with that track. You need to set up a surface in mocha. So the surface is actually the plane that it's going to apply this motion to. There's a button up here. It has an S in the middle of this little square. And if I click that, make sure this layer is selected by the way. Um, and you can actually double click this and rename it. Let's rename this grass. And now you see how this blue kind of rectangle appears and you can drag the corner of those.

Joey Korenman (12:56):

And in this case, you know, there's nothing, there's no real feature to, to track, right? I mean, like if there was, if I had placed a big poster on the ground or something, I could line the corners of this, up to the poster to check and see how well my track is working. I didn't do that. So I'm just going to kind of eyeball this and it's not too important. I just want to show you guys how well this worked. So that is now the surface, right? And uh, if I scrub through, you can see that that surface tracks pretty well to that grass, the perspective shifts. Um, and if you really want to track it, what you can do is make sure you have your layer selected, come down here to insert, clip, and set this to logo and it'll insert the MOCA logo.

Joey Korenman (13:44):

And now I can even hit space bar and it will show me and I, you know, it's playing almost in real time and it looks like that logo is just perfectly stuck to the ground. Cool. So that's fantastic. So now let me show you generally how you use this feature. Um, but it's not actually how we're going to use it in this case, but I just want you to understand mocha a little bit more if you've never used it. Uh, now that I've got a good track, I can go, I can go down here, down here. You've got these three tabs clip track and adjust track in either track or adjust track. You've got a button that says export tracking data. So whatever layer you've got selected here. And right now we only have one layer select that hit export tracking data. And what you can do is you can tell it, which kind of, what kind of tracking data you want.

Joey Korenman (14:35):

And what I want is the effects corner pin data. And you want this first one up here and now you just hit copy to clipboard. And now go back to after effects, go to the beginning here, and I'm just going to make a new solid, and I'm just going to hit paste and make sure you're on the first frame when you do this, but hit paste and now hit space bar and it perfectly corner pins that solid now to the ground. And you can see that that covers up my chair. So what I need to do now is create a patch that I can patch the grass up. Um, and, and basically just patch up this area and use, basically use the clone stamp tool to clone over the chair and just recreate the grass. Now here's where your problem comes in. When you corner pin something, it distorts the image.

Joey Korenman (15:31):

And so if I turn the corner pin off, this is actually my quote image, right? And when you corner pin, it, it then sticks to your background plate. But if I was going to create a patch of grass that would then get corner pinned and would look correct, that would be kind of tricky because if I clone stamp something from this frame, right, and then it gets corner pinned, it's going to be distorted. It's going to be really hard. And, and so this is why the technique of camera tracking has kind of become popular in after effects. If you Google after effects, uh, camera projections, I should say camera projections. There's a, there's a bunch of tutorials coming out now that show you how to do it. And it's a lot more complicated than what I'm going to show you. This is actually a really neat trick with mocha.

Joey Korenman (16:19):

So we can't just corner pin something and just have it sit over that area. That won't work. Here's what we're going to do. Let me delete this for a minute. Let's go back to mocha and I have it open twice for some reason. So let's go back to this MOCA. Here we go. And let me turn off my insert clip for a minute and just set that to none. And I'm going to go to the last frame. This is a very important step. What I want to do is I want to pick a frame. And in this case, it's not really important because the camera doesn't move too much, but you want to pick a frame that gives you enough visual information that you could clone stamp pieces of it and cover up whatever object you're trying to get rid of. The last frame is going to work very well for this.

Joey Korenman (17:07):

And it's also important that you remember what frame you do this next step on. So by choosing the last frame, that makes it easier on the last frame. I'm going to go to this button here. Okay? So with this layer selected this little guy here, and if I hold my mouse over it, it says, push the surface to the corners of the image. Keep in mind this blue kind of trap as a weed shape. That's the surface. So if I click this, look what it does. It moves the corners of that to the corners of my image. And now if I scrub backwards, you can see it's doing this bizarre looking distortion, which lines up only on the last frame. Now, what use is that? Well, this is a very cool trick. You guys are gonna like this. So now with that step done, I'm going to say export tracking data.

Joey Korenman (17:59):

And I want the corner pin. I'm going to copy to clipboard, go back to after effects. Here's what I'm gonna do. I'm going to duplicate my footage layer and on the duplicate copy. I want to pre-camp this, make sure I move all the attributes into a new composition, and I'm going to call this patch. Then I'm going to go to the first frame and I'm going to hit paste. Let me turn the sound off. Okay. So if I go to the last frame and let me turn off this bottom layer for a minute, if I go to the last frame, my patch layer is lined up perfectly. And then as I scrubbed backwards, you can see it being corner pinned in this weird, weird way. What's interesting is what it's doing. And this'll make a lot of sense in like five minutes. But what it's doing is if you just stare at the grass, this grass has perspective on it already because you know, the K w was shot with a camera and cameras introduced perspective into an image.

Joey Korenman (18:58):

And so what it's doing is it's maintaining that perspective throughout my shot, by warping the image so that on this frame, the corners line up and, and it's, and, and so if you look at the grass and just focus on the grass, you can see that it actually is sort of maintaining the correct perspective. So here's now, now what we're going to do is patch this. So let's go into our patch pre-camp and I want to make it so that this footage doesn't play. I just want this frame. So I'm going to make sure I'm on that frame, select my layer and go up to layer time freeze frame. And that's just a little shortcut. It turns time remap on puts a hold key frame on that frame. So now this, this whole layer is just that one frame, and I'm going to go to the first frame and I want to use the clone stamp to paint out this chair.

Joey Korenman (19:54):

So you can't use the clone stamp in your composition viewer. You have to use it in a layer viewer. So you need to actually double-click your, your layer here. And it will bring up this viewer. And this is what a layer viewer looks like. And so now I can use my clone stamp tool, make sure that in your paint settings, the duration is set to constant so that whatever you draw, it's going to, it's going to maintain that, that clone stamp for the entire length of this layer, because there's different settings. There's right on single frame. You don't want any of those. You just want constant. And then with your clone stamp tool, it works the same way. It doesn't Photoshop. You hold option and you select your source point. And let me zoom in here so we can really get a good look at this, make sure we're at full Rez, uh, the hot key to go to, by the way as command J if you didn't know that, uh, and then I'm using the period in the comma to zoom in and out.

Joey Korenman (20:54):

So I'm gonna hold the option and I'm going to click somewhere over here and the clone stamp right now, it's really, really big. I don't want it to be that big. If you hold command and click and drag, you can interactively scale your brush size. So let's just pick a little spot. And the way I like to clone stamp is to kind of pick different areas of the grass and clone, stamp, different parts of that chair way. The reason I'm doing that is because if I just picked like this area here and did this, it works okay, but you might, your, I might notice patterns if you're not careful. So it's always a good idea to kind of mix it up a little bit. All right. And just kind of make sure there's nothing that that's obvious, right? That gives away that you've clone stamped it.

Joey Korenman (21:40):

So I did a few clones stamps and the chair has gone. This is a pretty easy example. Um, but this works for anything. So now you can see that because I had this on constant that, that maintains all the way through. Now I can close this layer viewer. And if we jump back into this now, right, you can see that now on the last frame, we've got our, our scene and it sort of warps it in perspective and it's still looks really weird. So the next step, this is the key come in here. And we want to mask out just the part of the image that we want to fix. We don't want this whole thing. We only want the little patch of grass where there was a chair. So let me turn off the pain effect for a minute. Now here's something that's weird and I don't know why this happens, but, uh, first I tried just putting a mask around this part and then turning the paint effect back on. And for some reason that screws up your pain effect, having a mask on there, screws it up. So we're going to delete the mask. We're not going to do it that way we're going to do is make a new layer. We're going to call it Matt. I'm going to make it an adjustment layer just so I can see through it. And then I'm going to put the mask on that layer.

Joey Korenman (22:54):

Okay. And I'm going to feather that a little bit, and then I'm going to tell this layer to use this as its alphabet. And now we can turn the paint effect back on. And now we've just got this little patch. And if we jump back here and you look at the little patch, you can see that it moves around and it's getting this perspective on it. And here's the magic you turned the clean plate back on and oh my gosh, it's sticks right to it. Okay. And let's just let that Ram preview. It's pretty it's I dunno, the first time I did this, it blew my mind. I think it's pretty amazing. Uh, and you saw how easy that was. I mean, this, this works for any surface, uh, that is flat, that you can get a good track on in mocha. And now what we want to do is just focus on the last 10%, really help sell this composite, right?

Joey Korenman (23:47):

So let's zoom in when your composite thing. And when I say compositing, I mean, I generally use that term to mean visual effects type of stuff like this, where we're, this is not designing and animating. This is using after effects to do a visual effect, basically. Um, it's way more important in those cases that every once in awhile, you hop into 100% zoom and you go to full rest. You can really see what it's going to look like. And here is one of the, here's one of the pitfalls of using this, right? This grass, even though it's, you know, it, I just cut it the other day. It's pretty short, but there is some perspective to it, right? And so when we're over here, you get a little bit of a smearing effect and it just looks a little bit less sharp than the rest of the grass that's around it.

Joey Korenman (24:35):

Um, so what can actually help some times is to sharpen the grass. So I sometimes just grab a, um, a normal sharpen effect and just knock it up a little bit. Right. Let's see. Knock it up to five. And now at least as a still, it seems to blend in better if I turn it off and on, man. I mean, it is just a subtle, subtle little difference. Let me see if I zoom in. If you guys can see it better, it just, it just sort of helps right in here. It almost, it helps the dark skin, a little darker and it just, it just sorta helps it sit in there a little bit better. Um, another thing that it's hard to notice, let me, let me, let me maximize my frame here with my Tilda key for a minute, and try to show you guys as high quality as I can.

Joey Korenman (25:31):

Now. You're not really going to notice this very much, but this footage has green in it. All footage has green in it doesn't matter how, how high end of a camera you use. There's going to be some sort of noise, just the way cameras work. However, because I made a freeze frame of that last frame. Um, here we go. So now it's playing in real time because I actually froze that last frame to make that little clean plate, that little patch, there is no grain on that piece of footage. The rest of this has grain that piece doesn't and it's so subtle, but you it's one of those things you're I just can kind of give it away now, you know, maybe most people wouldn't catch it, but I guarantee a visual effects supervisor or a compositor would probably catch it. So what you want to try and do is match that grain to the existing grain in the footage, right?

Joey Korenman (26:26):

So it's hard to do when you're looking at the full image, it's a lot easier to do when you look at each channel individually and by channel, this is what I mean, this button right here, I put a lot of, you've never clicked it. This can actually show you the individual channels that make up your image by default seeing the RGB composite image. But each image you look at actually has a red component and a blue component and a green component. Okay. And especially the blue component of video generally has the most noise. And so if you, if you just look in here, right, you can kind of see a little bit of a noise pattern and it's hard. It's hard when the camera's moving so, so much, but you know, you can see it. Um, and you can probably especially see it in, in very bright areas.

Joey Korenman (27:14):

Like if you look at the water, you can see there's noise, right. Um, but in our little patch here, there is absolutely no noise. And now you can, you can almost see it because, you know, we're looking at the blue channel. So I need to add noise in there to really make it, make it work. And so what I'm going to do is I'm going to put noise on it, but I'm actually going to put the noise on it inside of this. Pre-camp. And let me tell you why, if I just want to put noise on this patch, right? I don't want to put it on over the whole thing. I just want to put it on this layer. I'm going to go to effect noise and grain, add grain. Now, the way the grain effect works is by default, let me, let me unsold this.

Joey Korenman (27:59):

It gives you this little white box that you can move around and it's only going to put grain inside that box. The reason it does that is because this effect takes for ever to render it is a render pig. And so the idea is you're supposed to use this preview box to get the grain set up. And then when you're done, you say final output, and then it puts grain over everything. Now this layer is only this big it's very little, but you can see instantly if I turn this off and I hit space bar, that's how fast it previews. If I turn it on, that's how fast it previews, even though there's just this little piece of image, the effect is not smart enough to only work in that image. And I could try, you know, there's, there's different strategies. And the problem is that this layer is moving around on screen.

Joey Korenman (28:47):

So here's what I'm gonna do. I'm actually gonna put the add grain effect inside this pre-camp and I'm just going to put it on an adjustment layer. All right. So make this an adjustment layer. I'm going to copy the add grain effect to that layer, and I'm going to set it to preview mode. And what's great. Excuse me about preview mode. Is that it, it renders much faster because it's only putting grain in this little box. There's a preview region setting on the add grain effect, and it'll actually let you increase the size of the preview region, right? So now it's rendering much, much faster, cause it's only putting grain inside that box, which is awesome. The problem is it's still rendering that little box. Well, you can turn that off too. There's a little checkbox show box. If you uncheck that, now that box has gone and it's putting grain on that footage in this comp.

Joey Korenman (29:42):

Now, technically it's also then warping the grain, which you don't really want it to do. Um, but you're not going to be able to notice once the footage is playing and all that kind of stuff. So this is technically not exactly correct, but it's probably good enough. Now, what I want to do is I want to check. I want to zoom in here, let me make an in and out my BNN keys. And I want to check looking at the blue channel, by the way. I don't think I mentioned this the way I'm switching between the channels with the keyboard is you hold option and option one switches to the red channel. Two is the green channel. Three is the blue channel, whatever channel you're on. If you hit option and that number again, it'll go back to your RGB. So you can quickly shift through your channels.

Joey Korenman (30:28):

So I'm looking at the blue channel now, and I know my patch is right there, so I need to look right there and I'm seeing some grain in there now. And I think I got lucky in the default settings worked. Okay. Now it's also a good idea to look at your other channels, your red and your green, and just make sure that you're still seeing the grain in those channels. Now the add grain effects in after effects, doesn't give you a ton of options. Really. It gives you, um, it gives you mostly options for, um, just how intense the effect is going to be, how big the grain is going to be. Um, and one thing that can be helpful is if you're trying to match film stock or something, sometimes there's way more grain in the blue channel than there is red and green channels.

Joey Korenman (31:18):

So you can twirl down in the, uh, in this little tweaking property thing here in the, in this group, and then look at channel intensities. And so if I look at this, right, I'm looking at the green channel right now, and I'm thinking the green channel maybe doesn't have as much noise, uh, or sorry. It needs more noise in the green channel. So I'll come to here. Um, and you know, it's, it's a lot of times a pain to bounce back and forth like that. I want to adjust this, but see the result here. So what I can do is just hit this little lock up here. And so now when I switch, it's gonna lock my viewer to the comp. I want to see. And so now I can just increase the, uh, the green intensity, maybe 1.2. Let's just try that and then pop back in here and do a quick Ram preview. And then we'll see if I like that green setting better. Okay. And overall, I think the grain matches a lot better now. So I'm going to go back to my RGB. Let me actually go to 100%, take a look here, do a quick Ram preview of just that section and see what we got.

Joey Korenman (32:25):

And I think we're going to be in pretty good shape. We now have grain on that little patch of grass and it's such a subtle thing. And you guys probably can't really tell the difference, looking at this on a tutorial, which is already heavily compressed to be on Vimeo. But, um, when you're looking at this on a TV screen, or, you know, if this was for a movie or something, you can tell your, I will just know something's off. And then you might not be able to put your finger on it, but you'll sense this something's wrong. So here we are. Now we have our clean plate. We are all ready to insert our burden to it. And before we do that, we actually need to get a good track to use for the bird we can't use. Let's go back to mocha for a minute.

Joey Korenman (33:10):

We can't use this same track to put the burden. Cause what we tracked was the grass. The grass is lying flat, but the player's going to be standing, sorry. The bird is going to be standing straight up and down. So that's why I put the chair in there. So I had something in the scene that was standing up and down that I could track. And more importantly, I put it in the position where I wanted the player to go. So what I'm going to do is I'm going to, I'm going to turn this layer off. I'm gonna hit this eyeball icon next to grass. And so now I don't see that layer and now I can make a new layer, make sure you don't have this selected and let's grab our B tool here. And what I'm going to do is zoom in, sorry, I'm gonna hold Z and zoom in.

Joey Korenman (33:52):

And I'm going to draw a shape just where this chair is. Okay. Just like this. And now I'm going to come down here to my track settings. And by default mocha tries to track a whole bunch of things, translation, scale rotation, and sheer. And it can also track perspective. And if you, if you want to know really what all these things do, you just check out the documentation from mocha, but I don't want shear at this point. All I want to do is get a position, scale and rotation value for what this chair is doing in the frame. And that way I can apply that to my mascot. So, uh, you know, I kind of did this wrong. I, I'm kind of in the middle of my clip here, so that's okay. I'll just track first, I'll track forward. So I'm going to click the track forward button and let it track that chair.

Joey Korenman (34:49):

And it's going to very easily track that chair. And then I'll go back to where I started and I will track backwards now. Oops, I did that wrong. I clicked the wrong button, track backwards. There we go. All right. And because it's not tracking a very big area and because the clip is cached, it can track it pretty quickly. And you could probably get an okay track on this in after effects. But MOCA is just amazing at tracking stuff that has kind of a, a pattern to it. And you can see that there's these little grooves in the chair and the Adirondack chair that makes it really, really easy for MOCA to track. If you haven't used mocha before, you might also guess that it's amazing for doing rotoscoping. If I wanted a good mask that traced the contour of this chair, this program can do it amazingly.

Joey Korenman (35:43):

And I can't believe that it just comes with after effects. They don't charge any extra. Let me zoom out a little bit because once we get back to the beginning of this shot, the chair is going to go out of frame. And I want to just make sure that we can get as much of a track on that as possible. And I'm hitting space bar to pause the track. And I'm just going to track one frame at a time and it's still tracking and it loses the track there, but that's okay. I'm not going to worry about it. So now we have a track for most of this shot. All right. And I'm going to rename this chair with the chair layer selected. I'm now going to go down and see export tracking data this time. I don't want a corner pin. I just want transform data, anchor point position, scale and rotation.

Joey Korenman (36:31):

So I'm going to copy that to my clipboard hot back into after effects, go to the first frame. And I want to apply that information to a no object. I'm going to rename this track whenever I track something and apply the tracking information. I always do it to a null because that way I can just parent things to the null. So I'm going to hit paste and MOCA does something weird at first. Okay. And I want you to see what it's doing the Knoll's way up here, but the anchor point for the Knoll is actually in here. And it's kind of hard to see it. It's, it's this little, this little guy right in there, and it's actually tracked pretty well to the ground. Um, but this is weird and it's going to be tricky to work with. Uh, so what you do, this is actually really simple solve, uh, go to the first frame, hit you on your track and you can see, these are all the key frames that came over from mocha, just delete anchor point and then zero out the anchor point.

Joey Korenman (37:30):

Right? And so now if you look, our null is right on the ground, right where the chair was and it sticks perfectly to it. And when we get to, if we kind of zoom out here a little bit, we will get to the beginning of this shot where the track failed. Okay. And you can also see that at the beginning of that shot, we're getting a little bit of that chair showing up. So what we need to do is actually change the shape of our mask a little bit. Um, so what I'm going to do, because this will be easier if I do this, I want to see the result of what I'm about to do, which is change the shape of this mask. So what I'm going to do is I have, uh, let me close this for a minute and show you how to achieve this. I'm in this comp while you're in this comp, go up here and click on this arrow and say new comp viewer and after effects, we'll make a new composition viewer. This viewer has the lock turned on. So now I can switch to a different comp and see that comp in this window, but see the result in this one. So what I'm going to do is I'm going to, I'm just going to kind of go forward using page down until I don't see that chair anymore.

Joey Korenman (38:45):

All right. And then in this, in this comp, and you can switch between them just by clicking in the viewer, I'm going to go to this comp and I'm going to put a mask key frame here with option M. Then I'm going to go backwards until I actually see that chair. And then I'm just going to adjust the mask until the chair goes away. There we go. And then I'm just going to go page down page down page down and make sure that the chair doesn't pop back into existence and it shouldn't. And so now we fixed that. It's not closed this window. Excellent. All right. I didn't even notice that when it was playing, it was only framed by frame that I noticed it. Um, cool. And so now we've got that Knoll object in the right spot. And when it, when the track goes bad on that frame, you have a couple options.

Joey Korenman (39:35):

One is you can just make it so that whatever object is going to be tracked in there, right? The mascot, I can just make it. So he doesn't actually appear until this frame. So he doesn't exist on this frame. The other thing you can do is let's zoom in here. So we can see all these key frames. I know that this, these key frames and all the ones that come before are useless, I'm just going to delete those. And so then what I could do is just manually set this last key frame myself, and I can kind of see what all the other key frames are doing, and I can just kind of mimic that motion manually. Cool. So now I get one more frame where I actually get a good track just by cheating. All right. And now let's actually test this track out.

Joey Korenman (40:22):

Let's make a solid, and let's pick some, let's pick some color here that we like. I don't know. What's hot now. Pink, pink is hot. Let's make a solid layer. Let's just scale it down and maybe make it kind of tall and skinny like this. And just temporarily, what I'm gonna do is I'm gonna, I'm gonna turn off my patch so I can see exactly where that chair sits on the ground. And I'm going to move my layer right there. Then I'm going to parent it to my track tool and turn my patch back on. And if we did this right, that should look like it is stuck pretty darn closely to the ground. Okay. Now it doesn't work until this frame right there. So I don't want that solid to exist. Before that frame, someone hit option, left bracket to trim it. There we go.

Joey Korenman (41:22):

And let's zoom out. Let's do a Ram preview here and see what we got. All right. And that's working pretty well. That's sticking to the ground. It's rotating with the camera. It looks like it's the right spot. Let's just, double-check turning the patch off. Cause it looks like it's slipping a little bit. And I just want to make sure yes, he, I didn't have it in the right spot. There's the bottom of the chair right there. Now I'll turn my patch back on and now it should stick a lot better. You gotta be very precise. If you use this technique, otherwise you get something that looks like it's slipping. It's not really sticking to the ground. And there we go. All right. And now we've got this object tracked in there and it's rotating and it looks like it's in the scene and we've cleaned up the scene.

Joey Korenman (42:10):

We've got a nice clean plate and we've got a nice track and we're ready to go. All we need to do now is key out our footage, put it in there and do some other compositing to make it sit in that scene better. And this is where we are going to stop with part one of this video. And part two, we will key out the footage. We will color correct it. We will do some other compositing tricks to make it feel like it really sits in this scene. But hopefully you've gotten a little more comfortable with MOCA. And specifically with using mocha, a couple of different ways. We used it one way to tactually track this thing into the shot. We used it a totally different way to make a clean plate for ourselves and get rid of that chair that was sitting there. So thank you guys so much.

Joey Korenman (42:52):

I hope you learned a lot and I'll see you next time. Thank you so much for watching. We're going to finish this video in part two, and that's when we're going to get into how to actually key the footage, integrate it into the shot and how to color correct it. So it looks right. We're going to learn a lot more. So definitely check that out. Let me say thanks to Ringling. One more time for letting me use their studio to shoot the mascot footage and thanks to the Orioles for letting us use their mascot. I tried to treat it with respect, even though I like the red Sox. If you have any questions or thoughts about this lesson, let us know. Thanks again. And I'll see you next time.