Ready to watch this entire course?
Become a member and get unlimited access to the entire skills library of over 4,900 courses, including more 3D + Animation and personalized recommendations.Start Your Free Trial Now
- View Offline
- Working with image sequences
- Matching the 3D camera to video footage
- Lighting models in Maya
- Splitting a scene into multiple render passes
- Batch rendering
- Recombining render passes in an After Effects composition
- Setting up motion trackers
- Refining layers with rotoscoping
- Adding blur and effects
- Adjusting shadows and matte edges
- Using color correction
- Stabilizing shaky video
Skill Level Intermediate
It's time to start Project 3. In Project 3 we're going to use Motion Tracking to stabilize a piece of footage. Now so far we have used Motion Tracking to Transform Track where we identified some motion in the piece of footage like camera movement and transferred that motion to a CG Render, like the spyglass or the spaceship. We can also use Motion Tracking to stabilize, and when you stabilize you identify the camera shake in the shot and then remove it so it looks like there is never any motion at all, so let's get started. I'm going to up here and go to File > Import > File, and retrieve this shot.
In this case this is shot3 in the Shot3 folder in the Footage folder. Open that, I am going to drag that down, make a new composition, here we go. Let's play it back, see what it looks like. So it's definitely lot of camera shake, much more than other shots. But we're going to apply the Stabilize function of the Tracker tool to get rid of that, so let's go ahead and do that. With the layer selected I'm going to go up to Animation > Track Motion. Tracker opens in the Transform mode. You can see right here it is Track Type: Transform, I want to switch that to Stabilize.
Just like transform tracking I'm going to get a track point. Now because the camera is also rotating left and right, I need to click on the Rotation button down here beside Position, and it gives me two track points. So the idea is to place these two track points of our features in the frame that are visible the entire time. I don't want to place the track points over the actress, she actually moves. I don't want that, I want to be in the scene that does not move on its own chord, therefore the wall is a good candidate. Let's take a look on the less blurry frame, say, frame 10. So this splotch right here is a good feature to pick, and also this bush, let's try that.
I'm going to reposition these track points, going over to the splotch and the second one track point 2 over the bush. Now for the bush I'm going to center it on this leaf at the top that kind of sticks out. I'm also going to make the boxes much larger--the feature box and the search box--and you can make this any of size you want. In this case it's going to help with the accuracy. Now it will slow down the tracking process, but should help us in the situation. So now that we have our track points set we can try to analyze, I'm going to analyze forward from frame 10, and zoom in a bit and just play it back.
So looks like those motion paths are pretty accurate from frame 10 to the end. Let's analyze backwards from frame 10. All right, it looks pretty good, but eventually it does slip off because there is a very heavy motion blur at the beginning. If I zoom into track point 1 you can see that splotch is right here, whereas the track point's over here. Now let's see to another problem we haven't dealt with yet, and that's the fact there's a zoom on this shot. If I play it back to the viewer, you can see it starts closer and ends further away, it's because the lens is changing, how do we deal with that? Well, what we can do is activate Scale for the tracker, scales of third transform we can pick right here. What that will do is when we apply the data we'll animate the position, the rotation and the scale of the layer.
So we definitely want scale in this situation because the track points will get farther and closer apart as do the features we're tracking. Just give it that a try, and start frame 10 go forward, play that back, it looks pretty good, pretty much the same. And you go to frame 10 and go backward. Let me zoom in here. So the track points still slip off for the first few frames. It's okay that we have activated Scale, however, because we still want the scale to be animated. So in terms of first few frames we are going to have to deal with that manually. So let's see where it goes bad.
So frame 4 looks goods, 3 is starting to slip, so I'm going to move this track point to fix frame 3. I'll put it in the center of that streak, which is the blob or the splotch. Here is frame 2, fix that, frame 1 right in the center of that streak, and frame 0 where it's the most far off. All right, that one is fixed. Let's go up to the track point 2. So frame 5 is good, 4 is good, 3 is pretty good, 2 is actually good, 1 is starting start into slip, that's a little harder to see what's going on with the blur, we have to kind of guess where the center of that leaf is.
And now frame 0 which is further soft. All right, so those two motion paths are repaired, now we can try to apply the stabilization. Now it works differently in this case because I want to apply the stabilization to the layer itself and not some another layer. So what I can do is go straight to the Apply button and say yes to X and Y. It jumps back to the Composition view. You'll see that the anchor point position scale and rotation are keyframed for me by the tracker. Now most of the X/Y movement is taking care of the anchor point, let's play it back.
So see what happens is the entire frame has moved in order to keep those features locked in the same place, so those features don't really move, but the frame moves. Now the problem with the black gap we have to deal within a minute. Let's get closer to this to see if the first few frames are still working for us. There is such heavy blur here, it's often very difficult to deal with. Now one thing that happens is there's a little but too much or little too less rotation for the first few frames. So say around frame 4 or 5, it's looking pretty good, after that the plate looks pretty stable.
Before that, though, the rotation is not quite correct, so in that situation we can do is go down to your rotation animation and try to repair these keyframes by hand. So again, let's see where it looks good, maybe frame 2 and on. Now yours might be slightly different. Very small changes to the track points and very small changes to the boxes on those track points can give you different results in tracking. But the idea is to go in and repair the keyframes for changing their values to try to fix in any kind of glitches. So with my version, it's frame 0 and 1, they're not really good.
So let's see frame 2 looks good, so I want to match 2. So I'd go to frame 1, I am going to try to match rotation there. Let's try 0 rotation, okay, it looks pretty good. Let's go down to frame 0, it's already 0 there, so I will try some different numbers, may be negative number, -0.5, but it's a wrong way so how about 0.5 then we'll play it back, not enough back to frame 0. Let's try 1, and it looks pretty good. So now there is now major change in rotation. There's still a lot of blur at the beginning.
That is permanent to the footage. You're not going to be able to get rid of that. But at least you have stabilized the play, so let's play it back. That looks pretty stabilized. Now again, you might have certainly different variation, you might have to spend additional time adjusting rotation keyframes at the beginning, also it's been how you set your track points you might find you have to adjust the scale too. But generally, it's just scale and rotation for a shot like this. So let's deal with the black edge last. We got that gap opening it up, and that's not good. So a great way to fix that is to nest the composition. Let me go up to Composition and make a brand-new composition.
Now I need to match this to the first composition. Now note this size of this project is smaller. This is actually 1280x720, so you need to make sure the composition I make now is the same size, 1280x720, but still has a same frame rate 24 and also duration of 90. So where your first stabilization does not really matter based on the resolution, that seem to be consistent within the project. So I am going to click OK, now I'm going to pull shot3 comp in the Comp1. Now I need to make sure my durations are the same, and I went a little bit too quickly there.
My duration for this project is only 60 frames, so let me go back to Composition > Composition Settings, and make sure to set to 60. So I can change Composition properties at any time. All right, now we have the correct duration, and now the shot3 is nested into Comp1, which is a new composition. At this point I can scale this up, let's say 107% and therefore disguise the black edge. So let's go through the footage and make sure we don't see the edge, and now I have to move this around. That looks pretty good. So now if I play it back, we see the gap a little bit there, right there on this frame.
So I have to move the entire nested comp, move it to the left, and we'll try it again, so there we go. So now we have stabilized play, and aside from the heavy motion blur on the first two or so frames, you cannot tell the camera's ever moving. It's just a great way to take footage you might not otherwise be able to use apply the track over stabilization and stabilize it.