Deno Deploy + ReelSDK $0.02 per compute minute, first $0.50 free

Render GIF previews from Deno Deploy without spawning ffmpeg

ReelSDK renders the preview for $0.02 per compute minute, so your app ships no ffmpeg and keeps its 768 MB of memory. A 4-second GIF is ready about 4 seconds after the request, and the job keeps going when Deno sends SIGINT because traffic stopped.

  • One fetch from Deno.serve, no binary in the deployment
  • Prefer: respond-async answers at once while the job runs
  • Webhooks verified with crypto.subtle, no npm packages
What Deno 2 prints when there is no ffmpeg to spawn

error: Uncaught (in promise) NotFound: Failed to spawn 'ffmpeg': entity not found

Source: Deno.Command reference

The same job as one call to ReelSDK

Deno.serve(async (req) => {
  const res = await fetch("https://api.reelsdk.com/v1/ffmpeg", {
    method: "POST",
    headers: {
      Authorization: `Bearer ${Deno.env.get("REELSDK_KEY")}`,
      "Content-Type": "application/json",
      Prefer: "respond-async",
    },
    body: JSON.stringify({
      inputs: { "in.mp4": "https://api.reelsdk.com/f/lib/in/seo-int/nasa-vision.mp4" },
      args: [
        "-t", "4", "-i", "in.mp4", "-filter_complex",
        "fps=12,scale=480:-1:flags=lanczos,split[a][b];[a]palettegen[p];[b][p]paletteuse",
        "-loop", "0", "preview.gif",
      ],
      outputs: ["preview.gif"],
      webhook_url: new URL("/reelsdk-webhook", req.url).href,
    }),
  });

  const { job, error } = await res.json();
  return Response.json(res.ok ? { id: job.id, status: job.status } : { error }, { status: res.status });
});
202 with the job id at once; preview.gif is ready about 4 seconds laterTry it

Why ffmpeg breaks here

768 MB, an idle shutdown and nothing to spawn

Deno Deploy runs the standard Deno runtime with --allow-all on Linux x64 and ARM64, and it can spawn subprocesses, but nothing in its runtime docs says ffmpeg is installed. With no binary on the path, new Deno.Command("ffmpeg") fails with NotFound: Failed to spawn 'ffmpeg'. You can ship a static build for the right architecture, and then the decode, the palette pass and the encode all share the app's memory: 768 MB by default, up to 4 GB on Pro.

An app stays up while requests or response bytes flow. After 5 s to 10 min without them it gets SIGINT, then SIGKILL 5 s later, and Deno can also evict an isolate while it is serving traffic. An encode left running after the response can die halfway through a file. With ReelSDK the app makes one short fetch to start the job and handles one POST when the webhook arrives, and Deno counts no CPU time while the app waits on network I/O. Raw ffmpeg jobs cost $0.02 per compute minute, billed by the second.

Deno Deploy next to ReelSDK

Deno Deploy next to ReelSDK
LimitDeno DeployReelSDK
ffmpegNot in the runtime docs, ship your own binaryffmpeg 8.1 on a fresh machine per job
Memory768 MB by default, up to 4 GB on ProA separate machine for every job
LifetimeSIGINT after 5 s to 10 min without traffic, SIGKILL 5 s laterUp to 10 min per job, whatever your app does
BillingMemory billed at 768 MB for every second the app is loaded$0.02 per compute minute, billed by the second
WebhooksVerify with crypto.subtle, no packagesReelsdk-Signature, up to 6 attempts over about 7 h

Deno Deploy limits from Deno Deploy runtime, checked November 2026.

Set it up

Two routes: start the preview, catch the webhook

