Skip to main content
The FFmpeg API lets you transcode, trim, convert, and otherwise process video and audio files entirely on the server. You provide a source URL and an FFmpeg command; MADIAD Hub fetches the file, runs the job, and makes the output available to download. There is no binary upload — input files must be reachable over HTTPS. The API returns a job_id immediately; processing is asynchronous, so you poll for status and then download the result.
There is no FFmpeg webhook. Polling is the ONLY way to learn that a job finished. Webhooks emit events for publishing and for connection changes only — there is no event for FFmpeg jobs. Do not design around an FFmpeg callback.
FFmpeg jobs require a paid plan. An account with no active plan has 0 FFmpeg minutes. Activate Starter or higher to unlock the feature.

How a job works

1

Submit

POST to /v1/ffmpeg/jobs with one or more source URLs and an FFmpeg command. The API validates the command, reserves quota, and queues the job. You receive a job_id.
2

Poll

GET /v1/ffmpeg/jobs/:id until status is finished.
3

Download

GET /v1/ffmpeg/jobs/:id/result to stream the processed file.

Submit a job

Request body

Response

Poll status

Response

duration_sec is null until the job finishes; it is populated with the actual output duration once complete.

Download the result

Once status is finished, stream the output file:
The response is a binary stream with Content-Disposition: attachment. Pipe it to a file or buffer it in memory.

Command rules

The full_command field must satisfy all of the following rules. Requests that fail validation return 400 invalid_request before any quota is consumed. Newlines in the command are converted to spaces automatically, so you can paste multi-line commands directly.

Allowed output extensions

output_extension must be one of the following values (without a leading dot): Any other value returns 400 invalid_request.

Quota and billing

FFmpeg usage is measured in FFmpeg minutes. In v1, every job costs a flat 1 minute, regardless of the actual output duration. The quota is reserved at submit time and refunded automatically if the job fails to queue. Monthly limits by plan. The allowance is account-wide — it is not multiplied by the number of profiles, and all your brands draw from the same pool: When you exhaust your monthly allowance, the API returns 429 quota_exceeded. Your allowance resets on the same day of the month your plan was activated (Vietnam time, UTC+7) — not on the 1st. Usage reports the exact start and renewal date of your current cycle.

Authentication and rate limits

All FFmpeg endpoints use the same API-key Bearer authentication as the rest of MADIAD Hub — see Authentication. The rate limit is 120 requests per minute per account across all FFmpeg endpoints. Exceeding this returns 429 with a Retry-After header indicating how long to wait.

Job ownership

Jobs are private to the account that created them. Polling or downloading a job that belongs to another account returns 404 not_found — there is no cross-account access.

Errors

Worked example

1. Submit: convert an MP4 to a web-optimized WebM

2. Poll until finished

3. Download the result