RenderIO
Concepts

How It Works

Understand the architecture behind RenderIO - how FFmpeg commands are submitted, processed in secure sandboxes, and how results are delivered.

How It Works

RenderIO is an FFmpeg-as-a-Service API built on Cloudflare Workers. You send an FFmpeg command over HTTP, and RenderIO executes it in a secure cloud sandbox. Output files are stored automatically, and you get rich metadata back with every result.

Architecture

RenderIO runs entirely on the Cloudflare network. There are no traditional servers or VMs to manage. The stack consists of:

  • Cloudflare Workers handle incoming API requests and orchestrate processing
  • Cloudflare Sandbox containers provide isolated FFmpeg execution environments
  • D1 (SQLite at the edge) stores command metadata, file records, and account data
  • R2 (object storage) stores input and output media files

Request lifecycle

When you submit an FFmpeg command, here is what happens step by step:

POST /api/v1/run-ffmpeg-command
         |
         v
  1. Worker receives the request
         |
         v
  2. Validates input and inserts a record into D1 (status: QUEUED)
         |
         v
  3. Returns a command_id immediately (your HTTP request completes here)
         |
         v
  4. In the background:
     a. Spawns a Cloudflare Sandbox (secure container with FFmpeg installed)
     b. Downloads your input files into the sandbox
     c. Runs your FFmpeg command
     d. Uploads output files to R2 storage
     e. Extracts metadata from each output via ffprobe
     f. Updates the command status in D1 (SUCCESS or FAILED)
     g. Optionally delivers a webhook to your server

Async by design

Processing is fully asynchronous. The API returns immediately with a command_id after the command is accepted. Your HTTP connection is never held open while FFmpeg runs. This means:

  • Fast response times (typically under 100ms for the initial request)
  • No HTTP timeout concerns, even for long-running FFmpeg operations
  • You can submit commands and retrieve results on your own schedule

To get the result, you either poll the command status endpoint or configure a webhook to be notified when processing completes.

# Submit a command
curl -X POST https://renderio.dev/api/v1/run-ffmpeg-command \
  -H "X-API-KEY: ffsk_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "input_files": { "in_video": "https://example.com/input.mp4" },
    "output_files": { "out_video": "output.mp4" },
    "ffmpeg_command": "-i {{in_video}} -c:v libx264 {{out_video}}"
  }'

# Response (returned immediately)
# { "command_id": "550e8400-e29b-41d4-a716-446655440000" }

# Poll for status
curl https://renderio.dev/api/v1/commands/550e8400-e29b-41d4-a716-446655440000 \
  -H "X-API-KEY: ffsk_your_api_key"

Automatic metadata extraction

Every output file is automatically analyzed with ffprobe after FFmpeg finishes. This gives you detailed information about the result without making additional API calls:

  • Duration, dimensions, frame rate
  • Codec, pixel format, file format
  • Video and audio bitrates
  • Sample rate, audio channels
  • File size in megabytes

This metadata is included in the command poll response and in the file detail endpoint.

Security and isolation

Each command runs in its own isolated Cloudflare Sandbox container. Sandboxes are:

  • Ephemeral - created for one command and destroyed after completion
  • Isolated - no shared state between commands or users
  • Sandboxed - restricted network and filesystem access within the container

Your FFmpeg commands cannot access other users' data, and the sandbox is cleaned up automatically after processing completes.

  • Quickstart -- run your first FFmpeg command in under 2 minutes
  • Async Processing -- deep dive into the submit-and-poll execution model
  • Command Types -- single, chained, and batch processing options

On this page