Fly.io + ReelSDK $0.02 per compute minute, first $0.50 free
Run ffmpeg on Fly.io, or let a 256 MB Machine hand it off
Send the encode to ReelSDK at $0.02 per compute minute and a 256 MB Fly Machine at $2.19 a month can stop between requests. With ffmpeg in your Dockerfile you size up to shared-cpu-1x with 1 GB at $6.70 a month, and Fly Proxy can still stop it mid-encode.
- apt-get install ffmpeg works if you keep it in-house
- Auto-stop stays on, the webhook starts the Machine again
- Contact sheets, previews and encodes as plain ffmpeg arguments
/bin/sh: 1: ffmpeg: not found
Source: Fly Machine runtime environment
The same job as one call to ReelSDK
import { createHmac, timingSafeEqual } from "node:crypto";
import { createServer } from "node:http";
const PUBLIC_URL = `https://${process.env.FLY_APP_NAME}.fly.dev`;
createServer(async (req, res) => {
const body = await readBody(req);
if (req.method === "POST" && req.url === "/contact-sheet") {
const { video_url } = JSON.parse(body);
const api = await fetch("https://api.reelsdk.com/v1/ffmpeg", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.REELSDK_KEY}`,
"Content-Type": "application/json",
Prefer: "respond-async",
},
body: JSON.stringify({
inputs: { "in.mp4": video_url },
args: ["-i", "in.mp4", "-vf", "fps=1/2,scale=384:-2,tile=5x2:padding=8:margin=8", "-frames:v", "1", "-update", "1", "contact-sheet.jpg"],
outputs: ["contact-sheet.jpg"],
webhook_url: `${PUBLIC_URL}/reelsdk-webhook`,
}),
});
const { job, error } = await api.json();
return send(res, api.status, api.ok ? { id: job.id, status: job.status } : { error });
}
if (req.method === "POST" && req.url === "/reelsdk-webhook") {
if (!verifyReelsdkSignature(String(req.headers["reelsdk-signature"] ?? ""), body, process.env.REELSDK_WEBHOOK_SECRET)) {
return send(res, 401, { error: "invalid signature" });
}
const job = JSON.parse(body);
// We save job.status and job.outputs["contact-sheet.jpg"] for job.id here
console.log("reelsdk job finished", job.id, job.status);
return send(res, 200, { ok: true });
}
send(res, 404, { error: "not found" });
}).listen(3000);
async function readBody(req) {
const chunks = [];
for await (const chunk of req) chunks.push(chunk);
return Buffer.concat(chunks).toString("utf8");
}
function send(res, status, json) {
res.writeHead(status, { "Content-Type": "application/json" });
res.end(JSON.stringify(json));
}
function verifyReelsdkSignature(header, body, secret) {
const parts = Object.fromEntries(header.split(",").map((part) => part.split("=", 2)));
const age = Math.abs(Date.now() / 1000 - Number(parts.t));
if (!/^[0-9a-f]{64}$/i.test(parts.v1 ?? "") || !(age <= 300)) return false;
const expected = createHmac("sha256", secret).update(`${parts.t}.${body}`).digest();
return timingSafeEqual(expected, Buffer.from(parts.v1, "hex"));
}
Why ffmpeg breaks here
Cheap per minute, as long as the Machine stays up
A Fly Machine runs your Docker image, so one apt-get install ffmpeg line gives you a working binary. A started Machine is billed by the second: shared-cpu-1x with 1 GB is $6.70 a month and performance-1x with 2 GB is $33.00, both under a tenth of a cent per busy minute, which beats ReelSDK's $0.02 per compute minute. The cost shows up elsewhere: sizing the Machine for your biggest encode and keeping it alive while it works.
With auto_stop_machines set to "stop", Fly Proxy stops Machines when the app has excess capacity, judged from incoming requests, and starts them again when requests arrive. An encode still running after the response doesn't count as traffic, and once the kill signal goes out, kill_timeout allows 5 s by default and 300 s at most, on a best-effort basis. Turning auto-stop off keeps the Machine, and the bill, running. With ReelSDK the Machine sends and receives JSON, stops between requests, and the webhook POST starts it again.
Fly.io next to ReelSDK
| Limit | Fly.io | ReelSDK |
|---|---|---|
| ffmpeg | apt-get install ffmpeg in your Dockerfile | ffmpeg 8.1 on a fresh machine per job |
| Price | $6.70 a month for shared-cpu-1x with 1 GB, billed by the second | $0.02 per compute minute, billed by the second |
| Idle | Auto-stop on excess capacity; $0.15 per GB a month for a stopped root file system | Nothing runs on your side between jobs |
| Shutdown | kill_timeout 5 s by default, 300 s at most, best effort | Up to 10 min per job |
| Smallest fit | shared-cpu-1x with 256 MB, $2.19 a month | Your Machine only sends JSON |
Fly.io limits from Fly.io resource pricing, checked November 2026.
Set it up
In the image, or a Machine that sleeps
You need a ReelSDK key and its webhook secret for the second option. The server in the fix block above starts renders and verifies the webhook; it ran under Node 22 against the live API, and its webhook route accepted a signed delivery and refused a bad one.
Option A: ffmpeg in the Dockerfile
Add the apt line and size the Machine for your largest encode, for example
shared-cpu-2xwith 2 GB at $13.39 a month. Then keep the request open for the whole encode, or turn auto-stop off so Fly Proxy leaves the Machine running.Dockerfile FROM node:22-slim RUN apt-get update \ && apt-get install -y --no-install-recommends ffmpeg \ && rm -rf /var/lib/apt/lists/* WORKDIR /app COPY . . CMD ["node", "server.js"]Option B: a 256 MB Machine that stops between jobs
When ReelSDK runs the encode,
shared-cpu-1xwith 256 MB is enough. These settings let Fly Proxy stop the Machine when traffic stops and start it on the next request; a stopped Machine costs $0.15 per GB a month for its root file system. SetREELSDK_KEYandREELSDK_WEBHOOK_SECRETwithfly secrets set.fly.toml app = "video-api" primary_region = "ams" [http_service] internal_port = 3000 force_https = true auto_stop_machines = "stop" auto_start_machines = true min_machines_running = 0 [[vm]] size = "shared-cpu-1x" memory = "256mb"Start renders and catch the webhook
/contact-sheetsends the job withPrefer: respond-asyncand gets a 202 at once.webhook_urlpoints athttps://<app>.fly.dev/reelsdk-webhook, built fromFLY_APP_NAME, which Fly sets in every Machine. The webhook is an incoming request, so Fly Proxy starts a stopped Machine for it, and the route checksReelsdk-Signaturebefore it trusts the body. Our run made a 5x2 contact sheet from a 20-second clip, one frame every 2 seconds.
FAQ
Video on Fly.io, answered
Can I run ffmpeg on Fly.io?
Yes. A Fly Machine runs your Docker image, so apt-get install ffmpeg in the Dockerfile works. Give it room for the encode, for example 1 GB on shared-cpu-1x at $6.70 a month or 2 GB on performance-1x at $33.00, billed by the second while it runs.
Why did Fly stop my Machine in the middle of an encode?
With auto_stop_machines set to stop, Fly Proxy stops Machines when the app has excess capacity, judged from incoming requests, so work that continues after the response doesn't keep the Machine up. After the kill signal, kill_timeout allows 5 s by default and 300 s at most. Keep the request open, turn auto-stop off, or run the encode elsewhere.
Is ffmpeg cheaper on Fly.io or on ReelSDK?
Per busy minute, Fly: under a tenth of a cent on shared-cpu-1x with 1 GB or performance-1x with 2 GB, against $0.02 per compute minute on ReelSDK. ReelSDK costs less when encodes are rare and you would otherwise keep a large Machine running, or when you need captions at $0.03 per output minute.
How big a Machine do I need to call ReelSDK?
shared-cpu-1x with 256 MB, $2.19 a month if it ran all month. The Machine sends a URL and your ffmpeg arguments and gets JSON back; ReelSDK pulls inputs of up to 500 MB each straight from their URLs.
Does the webhook wake a stopped Machine?
Yes. With auto_start_machines on, Fly Proxy starts a stopped Machine for the incoming POST. ReelSDK gives each delivery 15 s and retries up to 6 attempts over about 7 hours when the answer isn't a 2xx, so a slow start gets another chance.
The same fix on other platforms
All integrationsSources, checked November 2026
Ready to build?
Ship video from your app today
Your first $0.50 is free, and one key covers every endpoint.
