跳转到内容

Workflow Utilities Scale Video

集成

模型 id workflow-utilities/scale-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/workflow-utilities/scale-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"

每次运行最高 $3.60 按实际用量计费,剩余部分退款 在此页面运行

获取 API 密钥
Utility · 视频

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

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

构建请求

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

•必填 video_url
拖放文件,或

通过 URL 提供要缩放或调整大小的视频;高度和宽度都使用偶数尺寸,以满足视频编解码器要求。

高级 mode · pad_color · codec · preset · width · height · crf
mode 默认 stretch

调整大小方法:`stretch` 强制使用请求的尺寸,可能改变宽高比。`pad` 和 `crop` 都会保留宽高比:`pad` 将视频适配到请求尺寸内,并用所选颜色填充未使用空间(上下或左右黑边)。`crop` 填满请求尺寸,然后从中心裁剪以匹配精确大小。

pad_color 默认 black

`pad` 模式下用于填充的颜色;其他模式会忽略该值。

codec 默认 libx264

选择编码编解码器:使用 libx265 (H.265/HEVC) 以获得更好的压缩,或使用 libx264 (H.264) 以获得广泛兼容性。

preset 默认 fast

控制编码速度的预设。选择较慢的预设可改善压缩效果,但会增加编码时间。

输出宽度,单位为像素,可单独使用或与高度搭配;至少需要提供一个尺寸。仅提供宽度时,高度会自动推导且不会改变宽高比。

输出高度,单位为像素,可单独使用或与宽度搭配;至少需要提供一个尺寸。仅提供高度时,宽度会自动推导且不会改变宽高比。

默认 18

控制 0–51 范围内质量的 Constant Rate Factor,18 通常对大多数内容呈现无损效果。降低该设置可提高质量,但会增加文件大小。

POST /run/workflow-utilities/scale-video?wait=20 报价 → $3.60
# 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/workflow-utilities/scale-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 密钥

关于 Workflow Utilities Scale Video

将视频缩放到目标 `width`(最大 7680)和/或 `height`(最大 4320);只提供其中一个时,另一个会按宽高比确定。`mode` 可设为 stretch、pad(使用指定颜色)或 crop。可使用 libx264 或 libx265 编码,速度预设范围从 ultrafast 到 slow,`crf` 范围为 0 到 51。返回原始和新尺寸。

参数

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

名称类型 默认值允许值 描述
video_url必填 video
类型url · video
通过 URL 提供要缩放或调整大小的视频;高度和宽度都使用偶数尺寸,以满足视频编解码器要求。
width可选
类型integer | null
2 – 7,680
输出宽度,单位为像素,可单独使用或与高度搭配;至少需要提供一个尺寸。仅提供宽度时,高度会自动推导且不会改变宽高比。
height可选
类型integer | null
2 – 4,320
输出高度,单位为像素,可单独使用或与宽度搭配;至少需要提供一个尺寸。仅提供高度时,宽度会自动推导且不会改变宽高比。
mode可选
类型enum
默认值stretch
stretchpadcrop
调整大小方法:`stretch` 强制使用请求的尺寸,可能改变宽高比。`pad` 和 `crop` 都会保留宽高比:`pad` 将视频适配到请求尺寸内,并用所选颜色填充未使用空间(上下或左右黑边)。`crop` 填满请求尺寸,然后从中心裁剪以匹配精确大小。
pad_color可选
类型enum
默认值black
blackwhiteredgreenbluegray
`pad` 模式下用于填充的颜色;其他模式会忽略该值。
codec可选
类型enum
默认值libx264
libx264libx265
选择编码编解码器:使用 libx265 (H.265/HEVC) 以获得更好的压缩,或使用 libx264 (H.264) 以获得广泛兼容性。
preset可选
类型enum
默认值fast
ultrafastfastmediumslow
控制编码速度的预设。选择较慢的预设可改善压缩效果,但会增加编码时间。
crf可选
类型integer
默认值18
0 – 51
控制 0–51 范围内质量的 Constant Rate Factor,18 通常对大多数内容呈现无损效果。降低该设置可提高质量,但会增加文件大小。
必填 规范名称,也可接受

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

输出

GET /requests/req_8k2m4q7x1z9c3v5b6n0p2r4t
{
  "id": "req_8k2m4q7x1z9c3v5b6n0p2r4t",
  "object": "request",
  "model": "workflow-utilities/scale-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": 3600,
    "usd": "3.60",
    "charged": 3600,
    "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
    },
    "original_width": 1929,
    "original_height": 1082,
    "scaled_width": 1920,
    "scaled_height": 1080
  },
  "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}缩放或调整大小后的视频。
original_width
integer原视频宽度,单位为像素。
original_height
integer原视频高度,单位为像素。
scaled_width
integer输出视频宽度,单位为像素。
scaled_height
integer输出视频高度,单位为像素。

更多模型:视频转换

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