Video Cut API

POST /cut

About this tool

Use the `/cut` route when you need precise FFmpeg trims without re-uploading source files through a drag-and-drop widget. Droid Apps spins up workers that stream your public `video_url`, honor `start` offsets, and emit a new clip whose `duration` matches the seconds you specify in JSON. This matches how modern media microservices operate: declarative payloads, idempotent retries keyed by task IDs, and horizontal scale behind an API key you rotate from the subscription dashboard.

The workflow is intentionally boring in a good way: POST JSON, poll until FFmpeg finishes muxing, then pull the output from the signed download channel returned in the task object. There is no multipart shortcut; that design choice keeps abuse bounded and lets you reuse the same integration for serverless functions, queue workers, or CI smoke tests. Latency tracks input length and codec complexity more than request size, so benchmark with representative Mezzanine files before promising SLAs to end users.

Unlike generic “free online cutters,” this API is contract-driven. Your subscription unlocks sustained QPS, and our observability surfaces attribute failures to specific FFmpeg exit codes when possible. Combine `/cut` with `/silence_process` when you want a second pass that tightens breath gaps, or hand the trimmed asset to `/merge_urls` for stitched highlight reels, all while referencing the identical HTTPS source URL pattern.

Editors who prototype in the hosted form below can copy the synthesized JSON verbatim into curl or axios. Document every parameter for QA: rounding behavior near keyframes, float versus rational timebases, and how audio tracks migrate when trims fall mid-sample. Anchored documentation under this page’s slug explains advanced flags if you graduate beyond start/duration envelopes.

Operational hygiene matters: cache nothing sensitive in query strings, log correlation IDs beside task IDs, and throttle client retries when the API returns capacity errors. FFmpeg is deterministic only when inputs are; if creators deliver variable-frame-rate mobile footage, expect slight drift unless you normalize upstream.

Try it now

How it works

  1. Serialize your trim window

    Collect `video_url`, `start` seconds, and `duration` seconds as JSON-friendly numbers. Confirm the source URL is downloadable over TLS without interactive auth.

  2. Authenticate the POST

    Send `POST /cut` including `Content-Type: application/json` plus `X-API-Key` from your subscription. The body stays tiny because assets stream from remote origins.

  3. Poll async task metadata

    Read `status_url` from the response and GET it periodically until FFmpeg reports completion, surfacing granular states for dashboards.

  4. Fetch the clipped rendition

    Download the processed file from the task’s success payload, then upload to your DAM or object store; our workers garbage-collect according to plan retention.

Frequently asked questions

Will trimming re-encode the whole video?

FFmpeg often re-encodes near the cut points to keep audio and video in sync. Short clips still process quickly; check task logs if you need to know whether streams were copied or transcoded.

Why is my cut a few frames off on phone footage?

Variable frame rate clips from mobile devices can drift at keyframe boundaries. Normalize to constant frame rate upstream if you need frame-accurate edits.

Can I extract several segments in one request?

Each call trims one continuous window defined by start and duration. Cut multiple segments with separate jobs, then merge them with the Video Merge API.

What happens if start time is past the end of the file?

The API rejects the request before processing starts. Check duration with ffprobe or a metadata tool before submitting.

Does audio stay in sync after the trim?

Yes for typical MP4 inputs. If you hear drift, the source may have variable frame rate or unusual timebases; re-encode the master first.

How do I use the Video Cut API?

POST to /cut with a JSON body containing video_url, start, duration and your X-API-Key header. The API returns a task_id; poll GET /task/{task_id} until status is "completed" to retrieve the download_url.

Via the REST API

curl -X POST https://droidapps.one/cut \
  -H "Content-Type: application/json" \
  -H "X-API-Key: YOUR_KEY" \
  -d '{
         "video_url": "https://cdn.example.com/source.mp4",
         "start": 12.5,
         "duration": 30
       }'

Via the MCP server (droidapps-ffmpeg)

const job = await mcp.callTool("submit_job", {
  path: "/cut",
  body: {
    video_url: "https://cdn.example.com/source.mp4",
    start: 12.5,
    duration: 30
  }
})
// Returns: { task_id: "abc123", status: "queued" }

const result = await mcp.callTool("wait_for_task", {
  task_id: job.task_id
})
// Returns: { status: "completed", download_url: "https://..." }