Reframe following a face
track_and_cropReframe video to any aspect ratio while following a face across the timeline, with smooth cropping to keep the subject in frame.
Instructions
Reframe a clip to a new aspect ratio, following a face across the timeline.
The classic use is turning a horizontal interview into a vertical clip that keeps the speaker in frame. The crop path is smoothed before rendering — a crop that snaps frame to frame looks worse than a slightly imperfect one that glides — and clamped so it never runs off the edge of the source.
Call detect_faces first if you want to choose which person to follow, then pass its track_id. With no face found, this falls back to a centre crop unless fallback is 'fail'.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| encode | No | ||
| fallback | No | What to do when no face is found: 'center' crops centrally, 'fail' errors. | center |
| track_id | No | Follow a specific track from detect_faces. Defaults to the main subject. | |
| smoothing | No | How steadily the crop follows the face. 0 tracks exactly and looks jittery; 1 barely moves. The default glides. | |
| input_path | Yes | Path to the source media file. | |
| max_frames | No | ||
| sample_fps | No | ||
| output_path | No | Destination file. If omitted, the output is written into the job's workspace directory and its path is returned by job_result. | |
| aspect_ratio | No | Target shape, e.g. '9:16' for vertical, '1:1' square, '16:9' wide. | 9:16 |
| output_width | No | Scale the reframed result to this width. Height follows the aspect ratio. | |
| min_confidence | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tool | Yes | ||
| job_id | Yes | ||
| status | No | queued | |
| message | No | Job queued. Poll job_status for progress, then job_result. |