trim_media
Cut a segment from a video or audio file using stream copy by default, or re-encode for accurate cuts.
Instructions
Cut a segment from a video or audio file. Uses stream copy without re-encoding by default, or re-encodes when accurate cuts are needed.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| endTime | No | Optional end timestamp formatted as 'HH:MM:SS' or seconds. Do not combine with duration. | |
| duration | No | Optional duration in seconds from startTime (e.g. '30'). If neither endTime nor duration is set, trims to end of file. | |
| inputPath | Yes | Path to the source media file to cut. | |
| startTime | Yes | Start timestamp formatted as 'HH:MM:SS' (e.g. '00:01:30') or seconds (e.g. '90'). | |
| outputPath | Yes | Destination path for the trimmed output file (e.g. './clip.mp4'). | |
| accurateReencode | No | Re-encode video for cuts between keyframes. Default: false (uses fast stream copy). |