Video operation

Trim video to a frame-accurate clip, no ffmpeg to bundle.

Trim video to a clip that ends on the exact frame — Fotovid handles the keyframes so the boundaries stay clean. The drop-in ffmpeg microservice hands you a hosted MP4 URL.

curl -X POST https://api.fotovid.co/v1/video/trim \
  -H "Authorization: Bearer p6_YOUR_KEY_ID:YOUR_SECRET" \
  -H "Content-Type: application/json" \
  -d '{
    "source_url": "https://cdn.yoursite.com/recording.mp4",
    "params": {
      "start": "00:00:05",
      "end": "00:00:20"
    }
  }'

Trimming video on serverless is harder than it looks

Cutting a clip sounds like one ffmpeg command, but running that command on Vercel, Lambda, or Workers means shipping a 70MB+ static binary, fighting cold starts and memory limits, and streaming the input in and the output somewhere it can live. Frame-accurate cuts force a re-encode, which pushes CPU and execution time past what most serverless functions allow. You end up maintaining infrastructure that has nothing to do with your product.

  • ffmpeg binaries blow past serverless bundle-size and memory limits
  • Frame-accurate trimming requires a re-encode — slow, CPU-heavy work functions time out on
  • You still have to handle downloading the input and hosting the resulting clip
  • Reach for this endpoint when you need clean highlight clips, social cuts, or short previews without owning a media pipeline

Request parameters

POST /v1/video/trim

FieldTypeDefaultDescription
source_url*string (URL)HTTPS URL of the source video
params.start*string | number"HH:MM:SS(.mmm)" or seconds (e.g. 5.5)
params.end*string | numberMust be greater than start; truncated at EOF
How it works

Your first call in three steps

  1. 1
    Get a free API key

    Sign up and create a key from the dashboard. You authenticate by sending an Authorization: Bearer p6_<key_id>:<secret> header. Every new account starts with free usage credits, and $1 buys 100 credits — a trim costs one credit per call.

  2. 2
    Call POST /v1/video/trim

    Send a request to https://api.fotovid.co/v1/video/trim with a JSON body containing source_url (the HTTPS URL of your input video) and a params object holding start and end. Both accept either an HH:MM:SS.mmm timestamp or a plain number of seconds; the cut is frame-accurate over the half-open [start, end) range and re-encoded to MP4 with x264.

  3. 3
    Use the returned clip URL

    The response is flat JSON with id, type, a fotovid-hosted url for the trimmed MP4, an expires_at, and the clip duration. Download the file and store your own copy so you control where it lives — then serve it, attach it, or pass it to the next step in your workflow.

Frequently asked questions

Ship it with one API call

Grab a free key and make your first call in under five minutes.