You need a ReelSDK key and its webhook secret. One file serves both routes: POST /preview starts the job and POST /reelsdk-webhook receives it when it finishes. Both ran under Deno 2 against the live API: the preview route started a job, and the webhook route accepted a signed delivery of it and refused a tampered one.

  1. Add the key and the webhook secret

    In the app's settings, add REELSDK_KEY and REELSDK_WEBHOOK_SECRET as environment variables. The handler reads them with Deno.env.get.

  2. Start the job and verify the webhook

    /preview takes a video URL, sends the GIF arguments to POST /v1/ffmpeg with Prefer: respond-async and builds webhook_url from its own URL, so the same code works on every deployment. /reelsdk-webhook reads the raw body, rejects signatures older than 300 s and checks the HMAC with crypto.subtle.verify. Store the job by its id where the comment sits; a failed delivery is retried with the same Idempotency-Key.

    main.tsTry it
    const API = "https://api.reelsdk.com";
    
    Deno.serve(async (req) => {
      const url = new URL(req.url);
    
      if (req.method === "POST" && url.pathname === "/preview") {
        const { video_url } = await req.json();
        const res = await fetch(`${API}/v1/ffmpeg`, {
          method: "POST",
          headers: {
            Authorization: `Bearer ${Deno.env.get("REELSDK_KEY")}`,
            "Content-Type": "application/json",
            Prefer: "respond-async",
          },
          body: JSON.stringify({
            inputs: { "in.mp4": video_url },
            args: [
              "-t", "4", "-i", "in.mp4", "-filter_complex",
              "fps=12,scale=480:-1:flags=lanczos,split[a][b];[a]palettegen[p];[b][p]paletteuse",
              "-loop", "0", "preview.gif",
            ],
            outputs: ["preview.gif"],
            webhook_url: new URL("/reelsdk-webhook", url).href,
          }),
        });
    
        const { job, error } = await res.json();
        return Response.json(res.ok ? { id: job.id, status: job.status } : { error }, { status: res.status });
      }
    
      if (req.method === "POST" && url.pathname === "/reelsdk-webhook") {
        const body = await req.text();
        const secret = Deno.env.get("REELSDK_WEBHOOK_SECRET")!;
        if (!(await verifyReelsdkSignature(req.headers.get("reelsdk-signature") ?? "", body, secret))) {
          return new Response("invalid signature", { status: 401 });
        }
    
        const job = JSON.parse(body);
        // We save job.status and job.outputs["preview.gif"] for job.id here
        console.log("reelsdk job finished", job.id, job.status);
        return new Response("ok");
      }
    
      return new Response("not found", { status: 404 });
    });
    
    async function verifyReelsdkSignature(header: string, body: string, secret: string) {
      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 encoder = new TextEncoder();
      const key = await crypto.subtle.importKey("raw", encoder.encode(secret), { name: "HMAC", hash: "SHA-256" }, false, ["verify"]);
      const signature = new Uint8Array(parts.v1.match(/../g).map((byte: string) => parseInt(byte, 16)));
      return crypto.subtle.verify("HMAC", key, signature, encoder.encode(`${parts.t}.${body}`));
    }
    
  3. Check it end to end

    POST a video URL to /preview and you get a 202 with the job id. When ffmpeg finishes, ReelSDK POSTs the job to /reelsdk-webhook, which starts the app again if it went idle. Our run produced preview.gif, a 4-second loop 480 px wide.

FAQ

Video on Deno Deploy, answered

Can Deno Deploy run ffmpeg?

Deno Deploy runs with --allow-all and can spawn subprocesses, so a static Linux x64 or ARM64 ffmpeg binary you ship with the app can run. Nothing in the runtime docs says ffmpeg is installed, and a spawned process shares the app's memory, 768 MB by default and up to 4 GB on Pro. Calling ReelSDK over HTTPS skips the binary.

Why does Deno.Command fail with NotFound for ffmpeg?

Deno looks the command up on the PATH, and when there is no ffmpeg it throws error: Uncaught (in promise) NotFound: Failed to spawn 'ffmpeg': entity not found. We reproduced it on Deno 2. Ship a binary and pass its full path, or send the job to ReelSDK.

Does the render keep going after my app answers?

Yes. The job runs on ReelSDK's machines for up to 10 minutes, whatever happens to your app. If the app shuts down in the meantime, the webhook POST starts it again.

How do I verify ReelSDK webhooks in Deno?

Every delivery carries Reelsdk-Signature: t=<unix time>,v1=<hex HMAC-SHA256>. Split out t and v1, reject a t more than 300 s from now, import the secret with crypto.subtle.importKey and call crypto.subtle.verify on t, a dot and the raw body. Retries keep the same Idempotency-Key, <job id>:<status>.

What does a GIF preview cost?

Raw ffmpeg jobs cost $0.02 per compute minute, billed by the second with a 1 s minimum, and failed jobs are free, so a preview that renders in a few seconds costs a fraction of a cent. On the Deno side the two short requests fit easily in the Free plan's 1 million requests and 10 hours of CPU a month.

All integrations

Ready to build?

Ship video from your app today

Your first $0.50 is free, and one key covers every endpoint.

Moonlit lake with a lit cabin under the mountains