Aphelion Editor
Edit this page on GitHub2 — Shape Tracker masks
Track one feature and carry an editable matte with it: an ellipse, a rectangle, or a hand-drawn polygon. This is the fastest way to isolate a moving subject when a full roto is overkill.
You will build: Video Input → Shape Tracker, with Shape Tracker.mask
cutting a replacement into the plate via Merge.
Before you start
Video Input → Viewer, file set tosamples/source.mp4.- Scrub to a frame where the subject is clearly visible.
Steps
- Add a Shape Tracker node (
Tab→Shape Tracker). - Connect
Video Input.frame → Shape Tracker.frame. - Select the node. The control strip shows two rows:
- Row 1: ◄ Track, Track ►, Clear.
- Row 2: Draw polygon, Undo vertex, Clear polygon.
- Drag the tracking point onto a textured part of the subject (a button, a logo, an eye — anything with contrast).
- Set the matte shape in Properties:
Shape → Shape= Ellipse (64-point smooth oval), Rectangle (four corners), or Polygon (your points).Shape → Width/Shape → Height= percent of the frame (default 20).
- For a soft edge, raise
Shape → Feather(0–100 preview pixels). - Press Track ►. Scrub the timeline: the matte follows the track.
Drawing a custom polygon
- Turn on Draw polygon.
- Click around the subject in the viewport. Each click adds a vertex; the outline closes automatically once you have three or more.
- Undo vertex removes the last point; Clear polygon removes them all (without touching the tracked motion).
- Turn Draw polygon off to go back to dragging the tracking point.
Polygon vertices are stored as offsets from the tracked point, in frame percent, so they move with the track. Both vertices and shape edits support Undo/Redo.
Using the mask
The Shape Tracker outputs x, y, valid, confidence, predicted, and
mask (grayscale, matching the preview size, 1 inside the shape).
To drop a replacement inside the shape:
- Add an Image Input with your replacement and a Merge.
- Connect the plate (Video Input) to
Merge.background. - Connect
Image Input.frame → Merge.foreground. - Connect
Shape Tracker.mask → Merge.mask.
To keep only the subject and remove the background, invert the matte:
- Add an Invert Mask node.
- Connect
Shape Tracker.mask → Invert Mask.mask. - Feed
Invert Mask.maskintoMerge.mask(background = new plate, foreground = original footage).
Disabling during a gap
Set Tracking Recovery → During Gaps = Disable Effect During Gap. On a frame
with no valid measurement the Shape Tracker emits an empty mask, so a
downstream Merge shows the background only. Other policies (Hold,
Interpolate, Extrapolate) keep emitting a coordinate so the matte keeps moving.
Troubleshooting
| Symptom | Fix |
|---|---|
| Matte is locked to one spot | The track failed. Re-check the seed is on texture, then re-track |
| Matte dissolves to nothing on some frames | During Gaps is Disable and those frames are gaps — expected. Choose Hold to keep the last position |
| Mask is the wrong size | Width/Height are percents of the frame, not pixels. A value of 20 is 20% wide |
| Feather looks blocky | Feather is in preview pixels; raise it, or raise the Viewer's Proxy Width for a sharper preview |
| Point placed near the frame edge | Supported — the pattern box is clamped to the frame; the point stays on the feature |
Related
- Point tracking — the same engine without a matte.
- Roto and masks — per-vertex animation when a single shape is not enough.
- Shape Tracker reference.