Skip to main content

trim_video

ffmpeg

Trim a video or audio file: keep the part between a start and an end time and drop the rest. Use it to cut off an intro, cut off an ending, or pull one clip out of the middle. Pass the input as file_url or file_base64 + filename. 'start' is where the kept part begins and 'end' is where it stops — both accept seconds (12.5) or a clock time ('1:05', '00:01:05.250'). Omit start to keep from the very beginning; omit end to keep through to the end of the file; give at least one of them. 'duration' is an alternative to end (keep that many seconds from start) and is ignored if end is given. An end past the file length is clamped to the real end rather than failing. When the cut starts at 0 — or the input is audio-only — nothing is re-encoded: the result is bit-for-bit the source, produced almost instantly, and keeps the container that was uploaded. A cut starting between keyframes is re-encoded so it begins on exactly the requested frame, and a video re-encode comes back as MP4. A lossless cut ends on a packet boundary, so it can run up to ~0.15s longer than asked.

When to use
Cutting a video or audio file down: removing an intro or outro, or pulling one clip out of the middle. Give start and end, or start and duration.
Not for
Making the clip last a specific length by slowing or speeding it up (retime_video). Removing a region from the picture (blur_video).
Returns
A signed download URL for the trimmed file. A cut starting at 0 is lossless; any other start re-encodes.

Parameters

NameTypeRequiredDescription
file_urlstringnoPublic http(s) URL of the input video or audio file (preferred).
file_base64stringnoBase64 of a small inline input file (<=15MB). Provide 'filename'.
filenamestringnoInput filename incl. extension, e.g. 'clip.mp4'.
startstringnoWhere the kept part begins: seconds ('12.5') or a clock time ('1:05'). Omit to keep from the beginning.
endstringnoWhere the kept part ends, same formats. Omit to keep through to the end of the file.
durationstringnoAlternative to end: keep this many seconds from start. Ignored if end is given.

Example call

JSON-RPC tools/call body (sent to https://convertfleet.com/api/mcp):

{
  "jsonrpc": "2.0", "id": 1, "method": "tools/call",
  "params": { "name": "trim_video", "arguments": {
               "file_url": "https://example.com/input"
             } }
}

Connect first

curl -sN https://convertfleet.com/api/mcp \
  -H "Authorization: Bearer flt_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}'

See the quickstarts for Hermes, Claude, Cursor, OpenClaw, n8n, Zapier and Make.