3

This may be kind of a beginner question, but how do I track the position of an object inside a video and set another video's position accordingly, so that e.g. a circle will be shown on top of a jumping ball? I'm searching for something similar to the tracking with for example the mosaic or blur, but for video footage, not for effects... (A way to copy a mask's path over to another video's position)

Thanks in advance!

3

Right click on your footage layer (either in the comp window or the timeline) and choose track motion from the context menu.

enter image description here

That will open up the layer in the layer viewer

enter image description here

and add a motion tracker to the layer.

enter image description here

It should also open the tracker pallette window. If it doesn't, open it from the window menu. Alternatively if the Tracker pallette is already open you could start tracking the layer by selecting the layer and hitting the Track Motion button in the pallette. Or you could choose Animation>Track Motion from the menu.

enter image description here

In the Tracker Pallette there are a few controls. The Motion Source drop down determines what layer we're tracking, the Current Track drop down lets us choose if there are multiple trackers on the layer (you can have as many as you want), and the Track Type drop down lets us choose what to do with our tracking data when we apply it. You shouldn't have to change any of these for your purposes, but it's good to know what they do.

enter image description here

Transform will apply the tracking data to the positon, rotation and scale properties of the target layer, depending on the checkboxes below. The other modes include stabilise - to use the tracking data to stabilise the layer, or the perspective and parallel corner pin modes which let you apply the track to a corner pin effect on a layer, which is useful when you're doing something like putting in the contents of a screen, or covering a graphic on a wall. Raw tracks just give you the track points as they are, without transferring it to the position/rotation/scale of another layer.

Finally the Edit Target button will determine to which layer the track is applied. This should be the only setting you need to change.

So for your purposes you need just the position checkbox checked. This will give you only one track point. In the layer window drag the trackpoint to the object you're tracking. Find a unique feature if you can, and preferably one that doesn't get obscured. It's also best if the entire area of the trackpoint is on the tracked object, and does not include any background. You can drag the corner handles of the inner box to increase or decrease the size of the tracked point.

enter image description here

The outer box is the search area - it defines where the tracker will look for the trackpoint. Make this box big enough so that the movement between frames will fit into it, but no bigger than you have to: making it too big will not only make the tracker go much more slowly, but can also cause false positives, where it sticks to something else in the frame that looks similar. If it's too small however the tracker will lose the trackpoint. You can stop and adjust it as you go, that is often the best way.

The little cross is the actual attach point. It is the point whose movement the tracker will output to the target. It doesn't have to be inside the track box - sometimes this can be useful if you're tracking something that gets obscured.

So once you've adjusted the tracked area, the search area, and the track point if necessary, hit the track forward (or backward, it works bothe ways) button and the tracker will start its magic.

enter image description here

You can as I said start and stop the tracker and if it goes wonky you can go back to the last good frame, adjust it and start again. If you hold the alt key when you move the track box it will move the track box without moving the attach point, meaning that you can keep the motion of the track point stable while changing the part of the image you're tracking. This is very useful for tracks where the track point is obscured.

enter image description here

Weirdly enough in this shot the next zebra appears exactly where the first one was. But as you can see, the motion tracker has nicely followed the zebra's nose to the edge of frame.

Now it's time to apply this track to something. Choose the layer you want to apply the track data to by hitting Edit Target. This will bring up this dialog - as you can see you can either use the track data to move a layer, or to move a point control for an effect (of course with expressions you can also use the data for anything your heart desires, but that's beyond the scope of this answer).

enter image description here

Choose the layer and hit OK, then hit Apply to apply the data. You'll get asked if you want to apply the data to x and/or y, and then the tracking data will be written to the position property of the target layer.

enter image description here enter image description here

0

I am a bit late to the party, but If I understand you correctly, you are trying to convert an AE mask path to position data for a layer?

The easiest way to achieve this is to create a temporary keyframe on the Mask, select and copy the keyframe (CTRL + C), create another temporary keyframe on the Position effect, then select the keyframe and paste (CTRL + P) to replace it. This converts mask data to position data.

You can also use the Motion Tracker in AE (or 3D Camera Tracker for CS6+) for tracking footage elements accurately. Hope this helps!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.