Motion Worker
Motion Tracking is Easier Than Ever with After Effects 6.x
by Ben Bardens
Motion Tracking has long been one of After Effects’ key selling points, especially for those creating composite and special effects shots. While After Effects motion tracking capabilities have been rock-solid for many versions now, its interface was a little cumbersome to say the least. Track points were defined, frames were analyzed, and keyframe data was recorded all within one window which took up the entire screen. The result was that while you could get a great motion tracking result, it typically took a lot of going back and forth between the motion tracking window, and your composition. With After Effects 6 and 6.5, those days are over.
In this article we’ll do a tutorial that shows the basics of how to set up and use motion tracking. You can download the materials needed to complete the tutorial from http://www.barkanimation.com/guild/13.zip or you can apply the techniques to your own footage. The source footage for this project uses a project that is already animated. If you don’t have After Effects basics down, you may wish to refer back to the tutorials on basic and advanced animation.
Tutorial
Start by examining the contents of the tutorial folder. There is a footage
folder, which contains the source material, and an already completed example
project and rendered final movie for your reference. This tutorial will walk
you through the process to recreate the final movie starting with your own
new project.
Examine the contents of the footage folder. There is a QuickTime movie clip from the Artbeats Transportation collection called TA108.mov(www.artbeats.com). There is also an Illustrator file and animated After Effects project, which references the Illustrator file as source footage.
The TA108 clip shows a crowded freeway scene. In this example we will use motion tracking to attach an animated thought bubble to a car in the scene.
The bubble will animate onto screen (this has already been done in the bubble project file) and then it will move across screen following the car as it travels out of scene. Because the car disappears off the side of the frame we’ll have to do some tricks and modify some settings to get the thought bubble to move beyond the frame’s edge.
Launch After Effects and create a new project by choosing File -> New -> New Project.
Import the following items either by choosing File -> Import,
or by dragging and dropping the files from the desktop into the project window:
Import the TA108.mov file.
Import the bubble1 AEP project file. (There is no need to import the bubble1 AI file as the project file you just imported already references that footage.)
Save the project to the tutorial directory so that it is next to the “footage” folder containing the material you just imported. Make sure to name the file with the .aep file extension for cross-platform compatibility.
![]() Fig. 1 Create a comp that matches your source clip resolution, frame rate and duration. |
Create a new composition that matches the duration and resolution of the TA108 movie by dragging the QuickTime movie onto the New Composition button at the bottom of the project window (see Figure 1).
Take a moment to arrange your windows on your screen so that you can see the project window, comp window and comp timeline window in their entirety all at once. You can choose Window -> Workspace -> One Comp View to arrange your windows and palettes.
Change the current time to time=3:04. (Shortcut: push command-G (Mac) or control-G (PC) to bring up the Go To Time dialog.)
In the project window, expand the bubble1 project folder. Select the bubble1 comp file and drag it to the timeline, placing it above the TA108 layer.
In the timeline window, turn off the video switch (the little eyeball icon) for the bubble layer.
In the timeline window, select the TA108 layer and split the layer by pushing shift-comand-D (Mac) or shift-control-D (PC) or choosing Edit -> Split Layer.
This will cut the footage layer so that it will be easier to apply the motion tracker to just a portion of the source clip.
Select layer 3 (the TA108 layer whose duration ranges from time=3:04 to 5:00). We’ll add some extra space to the sides of the layer by pre-composing the layer and expanding the pre-comp’s size. Choose Layer -> Pre-compose. In the dialog box check Leave All Attributes and Open New Comp and click OK.
Type command-K (Mac) or control-K (PC) to bring up the Composition Settings dialog box. Make sure the Lock Aspect Ratio box is not checked and change the width to 960. Click the Advanced tab and check that the Anchor is set for the center (it will be by default). Click OK. New space will now appear evenly on each side of the composition frame. Note that the color is determined by your Composition -> Background Color setting.
![]() Fig. 2 Comp window / Layer window close box. |
Close the pre-composition by clicking its close box (see Figure 2).
Make sure you are in the TA108 comp (open it if necessary by double-clicking on it in the Project window).
Applying Motion Tracking
Select layer 3. Choose Animation -> Track Motion. Two
things will happen on screen. A new palette appears and the layer window opens
tabbed together with the comp window.
![]() Fig. 3 The Tracker Controls palette. Notice the Motion Target displays the name of the layer that will be receiving the resulting position data, not the name of the source layer. |
There are several settings to modify in order to get the desired motion tracking result. Start in the Tracker Controls palette. Accept the defaults for motion source, current track and track type. Leave Position checked and Rotation un-checked (see Figure 3).
Click on Edit Target. Choose Bubble1 comp as the Motion Target and click OK.
Click on Options. Accept the default settings and click on the Built-in Tracker Options.
For Use Channel, choose how you want After Effects to identify the block of pixels you tell it to track. In our example, I am going to track the yellow pixels in the cars headlight, so I chose RGB. If you are tracking an area of high contrast, choose Luminance. If you want to track an area based on concentrations of color, choose Saturation (see Figure 4). This is useful if you are tracking an object that is similar in color value to its background.
Leave Process Before Match unchecked. This option allows you to apply a blur or sharpen process to the frame before the motion is tracked.
![]() Fig. 4 Tracker options. |
Check Subpixel Positioning to record the most precise Position keyframe data without rounding.
Check Extrapolate Motion if Confidence is Below n%. Specify a value of 90%. This option will allow us to Track the motion beyond the edge of the frame. Because the area we will track is so well defined, we should specify a high percentage for the confidence value. AE will start to extrapolate the position data the moment it can’t find the area of pixels it’s looking for.
Click OK in both windows to return to the Tracker Controls palette. Save the project.
Click within the layer window (tabbed in front of the comp window) to make it active. You’ll see a couple of little gray squares, one inside the other, in the center of the frame. These two squares define and identify the Track Point. The innermost square defines the block of pixels you want After Effects to follow (attempt to locate in each subsequent frame). Generally this box should be pretty small. Ideally, pick an area of pixels that either has a sharp contrast of obvious color value. (This should correspond to your Use Channel setting from before). The outer-most square identifies the area around your block of pixels in which the same block of pixels is likely to be on the next frame. This block travels with the inner block as it moves across the screen. Move the entire group of squares over the headlight on one of the cars toward the top of the frame. Deselect the squares by clicking anywhere off of them, and then reselect and modify each square individually (see Figure 5).
![]() Fig. 5 Motion tracker points in the layer window. Notice the location of the attachment point is separate from the tracker points. |
Keyboard Shortcuts for working in the layer window:
Comma key = zoom out
Period key = zoom in
Space bar = hand tool
Set the attach point––the little cross hairs in the center of the squares––to the location to which you want the anchor point of the target layer to be connected. In this case, place the cross hairs on the head of the driver in the car so that the thought bubble will appear above the driver’s head.
Back in the Tracker Control palette, click the Analyze Forward button (see Figure 3). Sit back and watch the layer window as After Effects steps through the sequence of frames and follows the headlamp of your chosen car. If you chose the same headlamp as I did with the same Track Point regions, you will probably get a clean complete track in the first pass. If the squares start to stray away from the car’s headlamp, or jump wildly to a new location, immediately click the stop button in the Tracker Controls palette, or tap your space bar. Use the Page Up and Page Down keys to step forward/backward and locate the frame where the tracker first goes astray. Simply click anywhere within the Tracker Point group (not on the individual squares) and drag the tracker back to where it should be. Click the Analyze Forward button again to resume the track.
Because we’ve specified the Extrapolate Motion option and widened our layer beyond the composition frame, the tracker will follow the car’s headlamp off camera to our left. After the tracker has stopped, scrub the timeline marker back and forth along the timeline and watch the tracking point in the layer window. When you are happy with the results, click Apply in the Tracker Controls palette.
Close the layer window by clicking its close box.
In the timeline window, select the bubble1 layer. Turn on its video switch and then push the U key to reveal its animated properties. You’ll see an entire row of position keyframes, which were just applied by the tracker. Scrub the time marker along the timeline and you’ll see that the thought bubble tracks with the motion of the car, but we have a problem: the bubble is on top of the car. We’ll offset the thought bubble layer’s anchor point to match up with the Trackers Attach Point, which we set earlier.
In the timeline window, double-click the bubble 1 layer to open its layer window.
In the layer window, toward the bottom right, choose View: Anchor Point Path. Click on the x in the middle of the frame and drag it a little down and left from the smallest bubble. Close the layer window and examine the results in the composition window. If you need to adjust the thought bubble’s location, simply open up its layer window and adjust the anchor point further.
To complete the animation for this layer I simply added a couple opacity
keyframes fading the layer from 100% to 0% between time=4:15 and 5:00.
Save your project and Choose Composition -> Make Movie
to add the movie to the Render Queue. Click Render to output
your QuickTime or AVI movie.
A Final Word
Motion tracking is an extremely powerful feature that opens up lots of possibilities
for adding elements to existing video footage. For additional information
about tracking, as well as stabilizing jittery footage, access the on-line
help by choosing Help -> After Effects Help. When your
browser opens up, click on Search and type in Motion Tracking
or Stabilizing.
Guild member Ben Bardens runs a graphics studio and works as an editor/technical director in the Burbank area. He teaches After Effects and Photoshop at Glendale Community College and can be reached at bbardens@glendale.edu. Find out more about his classes at www.glendale.edu/~bbardens.
[ return to top ]