mcpField
T
transcribe

transcribe

github.com/aviz85创意与媒体5039 次安装16 周前更新
代码仓库

关于 transcribe

这项命令行技能使用 ElevenLabs Scribe v2 将音频或视频转为 SRT 字幕。它支持自动识别或指定语言、调整字幕限制,并可选输出转录 JSON。

主要功能

  1. 01转录音频和视频
  2. 02自动识别或指定语言
  3. 03调整字幕长度和时间
  4. 04导出 SRT 字幕
  5. 05可选输出带时间戳的 JSON

适用场景

  1. 01为视频生成字幕
  2. 02转录指定语言的音频
  3. 03调整字幕分段以提升可读性
  4. 04保存带词级时间戳的转录内容

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/aviz85/claude-skills-library --skill transcribe

安装后在 Claude Code 中输入/transcribe确认已加载。

包含的文件

除 SKILL.md 外,安装时一起下载的参考资料和脚本。

SETUP.md
scripts/
.env.example
package.json
transcribe.ts
tsconfig.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-lauto语言代码(en、he、ar 等)
--max-words5每条字幕的最多单词数
--max-duration3.0每条字幕的最长时长(秒)
--max-chars70每条字幕的最多字符数
--timing-offset0.25时间偏移量(秒)
--jsonfalse同时输出原始转录 JSON

语言代码

  • en - 英语
  • he - 希伯来语
  • ar - 阿拉伯语
  • es - 西班牙语
  • fr - 法语
  • de - 德语
  • ru - 俄语
  • zh - 中文
  • ja - 日语
  • (或省略以自动检测)

输出

脚本会生成:

  1. .srt 文件 - 标准字幕文件
  2. .json 文件(可选)- 包含单词级时间戳的原始转录

环境

API 密钥存储在 scripts/.env 中:

ELEVENLABS_API_KEY=your_key_here

评论

支持 Markdown