MediaTofu

MediaTofuFFmpeg API: run any command in one call

FFmpeg API: run any command in one call

MediaTofu is an FFmpeg API: send the command you already have to POST /v1/run, or call a simple tool endpoint to compress, convert, trim, resize, thumbnail, extract audio, or make a GIF. Each job runs in its own sandbox with no internet and no secrets, and short jobs can return their result in the same request with ?wait=25.

Get an API keyPricing

Example

POST /v1/run?wait=25
curl "https://api.mediatofu.com/v1/run?wait=25" \
  -H "Authorization: Bearer $MEDIATOFU_KEY" \
  -d '{
    "input_files": { "in": "https://example.com/clip.mov" },
    "output_files": { "out": "small.mp4" },
    "ffmpeg_command": "-i {{in}} -vf scale=1280:-2 -crf 26 {{out}}"
  }'

With ?wait=25 a short job can return its result in the same request. Short jobs typically take about 5–15 seconds including container start. Leave wait off and poll GET /v1/jobs/:id, or pass webhook_url on a paid plan.

Bring your own FFmpeg command

Name your inputs and outputs, then pass ffmpeg_command with {{placeholders}} where the file names go. A job can have up to 10 inputs and 10 outputs, and every one you declare has to appear in the command. URLs and paths outside the job are rejected before anything runs.

Or skip the flags

Post to /v1/tools/<name> with an input URL or file id. The tools build the command for you on the same engine: probe, compress, convert, resize, trim, thumbnail, extract-audio, and gif.

Pricing

Free: $0, 5 minutes of compute a month, jobs up to 1 minute, inputs up to 50 MB, 1 job at a time. Pay per use: $0.024 per compute minute, billed by the second, no monthly fee. Jobs up to 5 minutes, inputs up to 2 GB, 3 jobs at once. Starter: $9/month includes 600 minutes, then $0.015 a minute. Jobs up to 1 minute, inputs up to 500 MB. Pro: $19/month includes 1,500 minutes, then $0.0127 a minute. Jobs up to 10 minutes, inputs up to 2 GB. Compute is the time FFmpeg spends running your job, rounded up to a whole second. Waiting in the queue and moving files around do not count.

Questions

What does MediaTofu cost?

Free: $0, 5 minutes of compute a month, jobs up to 1 minute, inputs up to 50 MB, 1 job at a time. Pay per use: $0.024 per compute minute, billed by the second, no monthly fee. Jobs up to 5 minutes, inputs up to 2 GB, 3 jobs at once. Starter: $9/month includes 600 minutes, then $0.015 a minute. Jobs up to 1 minute, inputs up to 500 MB. Pro: $19/month includes 1,500 minutes, then $0.0127 a minute. Jobs up to 10 minutes, inputs up to 2 GB.

How do I get the result?

Add ?wait=25 and a short job can return its result in the same request. Short jobs typically take about 5–15 seconds including container start. 25 seconds is the longest wait. Otherwise you get a job id to check with GET /v1/jobs/:id, or on a paid plan you can pass webhook_url and we POST the result to you.

Do failed jobs cost anything?

A failure on our side is never charged, and neither is an input we couldn't download or one over your plan's size limit. If your command runs and FFmpeg exits with an error, or the job reaches your plan's length limit, the seconds it used count.

How is each job isolated?

Every job gets a fresh container with no internet access and no secrets. Your input files are copied in, FFmpeg runs, outputs are saved, and the container is destroyed when the job ends.

Do I need to know FFmpeg?

No. The eight tools take plain options like a format or a width. If you do know FFmpeg, POST /v1/run takes your command with placeholders where the file names go.