For Vercel & Next.js

Running FFmpeg on Vercel? You will hit a wall.

A serverless function is built for a quick request, not a CPU-bound video encode. Bundle FFmpeg into it and it works for a three-second clip, then times out on anything real. The fix is not a bigger function: keep it thin and call a hosted FFmpeg API that returns a finished file URL.

Four walls, and you hit them fast.

None of these are bugs you can configure away. They are what a serverless platform is, by design.

Execution timeout

Functions cap at 10s on Hobby and up to 300s on Pro. A 1080p encode blows past that mid-render, and the client gets a 504.

250 MB bundle

ffmpeg-static alone adds ~80 MB toward the 250 MB unzipped limit, before your own dependencies.

Ephemeral /tmp

/tmp is the only writable path, capped at 512 MB and wiped between invocations. No place to stage large files.

CPU only, cold starts

No GPU, and a cold start spins FFmpeg up from scratch on every burst. Slow encodes, unpredictable latency.

Keep the function thin. Move the encode off Vercel.

Your route handler does one cheap thing: it forwards the input and typed options to KinoPipe and returns the result. The encode runs on managed FFmpeg 9 workers, off your function's timeout and off your Vercel bill.

THE WALL: FFMPEG INSIDE THE FUNCTION
// app/api/reframe/route.ts
import ffmpegPath from 'ffmpeg-static'   // ~80 MB in the bundle
import { execFile } from 'node:child_process'

export async function POST(req: Request) {
  // write upload to /tmp (512 MB, ephemeral)…
  // spawn ffmpeg for a 1080p encode…
  // …and time out at 10s. Or OOM. Or cold-start slow.
}
THE FIX: CALL KINOPIPE, RETURN A URL
// app/api/reframe/route.ts
export async function POST(req: Request) {
  const { url } = await req.json()
  const res = await fetch(
    'https://kinopipe.com/api/v1/tools/resize-video',
    {
      method: 'POST',
      headers: {
        Authorization: `Bearer ${process.env.KINOPIPE_API_KEY}`,
        'Content-Type': 'application/json',
      },
      body: JSON.stringify({
        inputs: [{ id: 'main', url }],
        options: { aspect_ratio: '9:16', fit: 'cover' },
      }),
    },
  )
  return Response.json(await res.json()) // finished file URL
}

8.2s

p50 render for a 1080p H.264 edit

100%

success rate across 325 benchmark runs

<1s

time your Vercel function spends

FFmpeg 9 render benchmark, August 2026: cold, warm and burst phases on production recipes.

Three ways to call it from your Vercel app.

Prebuilt tool endpoints
38 focused endpoints for common edits: POST /api/v1/tools/compress-video and friends. One fetch from a route handler.
Composable jobs
Combine up to 12 operations on up to 6 inputs in one recipe with POST /api/v1/jobs, with signed uploads for local files.
Remote MCP
Building an AI feature? Connect once with OAuth 2.1 and your agent discovers every editing tool with typed schemas.

FFmpeg on Vercel, answered

Can you run FFmpeg on Vercel?

You can bundle a static FFmpeg binary into a Vercel Function and it will run for tiny, short clips. Real work breaks: serverless functions time out (10s on Hobby, up to 300s on Pro), the deployment bundle is capped at 250 MB unzipped, /tmp is the only writable path and is ephemeral, and there is no GPU. The reliable pattern is to keep your function thin and call a hosted video API for the actual encode.

Why does FFmpeg fail in a Vercel serverless function?

Four walls, usually in this order: the function times out mid-encode; ffmpeg-static adds ~80 MB toward the 250 MB bundle limit; /tmp fills up or is wiped between invocations because it is ephemeral; and cold starts plus CPU-only workers make a 1080p encode slow and expensive. A function is built for a quick request, not a long CPU-bound render.

How do I process video from a Next.js app on Vercel?

Do not run the encode in the function. From a route handler, POST the input URL and typed options to KinoPipe, then return the job or the finished file URL. The function stays under a second; the encode runs on managed FFmpeg 9 workers off your Vercel bill.

Is this only for Vercel?

No. The same limits apply to Netlify Functions, AWS Lambda and Cloudflare Workers: short timeouts, small bundles, ephemeral disk, no GPU. KinoPipe is called the same way from any of them with a single HTTP request.

How is it priced?

One credit covers one second of worker time or a fixed slice of output; the higher rounded-up total applies. The free plan includes 100 credits with no credit card, and failed jobs are refunded automatically.

Ship the video feature, skip the FFmpeg infrastructure.
100 free credits, no credit card. One fetch from your Vercel function and you get a finished file back.
Start for free