Motion tracking workflow

The implicit first step of any workflow is to determine the result that you want to achieve before you begin. What type of motion will you track, and what will you apply the tracking data to?

As with many workflows in the real world, you may have to repeat some of these steps. You can track a layer as many times as desired and apply any combination of tracking results.

1. Set up the shot

For motion tracking to go smoothly, you must have a good feature to track, preferably a distinctive object or region.

For best results, prepare the object or region that you are tracking before you begin shooting. Because After Effects compares image data from one frame to the next to produce an accurate track, attaching high-contrast markers to the object or region lets After Effects more easily follow the motion from frame to frame. Lightweight, brightly colored balls (such as ping-pong balls) placed on the feature work well, in part because their appearance is the same from all angles. The number of markers that you use corresponds to the number of points you are tracking. For example, if you’re tracking four points using the Perspective Corner Pinning option, you’ll track four features, to correspond to the four corners of the layer to attach. The more markers you add to your subject before shooting, the more features you’ll have for tracking—but the more items you may have to remove later from the image with the Clone Stamp tool. You don’t need to add a marker for each feature if a distinctive object or region is already at the appropriate location.

If you’re tracking a large object or the set itself—such as for matchmoving—you can get good results by using a grid of uniformly spaced triangles of a uniform size as tracking markers.

2. Add the appropriate number of track points

When you choose a mode from the Track Type menu in the Tracker panel, After Effects places the appropriate number of track points in the Layer panel for that mode. You can add more track points to track additional features with one tracker.

3. Select features to track, and place feature regions

Before you begin tracking, view the entire duration of the shot to determine the best features to track. What is clearly identifiable in the first frame may later blend into the background because the angle, lighting, or surrounding elements have changed. A tracked feature may disappear off the edge of the frame or be obscured by another element at some point in the scene. Though After Effects can extrapolate the motion of a feature, your chances for successful tracking are highest if you step through the entire shot to select the best candidates for tracking.

A good tracked feature has these characteristics:

  • Visible for the entire shot

  • A contrasting color from the surrounding area in the search region

  • A distinct shape within the search region

  • A consistent shape and color throughout the shot

4. Set the attach point offset

The attach point is where the target layer or effect control point will be placed. The default attach point position is in the center of the feature region. You can move the attach point to offset the position of the target relative to the position of the tracked feature by dragging the attach point in the Layer panel before tracking.

For example, to animate a cloud above a person’s head, position the feature region on the head and move the attach point above the head. If you left the attach point centered in the feature region, the cloud would be attached to that point and would obscure the head.

Attach point centered in feature region

Attach point offset from feature region

5. Adjust the feature region, search region, and tracking options

Place each feature region control tightly around its tracked feature, completely enclosing the tracked feature, but including as little of the surrounding image as possible.

The size and position of the search region depend on the movement of the feature you want to track. The search region must accommodate the movement of the tracked feature, but only the frame-to-frame movement, not its movement throughout the shot. As After Effects locates the tracked feature in a frame, both the feature region and search region move to the new location. Therefore, if the frame-to-frame movement of the tracked feature is gradual, then the search region needs to be only slightly larger than the feature region. If the feature changes position and direction quickly, then the search region needs to be big enough to encompass the largest position and direction change in any pair of frames.

You can also set tracking options that determine such things as which color channels are compared to find a match to the feature region.

6. Analyze

You perform the actual motion tracking step by clicking one of the Analyze buttons in the Tracker panel. When tracking a tricky set of features, you may want to analyze a frame at a time.

7. Repeat as necessary

Because of the changing nature of an image in motion, automatic tracking is rarely perfect. In moving footage, the shape of a feature changes, along with the lighting and surrounding objects. Even with careful preparation, a feature generally changes during a shot and at some point no longer matches the original feature. If the change is too great, After Effects may not be able to track the feature, and the track point will wander or drift.

When the analysis begins to fail, return to the frame where tracking was still accurate and repeat steps 5 and 6: adjust and analyze.

8. Apply tracking data

If you’re using any Track Type setting other than Raw, you apply tracking data by clicking Apply, after making sure that the correct target is shown for Motion Target. You apply tracking data from a Raw tracking operation by copying keyframes from the trackers to other properties or by linking properties with expressions.

You can also adjust the Attach Point or Attach Point Offset property after tracking in the Timeline panel, which can be useful when applying the same tracking data to multiple targets that you want to distribute around the tracked feature.
Note: If the layer that you’re attaching has motion blur enabled, make sure that the Shutter Phase value is set to -1/2 times the Shutter Angle value. This combination of settings centers the motion blur on the attach point. Otherwise, the attached object may appear to lead or lag the object that it’s attached to.
You can apply the tracking data to a null object layer and parent the layer that you want to animate to the null object layer.