refactor: switch index from SQLite to JSON with relative paths

manage_index.py:
- Complete rewrite from SQLite to JSON file format
- All file paths stored as relative (relative to video directory)
- Moving the entire video directory does not break references
- Paths outside video dir stored as absolute (editable in text editor)
- Same 8 subcommands, same CLI interface

SKILL.md:
- Step 5: SQLite schema replaced with JSON structure example
- Verification checklist: .vedit.db → .vedit.json

README.md + README.zh.md:
- Features: 'SQLite database' → 'JSON file with relative paths'
- Project structure: 'SQLite index management' → 'JSON index management'
- 'Index Database' section → 'Index File' with relative path explanation

.gitignore:
- *.vedit.db → *.vedit.json
This commit is contained in:
2026-07-14 13:12:54 +08:00
parent 39400e2bb1
commit c771bdcfaf
5 changed files with 200 additions and 176 deletions
+6 -6
View File
@@ -8,7 +8,7 @@
- **音频转录** — 内置 [funasr-script](https://github.com/modelscope/FunASR),默认使用 Fun-ASR-Nano(高质量,中文优化),SenseVoice 可用于快速预览
- **按需抽帧** — 基于 ffmpeg 的片段剪辑(`-c copy`)+ 场景变化检测 + 均匀采样,优先使用硬件加速(CUDA/NVDEC)
- **产物索引** — SQLite 数据库记录所有转录、剪辑片段和帧图片,避免跨会话重复处理
- **产物索引** — JSON 文件记录所有转录、剪辑片段和帧图片,使用相对路径,避免跨会话重复处理
- **视觉分析指引** — 二分查找式帧采样策略;兼容 agent 运行时提供的任何视觉模型
- **迭代式剪辑规划** — Markdown 表格输出(时间码、片段描述、操作建议、转场方式、备注),支持追问细化
- **Agent 无关** — 不包含任何平台特定工具名;兼容任何 agent 框架(Hermes、Claude Code、Codex 等)
@@ -81,20 +81,20 @@ video-edit-planner/
│ ├── frames/
│ │ └── extract_frames.py # 片段提取 + 抽帧(ffmpeg 封装)
│ └── index/
│ └── manage_index.py # SQLite 索引管理(8 个子命令)
│ └── manage_index.py # JSON 索引管理(8 个子命令)
└── references/
└── frame-extraction-guide.md # 视觉模型 token 成本、分辨率/批次指引
```
## 索引数据库
## 索引文件
所有处理产物记录在 SQLite 数据库`<视频文件名>.vedit.db`)中,存放在视频文件同目录:
所有处理产物记录在 JSON 文件`<视频文件名>.vedit.json`)中,存放在视频文件同目录:
- **transcription** — JSON 路径、音轨索引、时长
- **transcriptions** — JSON 路径、音轨索引、时长
- **clips** — 起止时间、文件路径、提取原因
- **frames** — 时间戳、文件路径、场景分数、提取方法
这避免了跨会话对同一视频重复转录或重复抽帧
所有路径存储为**相对路径**(相对于视频目录),移动整个目录不会破坏引用。JSON 文件可读性强,可用任意文本编辑器直接编辑
## 许可证