Available in
Marketplaces, most starred first
Tags
Add to README
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
By Esonhughv0.1.0MITIn 1 marketplace
将视频教程转换为结构化 Markdown 文档,供 AI 阅读和使用。基于 mlx-whisper 语音转录 + Apple Vision OCR + 智能抽帧。
You run one by typing its /name in Claude Code.
No risk signals detected
Nothing flagged in this plugin's hooks, MCP servers or commands. Other components are not analyzed.
Static checks of hooks, mods, MCP servers and commands. Not a security audit.
1 marketplace, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
视频教程转 Markdown 文本教程工具。专为 Apple Silicon Mac 优化,利用 mlx-whisper GPU 加速转录 + macOS 原生 Vision OCR 提取屏幕内容。
安全/编程课程视频(OSCP、WEB-300、EXP-312 等)知识密度极高,但视频格式不便检索和复习。v2t 自动提取三类核心信息:语音讲解 → 理解思路,屏幕内容 → 查看输出,终端命令 → 可直接复制执行。
| 决策 | 选择 | 原因 |
|---|---|---|
| 转录引擎 | mlx-whisper | Apple Silicon Metal 加速,比 PyTorch Whisper 快 3-5x |
| OCR 引擎 | Apple Vision | 零额外依赖、Live Text 同款、系统内置 |
| 管线模式 | Phase 串行 + 纯函数 | 可独立测试/替换每个 Phase,数据流清晰 |
| 命令提取 | LLM + regex 双引擎 | LLM 处理复杂交互工具 prompt,regex 高速兜底 |
| 数据格式 | list/dict,无自定义类 | 最大互操作性,任何工具可读写中间结果 |
| 降级策略 | 每 Phase 自行降级 | 单点失败不中断管线(ollama 挂→用 regex) |
| 依赖 | 说明 | 安装方式 |
|---|---|---|
| macOS | 需要 Apple Vision Framework | 系统自带 |
| Apple Silicon | M1/M2/M3/M4,mlx-whisper 依赖 Metal GPU | 硬件要求 |
| Python >= 3.11 | 运行时 | brew install [email protected] |
| uv | Python 包管理与脚本运行器 | curl -LsSf https://astral.sh/uv/install.sh | sh |
| ffmpeg / ffprobe | 音视频处理(抽帧、提取音频) | brew install ffmpeg |
| ollama(可选) | 本地 LLM 命令提取 | brew install ollama + ollama pull qwen2.5:7b |
在 pyproject.toml 中声明,uv 自动管理:
| 包名 | 用途 |
|---|---|
mlx-whisper | Apple Silicon GPU 加速的 Whisper 语音转录 |
pyobjc-framework-Vision | Python 绑定 macOS Vision Framework(OCR) |
Pillow | 图像处理(感知哈希计算) |
# 1. 安装 uv(如果还没有)
curl -LsSf https://astral.sh/uv/install.sh | sh
# 2. 安装 ffmpeg
brew install ffmpeg
# 3. 克隆仓库
git clone <repo-url> && cd video-extractor
# 4. 安装 Python 依赖(uv 自动解析 pyproject.toml,创建虚拟环境)
uv sync
# 5.(可选)安装 ollama 用于 LLM 命令提取
brew install ollama
ollama pull qwen2.5:7b
# 处理单个视频(输出同名 .md)
uv run video-extractor input.mp4
# 指定输出路径
uv run video-extractor input.mp4 -o output.md
# 也可以直接运行脚本
uv run scripts/extract.py input.mp4 -o output.md
# 使用更大的模型获得更好的转录质量
uv run video-extractor input.mp4 -m large-v3
# 指定语言(中文)
uv run video-extractor input.mp4 -l zh
# 调整场景检测灵敏度(0-1,越高越敏感,抽帧越多)
uv run video-extractor input.mp4 -s 0.5
# 批量处理目录下所有 MP4
uv run video-extractor ./videos/ -o ./output/
| 参数 | 说明 | 默认值 |
|---|---|---|
input | MP4 文件或包含 MP4 的目录 | (必填) |
-o, --output | 输出 Markdown 文件路径 | 与输入同名 .md |
-m, --model | Whisper 模型大小 | small |
-l, --language | 语言代码 | en |
-s, --scene | 场景检测灵敏度 0-1 | 0.3 |
| 模型 | 速度 | 质量 | VRAM | 适用场景 |
|---|---|---|---|---|
tiny | ~30x 实时 | 一般 | ~1GB | 快速预览、确认管线正常 |
base | ~20x 实时 | 尚可 | ~1GB | 简单英文内容 |
small | ~10x 实时 | 好 | ~2GB | 默认推荐,平衡速度与质量 |
medium | ~5x 实时 | 很好 | ~5GB | 口音重或专业术语多 |
large-v3 | ~2x 实时 | 最佳 | ~10GB | 最高精度需求 |
MP4 输入
│
├─ Phase 1: 音频提取 + mlx-whisper 转录
│ ├─ ffmpeg 提取 16kHz 单声道 WAV
│ ├─ mlx-whisper GPU 转录(含词级时间戳)
│ └─ 输出: [{start, end, text}, ...] 带时间戳的文本段落
│
├─ Phase 2: 六策略智能抽帧
│ ├─ 策略 A: 场景变化检测(ffmpeg scene filter)
│ ├─ 策略 B: 语音停顿点(transcript gap > 1.5s)
│ ├─ 策略 C: 键盘敲击结束(音频波形分析)
│ ├─ 策略 D: 窗口切换(标题栏 OCR diff)
│ ├─ 策略 E: 两遍法(粗采哈希→密集区精采)
│ ├─ 策略 F: 停顿区均匀密采
│ ├─ 合并: ±1s 内去重取中点
│ └─ 输出: [{file, timestamp, path}, ...] 关键帧列表
│
├─ Phase 3: Apple Vision OCR + 三层过滤
│ ├─ Vision OCR: 每帧图片 → 文本
│ ├─ Stage 1: UI 噪声剥离(正则全行匹配删除)
│ ├─ Stage 2: 质量门控(乱码/过短/装饰帧丢弃)
│ ├─ Stage 3: 滚动感知去重(相似帧分组→选最优)
│ └─ 输出: [{file, timestamp, path, ocr_text}, ...]
│
├─ Phase 4: 终端命令提取
│ ├─ 首选: ollama LLM 提取(JSON 格式返回)
│ ├─ 回退: 正则引擎(shell prompt 模式匹配)
│ ├─ 后处理: 清洗 + 可信度过滤
│ └─ 输出: [{timestamp, command}, ...]
│
├─ Phase 4.5: 课程标题帧检测
│ ├─ 匹配已知课程关键词(WEB-300、PEN-200 等)
│ └─ 输出: {course, topic}
│
└─ Phase 5: 组装输出 Markdown
├─ 所有事件按时间轴排序
├─ Whisper 幻觉去重(连续相同 speech 合并)
├─ 命令汇总 Cheatsheet
└─ 时间轴: 转录 + OCR 折叠块 + 命令代码块
生成的 Markdown 包含:
# 视频标题
**Course:** 课程系列名
**Topic:** 课程主题
## Commands Cheatsheet
(提取的终端命令汇总,去重后)
## Full Timeline
### [00:00:00]
**[00:00:05]** 语音转录文本...
<details><summary>[00:01:23] Screen Content</summary>
(OCR 提取的屏幕内容,已去噪去重)
</details>
```bash
# [00:01:25]
nmap -sV 192.168.1.1
## 外部 CLI 工具依赖说明
| 工具 | 用途 | 调用场景 |
|------|------|----------|
| `ffprobe` | 获取视频时长和元信息 | Phase 1/2 |
| `ffmpeg` | 提取音频 WAV、关键帧截图 | Phase 1/2 |
| `ollama` | 本地 LLM 推理(命令提取) | Phase 4(可选,不安装自动回退 regex) |
### ffmpeg 使用详情
Built from public signals: copy clicks on this site, GitHub stars and activity, the README and the manifest. Not a security audit or an endorsement.
video-extractor@Esonhugh-Marketplace is listed by esonhugh/marketplace — review the source before installing
npx claudepluginhub esonhugh/marketplace --plugin video-extractorPlugins from other owners that cover similar ground