跳转到内容

Sam 3 · Video

集成

模型 id sam-3/video
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://api.doitong.com/v1/run/sam-3/video?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "video": "https://content.doitong.com/video/showcase/v3/gen_fox_cartoon.mp4"
  }'

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

与示例类似的文件: $0.095 95 API 积分 运行前会测量你的文件 在此页面运行

获取 API 密钥
Meta 视频转换 #segmentation#mask#real-time

根据文本、点或框提示分割并跟踪视频中的物体,返回带掩码的视频

Meta · 视频

你的第一个结果将在此显示

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

构建请求

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

默认

支持通过逗号分隔的描述跟踪多个对象的分割提示词,例如 'person, cloth'。

•必填 video_url
拖放文件,或

用于分割的视频 URL。

高级 text_prompt · video_output_type · detection_threshold · apply_mask · point_prompts · box_prompts

[已弃用] 为向后兼容而保留的旧版输入;请改用 'prompt'。

video_output_type 默认 X264 (.mp4)

结果视频的输出类型。

默认 0.5

检测置信度阈值;降低该值会增加检测数量,但会牺牲精确度,范围为 0.0–1.0。

默认 []

基于点的提示词集合。

默认 []

以坐标元组 (x_min, y_min, x_max, y_max) 列出的框提示词。

POST /run/sam-3/video?wait=20 报价 → $0.095
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://api.doitong.com/v1/run/sam-3/video?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "video": "https://content.doitong.com/video/showcase/v3/gen_fox_cartoon.mp4"
  }'

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

运行此请求

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

关于 Sam 3 · Video

检测并跟踪通过 `video_url` 提供的视频中的物体。在 `prompt` 中用名称指定目标,多个目标以逗号分隔,也可以使用 `point_prompts` 和 `box_prompts`。`detection_threshold` 范围为 0.1 到 1,`apply_mask` 控制是否将掩码绘制到视频上。输出为 mp4 或 webm,另附包含逐帧边界框叠加图的 zip 压缩包。

参数

发送规范名称或原生名称之一,不要同时发送两者。 规范名称

名称类型 默认值允许值 描述
video_url必填 video
类型url · video
用于分割的视频 URL。
prompt可选
类型string
默认值
支持通过逗号分隔的描述跟踪多个对象的分割提示词,例如 'person, cloth'。
text_prompt可选
类型string | null
[已弃用] 为向后兼容而保留的旧版输入;请改用 'prompt'。
point_prompts可选
类型object[]
默认值[]
基于点的提示词集合。
point_prompts[].x可选
类型integer | null
提示词在 X 轴上的位置。
point_prompts[].y可选
类型integer | null
提示词在 Y 轴上的位置。
point_prompts[].label可选
类型enum
01
前景/背景标签:1 表示前景;0 表示背景。
point_prompts[].object_id可选
类型integer | null
用于将细化同一对象的提示词分组的可选标识符。如果同时提供文本提示词,此标识符决定这些点细化哪个检测到的对象。
box_prompts可选
类型object[]
默认值[]
以坐标元组 (x_min, y_min, x_max, y_max) 列出的框提示词。
box_prompts[].x_min可选
类型integer | null
框的最小 x 坐标。
box_prompts[].y_min可选
类型integer | null
框的最小 y 坐标。
box_prompts[].x_max可选
类型integer | null
框的最大 X 坐标。
box_prompts[].y_max可选
类型integer | null
框的最大 Y 坐标。
box_prompts[].object_id可选
类型integer | null
用于将细化同一对象的框分组的可选标识符。
apply_mask可选
类型boolean
默认值true
是否对视频应用掩码。
video_output_type可选
类型enum
默认值X264 (.mp4)
X264 (.mp4)VP9 (.webm)
结果视频的输出类型。
detection_threshold可选
类型number
默认值0.5
0.1 – 1
检测置信度阈值;降低该值会增加检测数量,但会牺牲精确度,范围为 0.0–1.0。
必填 规范名称,也可接受

文件参数接受公开的 https:// URL、最大 10 MB 的 data: URI,或上传文件的 file_url。 文件

输出

GET /requests/req_8k2m4q7x1z9c3v5b6n0p2r4t
{
  "id": "req_8k2m4q7x1z9c3v5b6n0p2r4t",
  "object": "request",
  "model": "sam-3/video",
  "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": 95,
    "usd": "0.095",
    "charged": 95,
    "refunded": 0
  },
  "input": {
    "video_url": "https://content.doitong.com/video/showcase/v3/gen_fox_cartoon.mp4"
  },
  "output": {
    "video": {
      "url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.mp4",
      "content_type": "video/mp4",
      "file_name": "0-output.mp4",
      "file_size": 1843200
    },
    "boundingbox_frames_zip": {
      "url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.mp4",
      "content_type": "video/mp4",
      "file_name": "0-output.mp4",
      "file_size": 1843200
    }
  },
  "outputs": [
    {
      "type": "video",
      "url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.mp4",
      "content_type": "video/mp4",
      "file_size": 1843200,
      "width": 1280,
      "height": 720,
      "duration": 5,
      "stored": true
    }
  ],
  "error": null,
  "metrics": {
    "inference_seconds": 6.8
  },
  "urls": {
    "self": "https://api.doitong.com/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t",
    "cancel": "https://api.doitong.com/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t/cancel"
  }
}
你的文件,由你选择每个 outputs[].url 都是存储中的副本:可永久保存(按 GB-月付费),也可免费保存 7 天,由账户设置或 ?storage= 决定。
每个模型的结构相同图像、视频和音频均包含 type、url、content_type、width、height 和 duration。output 是模型自身的结果对象。
输出字段
video
object {url, content_type, file_name, file_size}分割生成的视频。
boundingbox_frames_zip
object {url, content_type, file_name, file_size} | null包含每帧边界框叠加图的 ZIP 存档。

更多模型:视频转换

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