Skip to main content

Ffmpeg Trim

Immutable Catalog Entry

This descriptor comes from the active versioned Portal catalog.

WRITEffmpeg.ffmpeg_trim
  • Contract tier: agent_ready
  • Risk: write
  • Catalog version: 2026-07-12.3
  • Descriptor hash: 331c2757766f591616cc0541816cab9946913ccccb23d8143715d3b452cfd1e6

Use this to create a time-bounded clip from a staged asset. It queues a new output asset between start_sec and end_sec; choose reencode=false only when stream-copy boundary accuracy is acceptable.

Request Body

{
"jsonrpc": "2.0",
"id": "ffmpeg-ffmpeg-trim-example",
"method": "tools/call",
"params": {
"name": "ffmpeg.ffmpeg_trim",
"arguments": {
"asset_id": "asset_id_123",
"start_sec": 1,
"end_sec": 1,
"priority": "",
"reencode": false
}
}
}

Arguments Schema

{
"type": "object",
"required": [
"asset_id",
"start_sec",
"end_sec"
],
"properties": {
"end_sec": {
"type": "number",
"description": "Exclusive clip end time in seconds; it must be later than start_sec."
},
"asset_id": {
"type": "string",
"description": "Stable ID of one staged FFmpeg media asset."
},
"priority": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Optional queue priority configured by the server, such as urgent or batch."
},
"reencode": {
"type": "boolean",
"default": true,
"description": "When true, re-encode for accurate trim boundaries; false requests stream copy."
},
"start_sec": {
"type": "number",
"description": "Inclusive clip start time in seconds."
}
},
"additionalProperties": false
}

Output Schema

{
"type": "object",
"required": [
"job_id",
"cache_hit"
],
"properties": {
"job_id": {
"type": "string",
"description": "Stable ID used with the job readback tools."
},
"cache_hit": {
"type": "boolean",
"description": "Whether a matching completed result was reused."
},
"output_asset_ids": {
"type": "array",
"items": {
"type": "string"
},
"description": "Completed output asset IDs when immediately available from cache."
}
},
"additionalProperties": false
}

Code Examples

curl -X POST 'https://portal.madpanda3d.com/api/mcp' \
-H 'Authorization: Bearer mad_live_***' \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"id": "ffmpeg-ffmpeg-trim-example",
"method": "tools/call",
"params": {
"name": "ffmpeg.ffmpeg_trim",
"arguments": {
"asset_id": "asset_id_123",
"start_sec": 1,
"end_sec": 1,
"priority": "",
"reencode": false
}
}
}'

Example Responses

{
"ok": true,
"message": "Tool ffmpeg.ffmpeg_trim executed successfully.",
"note": "Response shape varies by MCP tool. Inspect live responses for exact fields."
}