Trim a clip
trimRemove unwanted segments from video or audio files. Use stream-copy for near-instant cuts or re-encode for frame-accurate trimming.
Instructions
Cut a segment out of a video or audio file.
Stream-copies when the source codecs allow it, which is near-instant but snaps the cut to the nearest keyframe; pass mode='reencode' when the in and out points must be frame-accurate. The finished job reports the output's actual duration so you can confirm what you got.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| end | No | Out point in seconds; null means EOF. | |
| mode | No | 'copy' remuxes without re-encoding: near-instant, but cuts snap to the nearest keyframe. 'reencode' is frame-accurate but slower. 'auto' uses copy when the codecs allow it. | auto |
| start | No | In point, seconds from file start. | |
| encode | No | ||
| input_path | Yes | Path to the source media file. | |
| 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. |
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. |