refactor: extract config.py, add burn_only, fix title_segments and font size

- Extract all path/API config to config.py (single source of truth)
- Add run.py / burn_only.py / run.bat / burn.bat entry points
- burn_only: skip transcription/subtitle gen, fast reburn existing SRTs
- Fix title_segments: use transcript keyword time for split point
- Fix subtitle: each overlapping title shows max title_duration (not full clip)
- Fix burn_only font size: default from 90 to 60
- Delete old run_lesson1.bat/py, temp debug scripts
- Update README, ARCHITECTURE, CHANGELOG, add USAGE.md
This commit is contained in:
hmo
2026-05-03 23:22:10 +08:00
parent cf5004cf6a
commit aad1548348
39 changed files with 826 additions and 556 deletions
+41 -26
View File
@@ -26,40 +26,50 @@ cp config.ini.example config.ini
pip install -r requirements.txt
```
### 3. 运行
### 3. 配置
编辑 `config.py` 中的视频路径、PPT路径、API Key 等。所有配置集中在一个文件。
### 4. 运行
**完整流程(首次运行):**
```bash
.\run.bat
```
**快速烧录(仅修改字幕后重烧):**
```bash
.\burn.bat
```
**GUI(推荐):**
```bash
.\start.bat
```
**CLI**
```bash
.\run_lesson1.bat
```
或通用方式:
```bash
python src/cli.py --video video.mp4 --ppt presentation.pptx --output ./output
```
## 项目结构
```
lesson-highlights/
├── config.py # 统一配置(修改这里)
├── run.py # 完整流水线
├── burn_only.py # 快速烧录(跳过转录/字幕生成)
├── run.bat # 运行完整流程
├── burn.bat # 快速重烧字幕
├── src/
│ ├── main.py # GUI 入口
│ ├── gui.py # GUI(参数输入,调用底层)
│ ├── cli.py # CLI 入口
│ └── core/ # 共享底层
│ ├── ppt_parser.py # PPT 解析 + clips 生成
│ ├── pipeline.py # 视频处理流水线
│ ├── subtitle.py # 字幕生成
│ ├── 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 示例
├── config.ini # API 配置(不提交 git
├── config.ini.example # 配置模板
── docs/
├── USAGE.md # 使用指南
└── ...
```
## 工作流程
@@ -87,10 +97,15 @@ api_key = your_api_key_here
```
output/
├── generated_config.yaml # 生成的 clips 配置
├── clips/ # 提取的片段视频
├── subtitles/ # 字幕文件
└── final.mp4 # 最终输出
├── generated_config.yaml # clips 配置(可手动修改后重新运行)
├── intermediates/ # 中间文件
│ ├── clip*.json # Whisper 转录结果
│ └── clip*.mp4 # 提取的视频片段
├── subs/ # 字幕文件
│ ├── v1_title.srt # 标题轨(可手动修改)
│ └── v1_content.srt # 正文字幕
├── concat_merged.mp4 # 合并视频
└── final.mp4 # 最终输出
```
## 系统要求