Advanced Video Editing



After Effects Camera Tracker

 

Camera tracking in AE analyses camera movement in the 2D shot to create a 3D camera space based on the movement of the shot. Essentially, it will try to create the same 3D space that exists in the actual reality of the shot. You can then composite other images that will match the camera motion in the shot.

Start with your camera footage. Make sure that it’s steady enough for AE to track well. A lot of shakiness or motion blur can sometimes cause problems and throw off your tracker.

Import your camera assets into the project.

Create a new Composition:

  • In the Project Panel, drag the clip into the New Composition icon to create a composition that matches the clip size and duration. The New Composition icon appears next to the bin icon. 

  

 

In this example, here's a clip showing a footpath. The camera shot is hand-held so there is some slight motion. When the camera tracker is applied, the clip background and motion will be analysed.







Apply Track Camera to the clip:

With the clip selected, go to 

Animation > Track Camera 

AE will begin to analyse the background in your clip. If you don’t have much RAM in your computer, it might be best not to do anything until the analysing is done.


With the analysis complete, the image will show several dots. These are referred to as 3D track points, representing the relative positions of pixels in three-dimensional space. As you scroll through the clip, you'll notice that the dots will stay in place. These track points will be used to create the 3D place where objects can be placed.

 

In the Project Panel under Effects Controls...

...you'll find the Camera Tracker effects controls. Look under Advanced and you’ll see data for Average Error. Anything below 1 pixel works best in AE. The thing to avoid in doing camera tracking is anything that contains motion blur or glare. Keep it simple. 

However, if you're working from a slower computer, you might try analysing the background by using the Detailed Analysis option. Check the box. It may take a few minutes for the analysis depending on your computer system.

 


In the Effect Controls for 3D Tracker:

Click on 3D Camera Tracker name and move your pointer over the image. As you hover the pointer on top of the image, it will appear as a target, or selection ring, that moves relative to many of the dots. The target is basically a plane that shows the perspectives within the image that exists between multiple points. You can change the size of the target by sliding the Target Size in the effect controls.




 

As you move the target over the tracking points it changes perspective. Essentially, the target grabs onto 3 tracking points to create a plane surface for you to attach things to in your 3D camera space.

You can also create your own target by selecting 3 tracking points. Click on the tracking points, hold shift and click on two more.

Try to place the target so that it matches the perspective. Then right click on the target to show a set of options. We're going to make things easy by selecting the following:

Create Solid and Camera.


 

Look in the timeline and you should see a Solid and a 3D Tracker Camera. The Track Solid is also a 3D layer.


The solid shape will be placed in the image according to the perspective of the camera.



At the bottom of the Composition window, you can click where it says  Active Camera to show other options for viewing the image. Where it says 1 View, you can click to select 4 Views and it will show something that looks like the illustration below:
 


If you scroll through the clip, you will see a representation of the camera moving the same as the camera that was used to take the footage. The solid that you created will imitate the same motion as your camera.

You can then adjust the position and size of the solid to align it with objects in the image to get a sense of the perspective. Select the Track Solid in your Timeline and open up the Transform properties. Adjust the position and rotation to try and match the perspective closer. If you still can’t quite match the solid’s positions with the camera perspective, just undo and try selecting new tracking points.

Then, add a Grid effect to show the perspective. Go to the Effects and Presets search field, type Grid and then drag it to the Track Solid layer. The solid will be replaced by a grid patter that will look something like the illustration below:


Scroll through the clip to observe how the grid moves. It should change along with the changes in the perspective.

Go to the Timeline, select the Track Solid layer and type P to show the Position properties. Click on the Position properties and then copy by clicking Command + C. The position information from the solid can be then be pasted into the position properties of the new image, which will then stick to the solid layer.



Replace the solid with a new image

Let's say you have an image like the one below. It can be anything, but ideally, the image should come with a transparent background. A PNG file works nicely. Or you can make your own in Photoshop.
 




Drag the new image to the top of your timeline layers. Make this image a 3D layer by clicking in the box under the 3D cube.

With the image selected, click P to reveal its Position properties and then click on the Position properties.

Now click Command + V to paste the Position properties from the Track Solid. This will attach the image to the solid, which is attached to the 3D tracking points.

In the Timeline, turn off the Track Solid by clicking the "eyeball" to the left. This will turn off the grid.

Change the size and perspective of the image to match it more closely with the perspective in the background. Scroll the clip and you'll find the image is locked with the camera movement.




Locking text with the camera movement

Instead of an image, add a Text layer and don't forget to set it to a 3D layer.

The position information from the solid can be copied and pasted into the position of the text. The text will then stick to the solid layer.