Very Good FFmpeg
How it worksPricingCompareFAQDocs
Documentation
API Reference
Documentation
Documentation
Getting Started
Fundamentals
Advanced Topics
Temporary FilesCommand ChainingHardware SelectionWebhooks
Advanced Topics
  1. Advanced Topics
  2. Command Chaining

Command Chaining

Run multiple FFmpeg commands sequentially on the same machine.

Run multiple FFmpeg commands sequentially on the same machine. This is efficient for multi-step pipelines as intermediate files stay local.

When to Use This

Use command chaining when a later command needs a file made by an earlier command.

Common uses:

  • Create an intermediate encode, then package it.
  • Extract frames, then encode a preview.
  • Make many outputs from one downloaded input.

Example

Multi-step pipeline
{
  "input_files": { "raw": "https://example.com/large.mov" },
  "output_files": ["final.mp4"],
  "ffmpeg_commands": [
    "-i {{raw}} -vf scale=1920:1080 temp.mp4",
    "-i temp.mp4 -c:v libx264 -crf 23 {{final.mp4}}"
  ]
}

Each command in the ffmpeg_commands array runs in order. Files produced by an earlier command, like temp.mp4, can be referenced by later commands.

Output Files

Only list files you want returned in output_files.

Intermediate files can be used in later commands without being listed as outputs.

Intermediate file
{
  "output_files": ["final.mp4"],
  "ffmpeg_commands": [
    "-i {{raw}} -vf scale=1920:1080 temp.mp4",
    "-i temp.mp4 -c:v libx264 {{final.mp4}}"
  ]
}

Notes

  • Commands stop at the first failure.
  • All commands run on the same worker.
  • Intermediate files are not uploaded unless they are listed in output_files.
Hardware Selection

Run jobs on CPU or NVIDIA GPU workers.

Temporary Files

Upload local media files.

Temporary Files

Upload local media files that aren't publicly accessible.

Hardware Selection

Choose CPU or NVIDIA GPU workers for your jobs.

On this page

When to Use ThisExampleOutput FilesNotes