跳至內容

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

控制品質的固定率因子(CRF),範圍為 0–51,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` 可設為拉伸、填充(指定顏色)或裁切。使用 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
控制品質的固定率因子(CRF),範圍為 0–51,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-TW/developers/models/workflow-utilities/scale-video.md. 所有模型與指南: https://doitong.com/developers/llms.txt