FFmpeg 媒体处理 · FFmpeg
拼接视频NEW
📌 这是什么:把多个视频按顺序拼接成一个。
💡 什么时候用:要把几段视频接起来时用(需同编码同分辨率)。
接口地址
| 用途 | 方法 | 路径 |
|---|---|---|
| 提交任务 | POST | /v1/ffmpeg/concat |
| 查询结果 | GET | /v1/ffmpeg/info?id={taskId} |
⏱ 建议轮询时间:建议每 3~5 秒轮询一次(响应含 progress 0→100),直到 status = succeeded / failed。单任务超时 300 秒、超时退款。
请求参数
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| inputUrls | string[] | 必填 | 视频 URL 数组,2~10 个;需同编码同分辨率 |
| webhookUrl | string | — | 完成回调地址(可选) |
请求示例
curl -X POST https://api.cqtai.com/v1/ffmpeg/concat \
-H 'Authorization: Bearer <API_KEY>' \
-H 'Content-Type: application/json' \
-d '{ "inputUrls": ["https://cdn.novapi.ai/tmp/a.mp4", "https://cdn.novapi.ai/tmp/b.mp4"] }'
# -> { "code":200, "data":"<taskId>" }响应示例
{
"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
}
}计费与积分
系数 1.0,按各输入总时长计(× 你的用户费率)。任务失败自动退回。