video-understand
它能做什么
这项技能把视频拆分为静态帧和文字稿,让 AI 能够查看视频展示和说出的内容。适合想在不上传视频的情况下,了解视频内容的人。
适用场景
- ✓当你有一段视频,并希望得到其中发生内容的摘要时。
- ✓当你需要视频中口语内容的文字稿时。
- ✓当你想要从关键时刻截取静态图片进行查看时。
技能链接
https://github.com/calesthio/OpenMontage/blob/main/.agents/skills/video-understand/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请告诉我这段视频里发生了什么,并把人们说的话转写下来。”
每周 5 个新技能,1 分钟读完。
工作原理
这项技能使用 ffmpeg 按设定的间隔选出场景或帧,并使用名为 Whisper 的语音转文字工具记录音频,然后把结果保存为 JSON 文件。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
video-understand
Understand video content locally using ffmpeg for frame extraction and Whisper for transcription. Fully offline, no API keys required.
Prerequisites
ffmpeg+ffprobe(required):brew install ffmpegopenai-whisper(optional, for transcription):pip install openai-whisper
Commands
# Scene detection + transcribe (default)
python3 skills/video-understand/scripts/understand_video.py video.mp4
# Keyframe extraction
python3 skills/video-understand/scripts/understand_video.py video.mp4 -m keyframe
# Regular interval extraction
python3 skills/video-understand/scripts/understand_video.py video.mp4 -m interval
# Limit frames extracted
python3 skills/video-understand/scripts/understand_video.py video.mp4 --max-frames 10
# Use a larger Whisper model
python3 skills/video-understand/scripts/understand_video.py video.mp4 --whisper-model small
# Frames only, skip transcription
python3 skills/video-understand/scripts/understand_video.py video.mp4 --no-transcribe
# Quiet mode (JSON only, no progress)
python3 skills/video-understand/scripts/understand_video.py video.mp4 -q
# Output to file
python3 skills/video-understand/scripts/understand_video.py video.mp4 -o result.json
CLI Options
| Flag | Description |
|---|---|
video |
Input video file (positional, required) |
-m, --mode |
Extraction mode: scene (default), keyframe, interval |
--max-frames |
Maximum frames to keep (default: 20) |
--whisper-model |
Whisper model size: tiny, base, small, medium, large (default: base) |
--no-transcribe |
Skip audio transcription, extract frames only |
-o, --output |
Write result JSON to file instead of stdout |
-q, --quiet |
Suppress progress messages, output only JSON |
Extraction Modes
| Mode | How it works | Best for |
|---|---|---|
scene |
Detects scene changes via ffmpeg select='gt(scene,0.3)' |
Most videos, varied content |
keyframe |
Extracts I-frames (codec keyframes) | Encoded video with natural keyframe placement |
interval |
Evenly spaced frames based on duration and max-frames | Fixed sampling, predictable output |
If scene mode detects no scene changes, it automatically falls back to interval mode.
Output
The script outputs JSON to stdout (or file with -o). See references/output-format.md for the full schema.
{
"video": "video.mp4",
"duration": 18.076,
"resolution": {"width": 1224, "height": 1080},
"mode": "scene",
"frames": [
{"path": "/abs/path/frame_0001.jpg", "timestamp": 0.0, "timestamp_formatted": "00:00"}
],
"frame_count": 12,
"transcript": [
{"start": 0.0, "end": 2.5, "text": "Hello and welcome..."}
],
"text": "Full transcript...",
"note": "Use the Read tool to view frame images for visual understanding."
}
Use the Read tool on frame image paths to visually inspect extracted frames.
References
references/output-format.md-- Full JSON output schema documentation
常见问题
它需要网络连接或 API 密钥吗?
不需要。这项技能说明它可以离线工作,无需 API 密钥。
转写是必需的吗?
不是。你可以跳过转写,只提取帧。
结果是什么格式?
这项技能把输出保存为 JSON 文件,你可以选择保存的位置。
详情
作者的原始描述
Understand video content locally using ffmpeg frame extraction and Whisper transcription. No API keys needed. Use when: (1) Understanding what a video contains, (2) Transcribing video audio locally, (3) Extracting key frames for visual analysis, (4) Getting video content without API keys.
repo: calesthio/OpenMontage
热度
- GitHub 星标
- 75k
- 排名
- #2700
- 许可证
- AGPL-3.0
- 更新时间
- 2026/10/28
评论
- …