关于 transcribe
这项命令行技能使用 ElevenLabs Scribe v2 将音频或视频转为 SRT 字幕。它支持自动识别或指定语言、调整字幕限制,并可选输出转录 JSON。
主要功能
- 01转录音频和视频
- 02自动识别或指定语言
- 03调整字幕长度和时间
- 04导出 SRT 字幕
- 05可选输出带时间戳的 JSON
适用场景
- 01为视频生成字幕
- 02转录指定语言的音频
- 03调整字幕分段以提升可读性
- 04保存带词级时间戳的转录内容
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ aviz85/ claude-skills-library --skill transcribe安装后在 Claude Code 中输入/transcribe确认已加载。
包含的文件
除 SKILL.md 外,安装时一起下载的参考资料和脚本。
SETUP.mdscripts/.env.examplepackage.jsontranscribe.tstsconfig.json详细介绍
转录
首次使用? 如果上方的
setup_complete: false,请先运行./SETUP.md,然后设置setup_complete: true。
使用 ElevenLabs Scribe v2 从音频/视频生成 SRT 字幕文件。
快速开始
cd ~/.claude/skills/transcribe/scripts
# Basic transcription (auto-detect language)
npx ts-node transcribe.ts -i /path/to/video.mp4 -o /path/to/output.srt
# Specify language
npx ts-node transcribe.ts -i /path/to/video.mp4 -o /path/to/output.srt -l en
# Custom subtitle length (max words per entry)
npx ts-node transcribe.ts -i /path/to/video.mp4 -o /path/to/output.srt --max-words 6
# Custom max duration per subtitle
npx ts-node transcribe.ts -i /path/to/video.mp4 -o /path/to/output.srt --max-duration 4.0
选项
| 选项 | 简写 | 默认值 | 描述 |
|---|---|---|---|
--input | -i | (必填) | 输入音频/视频文件 |
--output | -o | (必填) | 输出 SRT 文件路径 |
--language | -l | auto | 语言代码(en、he、ar 等) |
--max-words | 5 | 每条字幕的最多单词数 | |
--max-duration | 3.0 | 每条字幕的最长时长(秒) | |
--max-chars | 70 | 每条字幕的最多字符数 | |
--timing-offset | 0.25 | 时间偏移量(秒) | |
--json | false | 同时输出原始转录 JSON |
语言代码
en- 英语he- 希伯来语ar- 阿拉伯语es- 西班牙语fr- 法语de- 德语ru- 俄语zh- 中文ja- 日语- (或省略以自动检测)
输出
脚本会生成:
.srt文件 - 标准字幕文件.json文件(可选)- 包含单词级时间戳的原始转录
环境
API 密钥存储在 scripts/.env 中:
ELEVENLABS_API_KEY=your_key_here
评论
支持 Markdown