Railway + ReelSDK $0.02 per compute minute, first $0.50 free
Install ffmpeg on Railway, or send the encode to ReelSDK
ReelSDK runs the encode for $0.02 per compute minute, or one variable puts ffmpeg in your Railway image at $20 per vCPU and $10 per GB of memory a month. Send the job out when encodes would block your web service, need captions or outlast the 5 min a request may go without data.
- RAILPACK_DEPLOY_APT_PACKAGES=ffmpeg if you keep it in-house
- A 280 s wait fits inside the 5 min idle window
- Outputs served from ReelSDK for 7 days, not from your egress
/bin/sh: 1: ffmpeg: not found
Source: Railpack, installing packages
The same job as one call to ReelSDK
import { createServer } from "node:http";
createServer(async (req, res) => {
if (req.method !== "POST" || req.url !== "/compress") {
res.writeHead(404).end();
return;
}
const chunks = [];
for await (const chunk of req) chunks.push(chunk);
const { video_url } = JSON.parse(Buffer.concat(chunks).toString("utf8"));
const api = await fetch("https://api.reelsdk.com/v1/ffmpeg?wait=280", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.REELSDK_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
inputs: { "in.mp4": video_url },
args: [
"-i", "in.mp4", "-vf", "scale=-2:720", "-c:v", "libx264", "-preset", "medium", "-crf", "28",
"-c:a", "aac", "-b:a", "96k", "-movflags", "+faststart", "compressed.mp4",
],
outputs: ["compressed.mp4"],
}),
});
const { job, error } = await api.json();
res.writeHead(api.status, { "Content-Type": "application/json" });
res.end(JSON.stringify(api.ok ? { id: job.id, status: job.status, video: job.outputs["compressed.mp4"] ?? null } : { error }));
}).listen(Number(process.env.PORT ?? 3000));
Why ffmpeg breaks here
Cheaper per busy minute, until the encode gets in the way
Railpack builds the image, and RAILPACK_DEPLOY_APT_PACKAGES=ffmpeg installs ffmpeg into the final container. RAILPACK_BUILD_APT_PACKAGES only reaches the build image, so code that shells out to ffmpeg then fails with /bin/sh: 1: ffmpeg: not found and exit code 127. Once it's installed, Railway charges for what the service uses: $0.000463 per vCPU and $0.000231 per GB of memory a minute. Two vCPU and 2 GB busy for a minute cost under a fifth of a cent, far below ReelSDK's $0.02 per compute minute.
The trade shows up around the encode. A public request runs for up to 15 min while data keeps moving and closes after 5 min without any, so a long synchronous encode needs a job queue of its own. A burst of encodes competes with your web server for the same vCPUs and memory, and every download you serve counts against $0.05 per GB of egress. ReelSDK runs each job on its own machine, keeps the outputs for 7 days at their own URLs, and does captions, transcription and voiceover in the same API.
Railway next to ReelSDK
| Limit | Railway | ReelSDK |
|---|---|---|
| ffmpeg | Missing until RAILPACK_DEPLOY_APT_PACKAGES=ffmpeg | ffmpeg 8.1 on a fresh machine per job |
| Public request | 15 min while data moves, closed after 5 min without data | A request can wait up to 300 s, webhooks cover the rest |
| Request body | Must finish uploading within 5 min | Inputs by URL, up to 500 MB each |
| Price | $20 per vCPU and $10 per GB of memory a month | $0.02 per compute minute, billed by the second |
| Egress | $0.05 per GB | Outputs served from ReelSDK for 7 days |
Railway limits from Railway public networking limits, checked November 2026.
Set it up
Install it, or call it
Both options take a few minutes. Install ffmpeg when encodes are small and steady; call ReelSDK when they are big, bursty or need captions. The server in the fix block above is the ReelSDK option, and it ran under Node 22 against the live API.
Option A: install ffmpeg with Railpack
Add the variable to the service and redeploy. Railpack installs deploy packages into the final image, so
spawn("ffmpeg")finds the binary at runtime and the encode runs on the service's own vCPU and memory.Service variables - RAILPACK_DEPLOY_APT_PACKAGES
- ffmpeg
Option B: send the encode to ReelSDK
Add
REELSDK_KEYto the service variables and deploy the server above. It takes a video URL, sendsPOST /v1/ffmpeg?wait=280and answers with the result; 280 s stays under the 5 min Railway allows a request without data. A 7.1 MB 1080p clip comes back as a 720p mp4 of about 1.5 MB.Service variables - REELSDK_KEY
- Your ReelSDK API key
Hand long jobs to a webhook
Renders that can outlast the wait go async: send
Prefer: respond-asyncand awebhook_urlbuilt fromRAILWAY_PUBLIC_DOMAIN, which Railway sets to the service's public domain. ReelSDK answers 202 at once and POSTs the finished job, giving each delivery 15 s and up to 6 attempts over about 7 h. The webhook route on the Fly.io page is plain Node and runs on Railway as it is.
FAQ
Video on Railway, answered
Can I run ffmpeg on Railway?
Yes. Set the RAILPACK_DEPLOY_APT_PACKAGES variable to ffmpeg on the service and Railpack installs the apt package into the final image. Encodes then run on the service's own vCPU and memory, at $20 per vCPU and $10 per GB of memory a month.
Why does Railway say ffmpeg: not found after I installed it?
RAILPACK_BUILD_APT_PACKAGES installs packages for the build only, so the running container has no binary, and a shell call fails with /bin/sh: 1: ffmpeg: not found and exit code 127. Move ffmpeg to RAILPACK_DEPLOY_APT_PACKAGES and redeploy.
Is ffmpeg cheaper on Railway or on ReelSDK?
Per busy minute, Railway: 2 vCPU and 2 GB cost under a fifth of a cent a minute, against $0.02 per compute minute on ReelSDK. ReelSDK earns its price when encodes would block your web service or outlast a request, when you need captions or voiceover, and when downloads would otherwise run through your $0.05 per GB egress.
How long can a Railway request wait for an encode?
A public request can run for up to 15 minutes while data keeps moving, and Railway closes it after 5 minutes with no data. Request bodies must finish uploading within 5 minutes. A ?wait=280 call stays inside that; longer renders should go async with a webhook.
How do I receive ReelSDK webhooks on Railway?
Build webhook_url from RAILWAY_PUBLIC_DOMAIN and send Prefer: respond-async. ReelSDK POSTs the finished job with a Reelsdk-Signature header and an Idempotency-Key of <job id>:<status>, and retries up to 6 attempts over about 7 hours, 15 s each.
The same fix on other platforms
All integrationsReady to build?
Ship video from your app today
Your first $0.50 is free, and one key covers every endpoint.
