FFmpeg Media · FFmpeg Media
FFmpeg Media · IntroductionComing Soon
🚧 This capability is coming soon. The docs are a preview; online run is not yet available. Watch announcements for the launch date.
FFmpeg media processing API: transcode, compress, scale, trim, frame extraction, watermark, concat, mux, audio extraction, GIF conversion, thumbnail, media probe, and file upload. Flow: (1) upload a file to get a CDN URL → (2) call an operation (use that URL as input) → (3) poll by taskId until succeeded / failed. Inputs only accept URLs on the platform CDN allowlist. Billed by credits: pre-charged on submit, auto-refunded on failure.
How to call
- Upload:
POST /v1/ffmpeg/upload(multipart), get a CDN URL. - Submit:
POST /v1/ffmpeg/{operation}, use that URL as input, returns a taskId. - Query:
GET /v1/ffmpeg/info?id=taskId, poll until status = succeeded.
Operations
POSTUpload Fileupload
Upload a media file (multipart); returns a CDN URL synchronously.
POSTMedia Probeprobe
Extract media metadata: duration / resolution / bitrate / codec. Returns instantly.
POSTTranscodetranscode
Convert container format and audio/video codecs.
POSTCompresscompress
Reduce video file size.
POSTScalescale
Scale the video to a target resolution.
POSTTrimtrim
Cut a time segment out of the video.
POSTExtract Audioextract_audio
Extract the audio track from a video.
POSTVideo to GIFto_gif
Convert a video segment to an animated GIF.
POSTThumbnailthumbnail
Capture a single frame at a given time.
POSTWatermarkwatermark
Overlay an image watermark on the video.
POSTConcatconcat
Join multiple videos into one, in order.
POSTMux Audiomux
Merge audio into video (replace or add a track).
POSTExtract Framesframes
Export image frames by interval or FPS.
Billing
Pre-charged on submit, auto-refunded on failure. Formula: credits = max(1, ceil(output seconds x 0.05 x op factor x resolution factor)). upload / probe / thumbnail are a flat 1 credit.
Resolution factors: 480P=0.6, 720P=1.0, 1080P=1.8, >1080P=3.0. Final credits are multiplied by your user rate.
Concurrency & Limits
- Max concurrent tasks per user: 3
- Single-task timeout: 300s (refunded on timeout)
- Upload limit 200MB; task input download limit 1GB
- Input URLs must be on the platform CDN allowlist
Common Errors
| Code | msg | Meaning | How to fix |
|---|---|---|---|
| 400 | invalid params / non-allowlist url | Invalid params or input URL not on allowlist (rejected before charge) | Check enum/range; upload input first to get a CDN URL |
| 429 | Task limit reached | More than 3 concurrent tasks | Wait for running tasks to finish, then submit |
| 500 | failed / timeout | Processing failed or timed out (300s); credits auto-refunded, see data.errorMsg | Adjust input/params per errorMsg and retry |