mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
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.
2.1 KiB
2.1 KiB
description, i18n_source_hash, i18n_provenance, i18n_output_hash
| description | i18n_source_hash | i18n_provenance | i18n_output_hash |
|---|---|---|---|
| 将视频中的帧提取为图像 ZIP 包。 | b06f038dafb3 | human | 940e8089bda5 |
Video to Frames
从视频中提取单独的帧,并将其下载为包含 PNG 或 JPG 图像的 ZIP 归档。
API Endpoint
POST /api/v1/tools/video/video-to-frames
接受包含视频文件和 JSON settings 字段的 multipart 表单数据。
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| mode | string | No | "all" |
提取模式:all、nth、timestamps |
| n | integer | No | 10 |
每隔第 N 帧提取一次(2-1000)。仅当 mode 为 "nth" 时使用 |
| timestamps | string | No | "" |
以逗号分隔的时间戳,单位为秒。当 mode 为 "timestamps" 时必填 |
| format | string | No | "png" |
提取帧的图像格式:png、jpg |
Example Request
每隔第 30 帧提取一次,格式为 JPG:
curl -X POST http://localhost:1349/api/v1/tools/video/video-to-frames \
-H "Authorization: Bearer si_your-api-key" \
-F "file=@clip.mp4" \
-F 'settings={"mode": "nth", "n": 30, "format": "jpg"}'
在特定时间戳处提取帧:
curl -X POST http://localhost:1349/api/v1/tools/video/video-to-frames \
-H "Authorization: Bearer si_your-api-key" \
-F "file=@clip.mp4" \
-F 'settings={"mode": "timestamps", "timestamps": "1.5,5,12.3"}'
Example Response
{
"jobId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"downloadUrl": "/api/v1/download/a1b2c3d4-e5f6-7890-abcd-ef1234567890/clip-frames.zip",
"originalSize": 12500000,
"processedSize": 45000000
}
Notes
all模式会提取每一帧,对于长视频可能生成非常大的 ZIP 文件。请使用nth或timestamps模式进行选择性提取。- PNG 保留完整质量,但生成的文件较大。JPG 更小,但为有损格式。
- 响应会下载为包含按顺序编号的图像文件的 ZIP 归档。