trim_media
Cut a specific segment from a video or audio file using start and optional end or duration. Uses stream copy by default or re-encoding for accurate keyframe 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.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"inputPath": "<inputPath>",
"outputPath": "<outputPath>",
"startTime": "<startTime>"
},
"name": "trim_media"
}
}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). |