Raw FFmpeg

The raw.ffmpeg job type lets you execute arbitrary FFmpeg commands through the Rendobar API. This gives you full FFmpeg power while Rendobar handles file transfer, execution isolation, timeout enforcement, and output upload.

Raw FFmpeg is available on Starter plans and above.

How it works

When you submit a raw.ffmpeg job, Rendobar:

  1. Validates your command against a whitelist of allowed flags.
  2. Downloads your input files to a sandboxed execution environment.
  3. Substitutes input references in your command with local file paths.
  4. Executes the FFmpeg command inside an isolated container.
  5. Uploads the output to R2 storage.
  6. Returns a presigned download URL.

You provide the input file URLs and the FFmpeg command string. Rendobar handles everything else.

Submitting a raw FFmpeg job

curl -X POST https://api.rendobar.com/jobs \
  -H "Authorization: Bearer rb_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "raw.ffmpeg",
    "inputs": {
      "files": [
        "https://example.com/video.mp4",
        "https://example.com/audio.mp3"
      ]
    },
    "params": {
      "command": "-i {0} -i {1} -c:v libx264 -c:a aac -map 0:v -map 1:a {output}"
    }
  }'

Input references

Use {0}, {1}, {2}, etc. to reference input files by their position in the files array. Use {output} for the output file path.

The executor replaces these placeholders with actual local file paths before running the command. You never handle file paths directly.

Allowed flags

Only whitelisted FFmpeg flags are permitted. Any flag not on this list causes the job to be rejected with a validation error.

Allowed flags:

FlagPurpose
-iInput file
-fForce format
-c:vVideo codec
-c:aAudio codec
-vfVideo filter
-afAudio filter
-filter_complexComplex filter graph
-mapStream mapping
-ssSeek position
-tDuration
-rFrame rate
-sResolution
-b:vVideo bitrate
-b:aAudio bitrate
-crfConstant rate factor
-presetEncoding preset
-anDisable audio
-vnDisable video
-yOverwrite output
-movflagsMOV/MP4 flags

Blocked flags

The following flags are explicitly blocked because they enable network access or other unsafe behavior:

FlagReason
-protocol_whitelistCould enable network protocols
-reReal-time streaming
-listenOpens a listening socket
-rtmp_liveRTMP streaming
-http_proxyHTTP proxy access
-ftp_proxyFTP proxy access

Any command containing a blocked flag is rejected immediately.

Security model

Raw FFmpeg jobs have multiple security layers:

  1. Flag whitelist. Only known-safe flags are permitted.
  2. Network isolation. Blocked flags prevent any network access from within the FFmpeg process.
  3. Input substitution. You provide R2 keys or public URLs. The executor downloads files and substitutes local paths, so FFmpeg only accesses local files.
  4. Output sandboxing. The output path is forced to a sandboxed directory. FFmpeg cannot write to arbitrary file system locations.
  5. Timeout enforcement. Each plan has a maximum job timeout. The FFmpeg process is killed if it exceeds this limit.
  6. Container isolation. The execution environment runs in an isolated Trigger.dev container with no access to other jobs or system resources.

Cost

Raw FFmpeg jobs cost $1.00 per 2 minutes of compute time. Compute time is measured from when FFmpeg starts to when it finishes, not including file transfer time.

For example, a command that takes 3 minutes of FFmpeg execution time costs $1.50.

Timeout limits

Maximum job timeout varies by plan:

PlanMax timeout
Starter5 minutes
Pro15 minutes
Scale30 minutes

If your FFmpeg command exceeds the timeout, the job fails with a PROVIDER_TIMEOUT error and no credits are deducted.

Examples

Scale a video to 720p

{
  "type": "raw.ffmpeg",
  "inputs": { "files": ["https://example.com/video.mp4"] },
  "params": {
    "command": "-i {0} -vf scale=1280:720 -c:v libx264 -preset fast -crf 23 {output}"
  }
}

Extract audio from video

{
  "type": "raw.ffmpeg",
  "inputs": { "files": ["https://example.com/video.mp4"] },
  "params": {
    "command": "-i {0} -vn -c:a aac -b:a 128k {output}"
  }
}

Trim a video (30 seconds starting at 1 minute)

{
  "type": "raw.ffmpeg",
  "inputs": { "files": ["https://example.com/video.mp4"] },
  "params": {
    "command": "-i {0} -ss 00:01:00 -t 00:00:30 -c:v libx264 -c:a aac {output}"
  }
}

Merge video and audio tracks

{
  "type": "raw.ffmpeg",
  "inputs": {
    "files": [
      "https://example.com/video.mp4",
      "https://example.com/narration.mp3"
    ]
  },
  "params": {
    "command": "-i {0} -i {1} -c:v libx264 -c:a aac -map 0:v -map 1:a {output}"
  }
}

Error handling

If FFmpeg exits with a non-zero status code, the job fails with a PROVIDER_ERROR:

{
  "error": {
    "code": "PROVIDER_ERROR",
    "message": "FFmpeg process exited with code 1"
  }
}

If the command contains disallowed flags, it is rejected before dispatch:

{
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Flag '-protocol_whitelist' is not allowed in raw FFmpeg commands"
  }
}

Next steps

  • Job Types for all 23 operations (including simplified alternatives to raw FFmpeg)
  • Credits for billing and cost details
  • Webhooks for push-based job status updates
  • Authentication for API key setup