FFmpeg Media · FFmpeg
Timeline Audio MuxNEW
📌 What is this:Place multiple audio clips into a video at their own time offsets — positioning and muxing the whole track in one call.
💡 When to use:Use to anchor N audio clips (e.g. multiple voice lines or sound effects) at different moments of a video. mux only places a single track from 0s; here each clip carries its own offset in seconds.
Endpoints
| Usage | Method | Path |
|---|---|---|
| Submit task | POST | /v1/ffmpeg/mux_timeline |
| Query Result | GET | /v1/ffmpeg/info?id={taskId} |
⏱ Recommended polling interval:Poll every 3-5s (response includes progress 0-100) until status = succeeded / failed. status = queued means the task is enqueued and waiting to start (not charged yet) — just keep polling. Single-task timeout is 300s with auto-refund.
Request Parameters
| Param | Type | Required | Description |
|---|---|---|---|
| inputUrl | string | Required | Input media URL on a trusted allowlist domain (platform CDN or a trusted-source CDN); upload first to obtain one, or use an asset URL already on a trusted CDN |
| audioUrls | string[] | Required | Audio URL array, 1-100, all on allowlist domains |
| offsets | number[] | Required | Start offset (sec) per audio; length must equal audioUrls, non-negative and non-decreasing |
| mode | string | — | replace drops the original track (default) / add mixes with it (auto-falls back to replace when the video has no audio track) |
| keepVideoLength | boolean | — | Whether output equals the video length: true (default) pads silence if short, trims if long; false leaves it unconstrained |
| webhookUrl | string | — | Completion webhook URL (optional) |
Request Example
curl -X POST https://api.cqtai.com/v1/ffmpeg/mux_timeline \
-H 'Authorization: Bearer <API_KEY>' \
-H 'Content-Type: application/json' \
-d '{ "inputUrl": "https://cdn.novapi.ai/veo31/1788164205419_de868f9d69d445baaf577d42e87a236f.mp4", "audioUrls": ["https://cdn.novapi.ai/tmp/l1.mp3", "https://cdn.novapi.ai/tmp/l2.mp3"], "offsets": [0, 4.2], "mode": "replace", "keepVideoLength": true }'
# -> { "code":200, "data":"<taskId>" }Response Example
{
"code": 200,
"msg": "success",
"data": {
"taskId": "<taskId>",
"operation": "transcode",
"status": "succeeded",
"progress": 100,
"resultUrl": "https://cdn.novapi.ai/ffmpeg/xxx.mp4",
"costPoints": 3,
"errorMsg": null
}
}Billing & Credits
Factor 0.4, billed by video length (same as mux) (x your user rate). Auto-refunded on failure.