Files
SnapOtter/apps/docs/zh-CN/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 686f8a6eaf6c

Resize Video

使用自定义像素尺寸或标准预设将视频缩放到新的分辨率。

API Endpoint

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

接受包含视频文件和 JSON settings 字段的 multipart 表单数据。

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 = 1280x7201080p = 1920x1080)。宽度会根据源宽高比按比例缩放。
  • 根据大多数视频编解码器的要求,尺寸会被舍入为偶数。
  • 支持的最大分辨率为 7680x43208K UHD)。