Files
hmo 04db423416 Initial commit: skills library
- 70 skills with code and documentation
- Add .gitignore (ignore __pycache__, output/, temp/, venv/)
- Clean up test intermediates and caches
2026-04-26 19:27:40 +08:00

75 lines
2.3 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 钢琴课精华视频生成技能使用说明
## 快速开始
### 1. 准备工作
1. 准备好原始钢琴课视频文件(MP4格式)
2. 准备配套PPT/PDF文件,提取知识点的名称和对应的时间点
3. 复制`references/config_template.yaml`为你的项目配置文件,比如`my_course_config.yaml`
### 2. 编辑配置文件
修改你的配置文件:
```yaml
video_src: "你的视频路径.mp4"
clips:
- title: "知识点1名称"
start: 开始时间(秒)
end: 结束时间(秒)
- title: "知识点2名称"
start: 开始时间
end: 结束时间
# 添加更多知识点...
term_corrections:
# 扩展你的术语纠正规则
"错误词": "正确词"
```
### 3. 运行生成脚本
```bash
python scripts/generate_highlights.py --config your_config.yaml --output ./output_dir
```
### 4. 审核与修改
生成后会在输出目录下得到:
- `vN_final.mp4` - 最终视频(N为版本号,自动递增)
- `subs/v1_original.srt` - 原始转录字幕
- `subs/v1_terms.srt` - 术语库纠正后字幕
- `subs/v1_ai.srt` - AI上下文纠正后字幕
如果需要修改字幕,直接编辑对应版本的srt文件,然后重新运行脚本即可生成新版本。
## 高级用法
### 自定义术语库
参考`references/terms_template.md`扩展你的术语库,添加到配置文件的`term_corrections`字段。
### 调整样式
在配置文件中修改:
- 标题大小、颜色、显示时长
- 字幕大小、颜色
- 转场时长
- 转录模型(如果需要更高精度用large模型)
### 重新生成
如果只修改了字幕,不需要重新转录,可以直接使用修改后的srt文件烧录:
```bash
ffmpeg -i concated.mp4 -vf "subtitles=modified.srt" -c:a copy new_version.mp4
```
## 输入要求
- 视频格式:MP4/H.264编码
- 视频时长:建议不超过2小时
- 知识点数量:建议3-10个,每个20-60秒
- 音频质量:清晰无杂音,识别效果更好
## 常见问题
### 字幕识别不准怎么办?
1. 扩展术语库,添加更多常见错误映射
2. 使用更大的Whisper模型(large
3. 手动修改srt文件重新生成
### 时间戳不对怎么办?
检查配置文件中的知识点开始/结束时间是否正确,确保时间是视频中的实际秒数。
### 字幕不同步怎么办?
确保转录和切分使用的是同一个原始视频,没有经过二次编辑。