Files
lesson-highlights/README.md
T
hmo cf5004cf6a Clean up: remove junk files, update docs
- Delete: build scripts, old docs (README_BUILD, design.md, proposal.md, etc.)
- Update README.md and docs/ARCHITECTURE.md to reflect new architecture
- Keep run_lesson1.bat/py, start.bat, config.ini
2026-05-03 03:30:24 +08:00

102 lines
2.4 KiB
Markdown
Raw 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.
# Lesson Highlights Generator
教学视频精华片段生成工具。输入课程视频 + PPT,自动提取精华片段,转录、纠错、生成字幕,批量烧录到视频中。
## 功能特点
- **PPT 驱动提取**:根据 PPT 知识点定位视频中的讲解片段
- **语音转录 + 纠错**Whisper 转录 + LLM 批量校正
- **双轨字幕**:标题轨 + 内容轨
- **CLI / GUI 双入口**:共享同一套底层逻辑
## 快速开始
### 1. 配置 API
复制配置文件并填入 API Key
```bash
cp config.ini.example config.ini
# 编辑 config.ini,填入 api_key
```
### 2. 安装依赖
```bash
pip install -r requirements.txt
```
### 3. 运行
**GUI(推荐):**
```bash
.\start.bat
```
**CLI**
```bash
.\run_lesson1.bat
```
或通用方式:
```bash
python src/cli.py --video video.mp4 --ppt presentation.pptx --output ./output
```
## 项目结构
```
lesson-highlights/
├── src/
│ ├── main.py # GUI 入口
│ ├── gui.py # GUI(参数输入,调用底层)
│ ├── cli.py # CLI 入口
│ └── core/ # 共享底层
│ ├── ppt_parser.py # PPT 解析 + clips 生成
│ ├── pipeline.py # 视频处理流水线
│ ├── subtitle.py # 字幕生成
│ └── ...
├── config.ini # API 配置(不提交 git
├── config.ini.example # 配置模板
├── start.bat # 启动 GUI
└── run_lesson1.bat # CLI 示例
```
## 工作流程
1. **PPT 解析**:提取 PPT 文本和知识点
2. **Whisper 转录**:将视频语音转成文本
3. **LLM 校正**:批量校正转录错误
4. **片段提取**:根据 PPT 知识点定位视频片段
5. **字幕烧录**:生成双轨字幕并烧入视频
6. **合并输出**:拼接所有片段为最终视频
## API 配置
编辑 `config.ini`
```ini
[api]
api_host = "https://ark.cn-beijing.volces.com/api/coding/v3"
api_key = your_api_key_here
```
支持火山方舟(doubao-seed-2.0-lite)或兼容 OpenAI API 的后端。
## 输出
```
output/
├── generated_config.yaml # 生成的 clips 配置
├── clips/ # 提取的片段视频
├── subtitles/ # 字幕文件
└── final.mp4 # 最终输出
```
## 系统要求
- Python 3.10+
- FFmpeg(已打包在 `ffmpeg/` 目录)
- PySide6GUI
- faster-whisper(转录,可选)