跳转到内容

FFmpeg API Compose

集成

模型 id ffmpeg-api/compose
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://api.doitong.ru/v1/run/ffmpeg-api/compose?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "tracks": [
      {
        "id": "your-id",
        "type": "example",
        "keyframes": [
          {
            "timestamp": 1,
            "duration": 1,
            "url": "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg"
          }
        ]
      }
    ]
  }'

# Still "queued" or "running"? Poll with the id from the response:
curl "https://api.doitong.ru/v1/requests/REQUEST_ID?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY"

此请求: ≈$0.001 1 API 积分 · ≈ ₽0.11 在此页面运行

获取 API 密钥
Utility 视频生成视频 #ffmpeg

将多个轨道合并为一个视频,恰好包含一个视频轨道以及任意数量的音频轨道

Utility · 数据(JSON)

你的第一个结果会显示在这里

在下方构建请求,并使用你的 API 密钥运行。输出会复制到我们的存储中,可永久保存,也可免费保存 7 天。

构建请求

控件根据模型架构生成。修改控件时,代码和价格会同步更新。

•必填

用于组装最终媒体的轨道列表,恰好包含一个视频或图像轨道,以及数量不受限制的音频轨道。

POST /run/ffmpeg-api/compose?wait=20 报价 → $0.001
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://api.doitong.ru/v1/run/ffmpeg-api/compose?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "tracks": [
      {
        "id": "your-id",
        "type": "example",
        "keyframes": [
          {
            "timestamp": 1,
            "duration": 1,
            "url": "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg"
          }
        ]
      }
    ]
  }'

# Still "queued" or "running"? Poll with the id from the response:
curl "https://api.doitong.ru/v1/requests/REQUEST_ID?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY"

运行此请求

你的密钥会保留在此浏览器中:仅发送到 Doitong API;只有勾选“记住”后才会保存到 localStorage。 获取 API 密钥

关于 FFmpeg API Compose

根据 `tracks` 列表构建最终视频。列表必须恰好包含一个视频轨道(视频或图像),并可包含任意数量的音频轨道。输出为包含 `video_url` 和 `thumbnail_url` 的 JSON。

参数

名称类型 默认值允许值 描述
tracks必填
类型object[]
用于组装最终媒体的轨道列表,恰好包含一个视频或图像轨道,以及数量不受限制的音频轨道。
tracks[].id必填
类型string
唯一标识轨道的标识符。
tracks[].type必填
类型string
轨道类别:'video'、'audio' 或 'image'。
tracks[].keyframes必填
类型object[]
构成轨道的关键帧,以列表形式提供。
tracks[].keyframes[].timestamp必填
类型number
关键帧的开始时间,单位为毫秒。
tracks[].keyframes[].duration必填
类型number
关键帧的时长,单位为毫秒。
tracks[].keyframes[].url必填
类型string
提供访问该关键帧媒体文件权限的 URL。
必填

输出

GET /requests/req_8k2m4q7x1z9c3v5b6n0p2r4t
{
  "id": "req_8k2m4q7x1z9c3v5b6n0p2r4t",
  "object": "request",
  "model": "ffmpeg-api/compose",
  "status": "succeeded",
  "created_at": "2026-10-20T12:00:00Z",
  "started_at": "2026-10-20T12:00:02Z",
  "completed_at": "2026-10-20T12:00:09Z",
  "queue_position": null,
  "cost": {
    "credits": 1,
    "usd": "0.001",
    "charged": 1,
    "refunded": 0
  },
  "input": {
    "tracks": [
      {
        "id": "your-id",
        "type": "example",
        "keyframes": [
          {
            "timestamp": 1,
            "duration": 1,
            "url": "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg"
          }
        ]
      }
    ]
  },
  "output": {
    "video_url": "string",
    "thumbnail_url": "string"
  },
  "outputs": [
    {
      "type": "file",
      "url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.jpeg",
      "content_type": "image/jpeg",
      "file_size": 1843200,
      "stored": true
    }
  ],
  "error": null,
  "metrics": {
    "inference_seconds": 6.8
  },
  "urls": {
    "self": "https://api.doitong.ru/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t",
    "cancel": "https://api.doitong.ru/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t/cancel"
  }
}
文件由你选择每个 outputs[].url 都是我们存储中的副本:可永久保存(按 GB-月付费),也可免费保存 7 天,由账户设置或 ?storage= 决定。
所有模型的结构一致图像、视频和音频的字段均为 type、url、content_type、width、height 和 duration。output 是模型自身的结果对象。
输出字段
video_url
string (video URL)指向处理后视频的 URL。
thumbnail_url
string指向视频缩略图的 URL。

更多模型:视频生成视频

对于 AI 代理:此页面的 Markdown 版本位于 https://doitong.com/zh-CN/developers/models/ffmpeg-api/compose.md. 所有模型和指南: https://doitong.com/developers/llms.txt