摄录员
视频转录通过 yt-dlp + 耳语翻译2 (更快的耳语引擎)——作为Claude的CLI或MCP服务器。
灵感
该项目基于以下理念 nhatvu148/视频转录器mcp --一个结合yt-dlp和OpenAI Whisper进行视频转录的TypeScript MCP服务器。我们采用了这个概念,并在Go中重新构建了它,但有一些关键的区别:
- 零依赖安装 通过
uvx--无需手动yt-dlp、耳语或Python设置 - 更快的耳语 (CTranslate2)而不是openai耳语——速度更快,内存使用率更低
- 单静态二进制 --无需Node.js/npm运行时
- CLI+MCP合二为一 --既可用作独立命令,也可用作MCP服务器
需求
- 紫外线 (提供
uvx--无需单独安装yt-dlp或耳语) ffmpeg
用法
# Transcribe a YouTube video
vidscribe "https://youtube.com/watch?v=XYZ"
# With browser cookie auth (for age-restricted / private videos)
vidscribe "https://youtube.com/watch?v=XYZ" --cookies-browser chrome
# Larger model, German language, all output formats
vidscribe "https://youtube.com/watch?v=XYZ" \
--model medium \
--language de \
--format txt,md,json,srt,vtt
# GPU acceleration (float16 is selected automatically when device is auto or cuda)
vidscribe "https://youtube.com/watch?v=XYZ" --model large --device cuda
# Check dependencies
vidscribe --mcp # then call check_dependencies via MCPMCP服务器(克劳德集成)
添加 ~/.claude.json:
{
"mcpServers": {
"vidscribe": {
"command": "vidscribe",
"args": ["--mcp"]
}
}
}可用的MCP工具:
| 工具 | 说明 |
|---|---|
transcribe_video | 下载+转录视频URL |
check_dependencies | 验证uvx、ffmpeg、yt-dlp、耳语翻译2 |
list_supported_sites | 列出所有1000+yt-dlp平台 |
transcribe_video 参数:
| 参数 | 默认值 | 说明 | |||||||
|---|---|---|---|---|---|---|---|---|---|
url | 必填 | 视频URL(仅限http/https) | |||||||
model | small | Whisper型号:小 | 底 | 小 | 中 | 大 | |||
language | auto | 语言代码或 auto | |||||||
output_dir | ./transcripts | 输出目录 | |||||||
cookies_browser | -- | cookie身份验证浏览器:chrome | firefox | safari | edge | chrome | brave | opera | vivaldi |
cookies_file | -- | Netscape cookie文件 | |||||||
js_runtime | auto | JS运行时: node:/path/to/node 或 deno:/path/to/deno | |||||||
engine | faster | Whisper发动机: faster 或 openai | |||||||
device | auto | 计算设备: auto, cpu, cuda. auto 选择CUDA(如果可用) | |||||||
compute_type | float16/int8 | 量化: int8, int8_float16, float16, float32.默认为 float16 对于CUDA, int8 CPU | |||||||
format | txt,md | 输出格式:txt、md、json、srt、vtt |
平台支持
| 平台 | 状态 | 注释 |
|---|---|---|
| Linux x86_64 | ✅ 完整 | 已测试 |
| Linux arm64✅ 满 | 如果CTranslate2车轮不可用,则返回openai耳语 | |
| macOS x86_64 | ✅ 完整 | 通过安装ffmpeg brew install ffmpeg |
| macOS arm64✅ 完整 | 苹果硅原生;通过安装ffmpeg brew install ffmpeg | |
| Windows x86_64 | ✅ 完整 | 通过安装ffmpeg winget install ffmpeg |
| Windows arm64 | ⚠️ 部分 | 转录可能失败(无CTranslate2/PyTorch arm64 Windows滚轮);yt-dlp和MCP服务器工作 |
YouTube兼容性
yt-dlp≥2025需要一个JavaScript运行时来提取YouTube。vidscribe自动检测 node 从PATH中自动传递。如果提取失败,请安装Node.js或deno,并确保它在PATH中。在Linux上, secretstorage 通过以下方式自动注射 uvx --with secretstorage 无需手动安装Python包即可启用浏览器cookie解密。
旗帜
| 标志 | 默认值 | 描述 | ||||
|---|---|---|---|---|---|---|
--model | small | Whisper型号:小 | 底 | 小 | 中 | 大 |
--language | auto | ISO 639-1语言代码或 auto | ||||
--output-dir | ./transcripts | 输出目录 | ||||
--cookies-browser | -- | cookie身份验证浏览器:chrome | firefox | safari | edge | |
--cookies-file | -- | Netscape cookie文件(如果秘密存储不可用,则回退) | ||||
--js-runtime | auto | yt-dlp YouTube提取的JS运行时: node:/path/to/node 或 deno:/path/to/deno.如果省略,则从PATH自动检测 | ||||
--format | txt,md | 输出格式:txt、md、json、srt、vtt | ||||
--engine | faster | Whisper发动机: faster 或 openai | ||||
--device | auto | 计算设备: auto, cpu, cuda. auto 选择CUDA(如果可用),否则选择CPU | ||||
--compute-type | int8 | 量化: int8, int8_float16, float16, float32.默认为 float16 当 --device 是 auto 或 cuda | ||||
--mcp | -- | 以MCP服务器(stdio)身份启动 | ||||
--verbose | -- | 详细输出 |
测试
使用Go构建标签将测试分为三层:
# Unit tests — pure logic, no external deps, <1s
make test
# Smoke tests — requires uvx + ffmpeg in PATH
make test-smoke
# E2E tests — requires uvx + ffmpeg + network, full transcription
make test-e2e
# Performance benchmarks (CPU vs CUDA vs openai-whisper)
make test-bench覆盖测试视频(默认:“我在动物园”,19秒):
VIDSCRIBE_TEST_URL="https://youtube.com/watch?v=..." make test-e2e
VIDSCRIBE_TEST_BROWSER=firefox make test-e2e| 层级 | 构建标签 | CI | 什么 |
|---|---|---|---|
| 单元 | -- | 每次推送 | 配置、格式化、下载助手、输入验证 |
| 烟雾 | smoke | 每周(integration.yml) | 依赖性检查、MCP协议、yt-dlp列表 |
| E2E | e2e | 手动 | 完整管路、发动机/设备比较、型号比较 |
