跳至內容

Auto-Captioner

整合

模型 id auto-caption
# 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/auto-caption?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.10 100 API 點數 在此頁面執行

取得 API 金鑰
Utility 影片轉影片 #captioning#video

為影片加入語音字幕,可調整顏色、字型、大小和位置

Utility · 資料(JSON)

您的第一個結果會顯示在這裡

在下方建立請求,並使用您的 API 金鑰執行。輸出會複製到我們的儲存空間,可永久保留或免費保留 7 天。

建立請求

控制項是根據模型結構描述生成的。變更設定時,程式碼和價格會同步更新。

•必填 video_url
拖放檔案,或

包含音訊且小於 400 MB 的 .mp4 檔案影片 URL。

進階 text_case · txt_color · txt_font · font_size · stroke_width · refresh_interval · left_align · top_align
text_case 預設 default

選擇 'default' 以保留語音辨識產生的字幕大小寫。若要變更,選擇 'upper' 使用大寫文字,或選擇 'lower' 使用小寫文字。

預設 white

使用十六進位表示法、RGB 元組或色彩名稱設定文字顏色。

預設 Standard

使用指向 .ttf 檔案的 URL 或內建字型設定字幕字型:'Arial'、'Standard'、'Garamond'、'Times New Roman' 或 'Georgia'。

預設 24

生成字幕的文字大小。

預設 1

文字描邊粗細,以像素計。

預設 1.5

控制字幕在顯示區間內同時顯示的文字量,以秒計:讓字幕保持顯示更久可一次顯示更多文字。

預設 center

使用介於 0.0 和 1.0 之間的浮點數水平對齊文字,或選取具名位置 'left'、'center' 或 'right'。

預設 center

使用介於 0.0 和 1.0 之間的浮點數垂直對齊文字,或選取具名位置 'top'、'center' 或 'bottom'。

POST /run/auto-caption?wait=20 報價 → $0.10
# 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/auto-caption?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 金鑰

關於 Auto-Captioner

轉錄 .mp4 `video_url`(小於 400MB)中的音訊,並將字幕燒錄至影片。使用 `txt_color`、`txt_font`、`font_size`、`stroke_width` 和 `text_case` 設定樣式。位置使用 `left_align` 和 `top_align`。`refresh_interval` 設為 0.5 到 3 秒,可設定字幕在畫面上停留的時間。

參數

請傳送標準名稱或原生名稱其中之一,不要同時傳送兩者。 標準名稱

名稱類型 預設值允許值 說明
video_url必填 video
類型url · video
包含音訊且小於 400 MB 的 .mp4 檔案影片 URL。
txt_color選填
類型string
預設值white
使用十六進位表示法、RGB 元組或色彩名稱設定文字顏色。
txt_font選填
類型string
預設值Standard
使用指向 .ttf 檔案的 URL 或內建字型設定字幕字型:'Arial'、'Standard'、'Garamond'、'Times New Roman' 或 'Georgia'。
font_size選填
類型integer
預設值24
生成字幕的文字大小。
stroke_width選填
類型integer
預設值1
文字描邊粗細,以像素計。
left_align選填
類型string | number
預設值center
使用介於 0.0 和 1.0 之間的浮點數水平對齊文字,或選取具名位置 'left'、'center' 或 'right'。
top_align選填
類型string | number
預設值center
使用介於 0.0 和 1.0 之間的浮點數垂直對齊文字,或選取具名位置 'top'、'center' 或 'bottom'。
refresh_interval選填
類型number
預設值1.5
0.5 – 3
控制字幕在顯示區間內同時顯示的文字量,以秒計:讓字幕保持顯示更久可一次顯示更多文字。
text_case選填
類型enum
預設值default
defaultupperlower
選擇 'default' 以保留語音辨識產生的字幕大小寫。若要變更,選擇 'upper' 使用大寫文字,或選擇 'lower' 使用小寫文字。
必填 標準名稱,也可使用

檔案參數接受公開的 https:// URL、最大 10 MB 的 data: URI,或上傳檔案的 file_url。 檔案

輸出

GET /requests/req_8k2m4q7x1z9c3v5b6n0p2r4t
{
  "id": "req_8k2m4q7x1z9c3v5b6n0p2r4t",
  "object": "request",
  "model": "auto-caption",
  "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": 100,
    "usd": "0.10",
    "charged": 100,
    "refunded": 0
  },
  "input": {
    "video_url": "https://content.doitong.com/video/showcase/v3/gen_fox_cartoon.mp4"
  },
  "output": {
    "video_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.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_url
string (video URL)指向已加上字幕的 .mp4 影片的 URL。

給 AI 代理程式:此頁面的 Markdown 位於 https://doitong.com/zh-TW/developers/models/auto-caption.md. 所有模型與指南: https://doitong.com/developers/llms.txt