视频转文本
video2txt
by chentx1243
将本地视频或音频文件转写为 SRT 字幕文件和 TXT 纯文本文件
安装
claude skill add --url github.com/openclaw/skills/tree/main/skills/chentx1243/maple-video2txt文档
video2txt 技能
描述
将本地视频或音频文件转写为 SRT 字幕文件和 TXT 纯文本文件。
功能
- 提取视频/音频中的语音内容
- 生成带时间戳的 SRT 字幕文件
- 生成纯文本 TXT 文件
- 支持多种视频和音频格式
- 默认使用中文识别,自动转换为简体中文
使用场景:
- 需要读取视频内容或理解视频时
使用方法
基本命令
python video_to_text.py --input <视频/音频文件路径>
注意事项
- 后台执行:调用此脚本时,务必使用
background: true参数,避免弹出控制台窗口 - 脚本运行过程中会输出详细的进度日志(每 10% 报告一次),方便追踪执行状态
示例
# 基本用法
python video_to_text.py --input "D:\videos\meeting.mp4"
# 指定输出目录
python video_to_text.py --input "D:\videos\meeting.mp4" --output-dir "D:\captions"
# 指定输出路径
python video_to_text.py --input "D:\videos\meeting.mp4" --output-path "D:\captions\meeting_result"
# 指定语言和模型
python video_to_text.py --input "D:\videos\meeting.mp4" --language zh --model-size small
参数说明
| 参数 | 说明 | 默认值 |
|---|---|---|
--input | 输入文件路径(必需) | - |
--output-dir | 输出目录 | 输入文件目录 |
--output-path | 输出文件基础路径 | - |
--model-dir | 模型下载目录 | 当前目录/models |
--model-size | Whisper 模型大小 | base |
--language | 识别语言 (auto/zh/en) | zh |
--device | 推理设备 (cpu/cuda) | cpu |
--compute-type | 计算类型 | int8 |
--beam-size | 解码束大小 (1-5) | 2 |
--no-vad-filter | 禁用 VAD 过滤 | false |
依赖
- faster-whisper >= 1.1.0
- av >= 12.0.0
- opencc-python-reimplemented >= 0.1.7
- ffprobe/ffmpeg
- Whisper 模型文件(首次运行自动下载,需要发起网络请求,占用磁盘空间)
安装
- 确保 Python 3.11 或 3.12 环境
- 安装依赖:
python -m pip install -r requirements.txt - 首次运行会自动下载 Whisper 模型到 models 目录
输出文件
<输入文件名>.srt- 带时间戳的字幕文件<输入文件名>.txt- 纯文本文件
注意事项
- 首次运行需要下载 Whisper 模型,可能需要几分钟时间
- 建议使用 Python 3.11 或 3.12,避免与 faster-whisper 的兼容性问题
- 中文识别会自动将繁体字转换为简体字
- 为了减少用户等待焦虑,每间隔10秒左右报告一次处理进度
- beam-size 默认为 2,如需调整可手动指定 --beam-size 参数
相关 Skills
Claude API
by anthropic
Build, debug, and optimize Claude API / Anthropic SDK apps. Apps built with this skill should include prompt caching. Also handles migrating existing Claude API code between Claude model versions (4.5 → 4.6, 4.6 → 4.7, retired-model replacements). TRIGGER when: code imports `anthropic`/`@anthropic-ai/sdk`; user asks for the Claude API, Anthropic SDK, or Managed Agents; user adds/modifies/tunes a Claude feature (caching, thinking, compaction, tool use, batch, files, citations, memory) or model (Opus/Sonnet/Haiku) in a file; questions about prompt caching / cache hit rate in an Anthropic SDK project. SKIP: file imports `openai`/other-provider SDK, filename like `*-openai.py`/`*-generic.py`, provider-neutral code, general programming/ML.
并行代理
by axelhu
Use when facing 2 or more independent tasks that can be worked on without shared state - dispatches parallel subagents using sessions_spawn for concurrent investigation and execution, adapted for OpenClaw
高光制作器
by bwbernardweston18
>