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 is enabled on request, not by plan. No plan includes it by default; an account without it gets 403 forbidden on every FFmpeg endpoint. Write to info@madiad.com with what you intend to process and we will switch it on for your account.

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.

Availability and quota

FFmpeg is granted per account, not bundled into a plan. Every plan carries an allowance of zero; we set yours when you ask for it. Until then POST /v1/ffmpeg/jobs returns 403 forbidden — a statement about your entitlement, not about a limit you have used up, so retrying will not change it. Once enabled, your allowance is counted in jobs: submitting one job costs one, whatever the duration of the media it processes. The allowance is reserved at submit time and refunded automatically if the job fails to queue. The allowance is account-wide — it is not multiplied by the number of profiles, and all your brands draw from the same pool. It resets on the same day of the month your plan was activated (Vietnam time, UTC+7), not on the 1st. Usage reports your exact figure, whether the capability is enabled at all, and the start and renewal date of the current cycle. Exhausting an allowance you do have returns 429 quota_exceeded.

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