Files
SnapOtter/apps/docs/zh-TW/tools/video/resize-video.md
T
SnapOtterandGitHub 4963ab3bbd feat(docs-i18n): translate all documentation into 20 languages
All 181 docs markdown files translated into 20 languages (apps/docs/<locale>/**). Companion to the i18n code PR; admin-merged because the file count exceeds GitHub's per-PR CI trigger limit. Validated by pnpm i18n:check (all surfaces, 0 stale/missing) and a clean all-locale docs build.
2026-07-11 13:52:47 +08:00

1.9 KiB
Raw Blame History

description, i18n_source_hash, i18n_provenance, i18n_output_hash
description i18n_source_hash i18n_provenance i18n_output_hash
將影片縮放至新的解析度或預設尺寸。 bb1f67871fea human 4f44eb3d05bd

Resize Video

使用自訂像素尺寸或標準預設,將影片縮放至新的解析度。

API Endpoint

POST /api/v1/tools/video/resize-video

接受包含一個影片檔案和一個 JSON settings 欄位的 multipart form data。

Parameters

Parameter Type Required Default Description
width integer No - 目標寬度(以像素為單位,16-7680)
height integer No - 目標高度(以像素為單位,16-4320)
preset string No "custom" 解析度預設:custom2160p1440p1080p720p480p360p

preset"custom" 時,必須至少提供 widthheight 其中一個。另一個尺寸會按比例縮放。

Example Request

curl -X POST http://localhost:1349/api/v1/tools/video/resize-video \
  -H "Authorization: Bearer si_your-api-key" \
  -F "file=@clip.mp4" \
  -F 'settings={"preset": "720p"}'

縮放至自訂尺寸:

curl -X POST http://localhost:1349/api/v1/tools/video/resize-video \
  -H "Authorization: Bearer si_your-api-key" \
  -F "file=@clip.mp4" \
  -F 'settings={"width": 1280, "height": 720}'

Example Response

{
  "jobId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "downloadUrl": "/api/v1/download/a1b2c3d4-e5f6-7890-abcd-ef1234567890/clip.mp4",
  "originalSize": 25000000,
  "processedSize": 8500000
}

Notes

  • 預設值對應到標準高度(例如 720p = 1280x720、1080p = 1920x1080)。寬度會依來源長寬比按比例縮放。
  • 尺寸會四捨五入為偶數,因為大多數影片編解碼器都有此要求。
  • 支援的最大解析度為 7680x43208K UHD)。