Run FFmpeg from AWS Lambda
A Lambda function stops at 15 minutes and about 6 vCPU, with no GPU. Your handler sends the FFmpeg command to Rendobar instead: no layer, no /tmp, and the job runs for hours.
- Guide
- FFmpeg API
- Updated
- November 2026
import { createClient } from "@rendobar/sdk";
const rb = createClient({ apiKey: process.env.RENDOBAR_API_KEY! });
export const handler = async (event: { videoUrl: string }) => { // The video goes to Rendobar by URL: no FFmpeg layer, no /tmp. const job = await rb.jobs.create({ type: "ffmpeg", params: { command: `ffmpeg -i ${event.videoUrl} -c:v libvpx-vp9 out.webm` }, });
// Returns in milliseconds. The finished job arrives on your webhook. return { statusCode: 202, body: JSON.stringify({ jobId: job.id }) };};Versus
Lambda function vs Rendobar
| Topic | Lambda function | |
|---|---|---|
| CPU | About 6 vCPU 1 vCPU per 1,769 MB of memory | 64 cores |
| Memory | 10 GB | 336 GB |
| Longest run | 15 min A hard limit AWS won't raise | 9 hours On Pro and Studio. 1 hour on Free. |
| Disk | 10 GB of /tmp Kept between warm invocations | 512 GB Per job |
| Video in | 6 MB payload The video has to round-trip through S3 | A URL Inputs up to 10 GB on Pro and Studio |
AWS figures from the Lambda quotas page, checked 15 November 2026.
Lambda has no GPU. An NVENC command runs on one of these, on Pro and Studio.
NVIDIA L4
- Memory
- 24 GB
- NVENC engines
- 2
NVIDIA L40S
- Memory
- 48 GB
- NVENC engines
- 3
NVIDIA RTX PRO 6000
- Memory
- 96 GB
- NVENC engines
- 4
How
How it works
Add two environment variables
Set your Rendobar API key and webhook secret on the function, then register the webhook at the second function's URL.
Lambda function, environment variables - RENDOBAR_API_KEY
- rb_••••••••
- RENDOBAR_WEBHOOK_SECRET
- ••••••••
The handler sends the job
That's the code at the top of this page. It passes the video's URL and returns in milliseconds, so the function never needs an FFmpeg layer, /tmp or more than the smallest memory size. Any command from the recipes works the same way.
What rb.jobs.create returns - id
- job_8f2c41d07a6e4b19
- type
- ffmpeg
- status
- waiting
Hear when it's done
When the job finishes, a second function behind a function URL gets a signed job.completed event with the output's URL.
webhook.ts (Lambda behind a function URL) import { verifyWebhook } from "@rendobar/sdk/webhooks";type FunctionUrlEvent = { body: string; headers: Record<string, string> };export const handler = async (event: FunctionUrlEvent) => {const secret = process.env.RENDOBAR_WEBHOOK_SECRET!;const ok = await verifyWebhook(event.body, new Headers(event.headers), secret);if (!ok) return { statusCode: 401, body: "Bad signature" };const { event: type, data } = JSON.parse(event.body);if (type === "job.completed") {// data.output.file.url is the finished WebM. Save it with your own code.await saveVideo(data.jobId, data.output.file.url);}return { statusCode: 200, body: "ok" };};
FAQ
Frequently asked questions
Can you run FFmpeg on AWS Lambda?
Within its limits: 15 minutes, about 6 vCPU and no GPU, with the video passing through S3 and /tmp. Anything longer, larger or on NVENC stops there. Send the command to Rendobar's FFmpeg API from the handler instead, and the job runs for up to 9 hours.
Why does FFmpeg on Lambda fail with “Task timed out after 900.00 seconds”?
Lambda stops every invocation at 15 minutes, and AWS won't raise it. A Rendobar job isn't bound by it: the handler returns as soon as the job is created, and the encode runs for up to 9 hours on Pro and Studio.
Why does FFmpeg on Lambda say “No space left on device”?
/tmp holds at most 10 GB, and files left there survive into the next warm invocation, so the input and the output together run out of room. A Rendobar job gets 512 GB of its own disk.
How big is the FFmpeg binary for a Lambda layer?
The BtbN linux64-gpl static build unpacks to 140 MB, measured on 20 August 2026. That is 56% of the 250 MB a function and its layers may hold. Sending the command to Rendobar needs no layer at all: the handler only imports the SDK.
Does Lambda support NVENC?
No. Lambda has no GPU in any form, so h264_nvenc, hevc_nvenc and av1_nvenc can't run there. Rendobar runs them on an NVIDIA L4, L40S or RTX PRO 6000, on Pro and Studio.
What does it cost?
Jobs are billed per second of compute. A VP9 transcode we measured used 2.2 cores for 6.1 seconds and cost $0.0071. Every account starts with $5 of free credit and no card, and Rendobar bills nothing while you're not running jobs. Plans are on the pricing page.
Your command. Our infrastructure.
Bring your own commands. Run them on scalable CPU and GPU infrastructure, and pay only for compute time.
