# FFmpeg Media Editor

Generate and edit video with FFmpeg Media Editor from Spiral through one Spiral API key. Runs one FFmpeg command on your video, audio and images: crop, trim, resize, convert, swap audio, merge clips or add text. It runs in the background and returns video, audio and images. Pay as you go, with no subscription.

- Provider: Spiral
- Category: Video
- Runs: In the background
- Returns: video, audio, image
- Tool id: `spiral` / `ffmpeg`
- Page: https://spiral.ai/tools/spiral/ffmpeg

## Pricing

$0.0013 per run, plus $0.00052 per second FFmpeg runs (whole seconds, at least one). Held at `max_seconds`, default 300.

## Limits

- Longest queue wait: 1 hour
- Run deadline: 130 minutes
- Longest run, end to end: 335 minutes
- Largest inline input: 1 MB
- Largest input file: 2 GB
- Largest output: 5 GB

## Input

| Field | Kind | Allowed | Default | Description |
| --- | --- | --- | --- | --- |
| `command` (required) | text |  | — | The FFmpeg command, e.g. `ffmpeg -ss 5 -i https://example.com/in.mp4 -t 10 -c copy clip.mp4`. The leading `ffmpeg` is optional; quote filter graphs as in a shell. |
| `inputs` | URLs or files |  | [] | Files the command names as {in0}, {in1}, … (Toolbox file links or public links), each at most 2 GB. Not needed when the command gives https links after -i. |
| `max_seconds` | number (whole) | 1 to 1800 | 300 | The longest FFmpeg may run, in seconds. The hold is this many seconds; the charge is the seconds it ran. |

## Example

```bash
curl https://api.spiral.ai/v1/runs \
  -H "Authorization: Bearer $SPIRAL_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "provider": "spiral",
    "model": "ffmpeg",
    "input": {
      "command": "<command>"
    }
  }'
```

Try it in the Playground: https://spiral.ai/start?provider=spiral&model=ffmpeg

## Common questions

### FFmpeg Media Editor

**How much does FFmpeg Media Editor cost?**

$0.0013 per run, plus $0.00052 per second FFmpeg runs (whole seconds, at least one). Held at `max_seconds`, default 300. You pay as you go from one Spiral balance, with no subscription, and a failed run is not charged.

**How do I use FFmpeg Media Editor through an API?**

Send `POST /v1/runs` with `"provider": "spiral"`, `"model": "ffmpeg"` and the input fields on this page, using one Spiral API key. It runs in the background: poll the run, or name a webhook to be told when it finishes.

**Can my AI agent use FFmpeg Media Editor?**

Yes. Agents find and run it through Spiral's MCP server, CLI or agent skill, with the same API key.

