FFmpeg 媒体处理 · FFmpeg
分辨率缩放NEW
📌 这是什么:把视频缩放到目标分辨率。
💡 什么时候用:想改分辨率(如 1080p→720p)时用。
接口地址
| 用途 | 方法 | 路径 |
|---|---|---|
| 提交任务 | POST | /v1/ffmpeg/scale |
| 查询结果 | GET | /v1/ffmpeg/info?id={taskId} |
⏱ 建议轮询时间:建议每 3~5 秒轮询一次(响应含 progress 0→100),直到 status = succeeded / failed。单任务超时 300 秒、超时退款。
请求参数
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| inputUrl | string | 必填 | 输入媒体 URL,必须为平台 CDN 白名单域名(先用 upload 上传获取) |
| resolution | string | 必填 | 目标分辨率:480p / 720p / 1080p |
| webhookUrl | string | — | 完成回调地址(可选) |
请求示例
curl -X POST https://api.cqtai.com/v1/ffmpeg/scale \
-H 'Authorization: Bearer <API_KEY>' \
-H 'Content-Type: application/json' \
-d '{ "inputUrl": "https://cdn.novapi.ai/tmp/video.mp4", "resolution": "720p" }'
# -> { "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
}
}计费与积分
系数 0.8;1 分钟 720P ≈ 3 积分(× 你的用户费率)。任务失败自动退回。