Files
nite 790c775eac fix: pin transcription project to Python 3.12
- Set bundled FunASR transcription project to Python 3.12
- Restrict requires-python to >=3.12,<3.13 and refresh uv.lock
- Document Windows editdistance wheel issue on Python 3.13
- Update README/SKILL prerequisites to recommend Python 3.12
- Add Windows FunASR uv setup troubleshooting reference
2026-07-14 14:40:01 +08:00

101 lines
4.5 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.
# Video Edit Planner 视频剪辑规划助手
一个 agent skill,通过迭代式对话帮助规划视频剪辑——转录音频、按需提取关键帧、分析画面内容,最终生成结构化的剪辑规划。
**仓库地址**: https://git.nite07.com/nite/video-edit-planner-skill
## 功能特性
- **音频转录** — 内置 [funasr-script](https://github.com/modelscope/FunASR),默认使用 Fun-ASR-Nano(高质量,中文优化),SenseVoice 可用于快速预览
- **按需抽帧** — 基于 ffmpeg 的片段剪辑(`-c copy`)+ 场景变化检测 + 均匀采样,优先使用硬件加速(CUDA/NVDEC)
- **产物索引** — JSON 文件记录所有转录、剪辑片段和帧图片,使用相对路径,避免跨会话重复处理
- **视觉分析指引** — 二分查找式帧采样策略;兼容 agent 运行时提供的任何视觉模型
- **迭代式剪辑规划** — Markdown 表格输出(时间码、片段描述、操作建议、转场方式、备注),支持追问细化
- **Agent 无关** — 不包含任何平台特定工具名;兼容任何 agent 框架(Hermes、Claude Code、Codex 等)
## 快速开始
### 前置依赖
| 依赖 | 安装方式 |
|---|---|
| `ffmpeg` + `ffprobe` | Linux: `pacman -S ffmpeg` / `apt install ffmpeg`macOS: `brew install ffmpeg`Windows: `winget install Gyan.FFmpeg` |
| `uv` | Linux: `pacman -S uv`macOS: `brew install uv`Windows: `winget install astral-sh.uv`;备用: `pip install uv` |
| `python3` / Python 3.12 | Linux: `pacman -S python`macOS: `brew install python@3.12`Windows: `winget install Python.Python.3.12` |
### 安装 skill
**方式一:`npx skills add`(推荐)**
本 skill 兼容 [开放 agent skills 生态](https://www.npmjs.com/package/skills),可以直接安装:
```bash
# 全局安装(跨项目可用)
npx skills add https://git.nite07.com/nite/video-edit-planner-skill.git -g -y
# 安装到指定 agent
npx skills add https://git.nite07.com/nite/video-edit-planner-skill.git -g -a claude-code -y
# 列出可用 skill(不安装)
npx skills add https://git.nite07.com/nite/video-edit-planner-skill.git --list
```
支持 73+ agent 框架,包括 Claude Code、Codex、Cursor、OpenCode 等。
**方式二:`git clone`(手动)**
```bash
git clone https://git.nite07.com/nite/video-edit-planner-skill.git ~/.hermes/skills/media/video-edit-planner
```
Hermes Agent 用户克隆到 `~/.hermes/skills/media/`。其他 agent 请遵循各自的 skills 目录约定。
## 工作流程
```
1. 检查依赖(ffmpeg、uv、python3
2. 收集输入(视频路径 + 音轨索引)
3. 询问剪辑需求
4. 转录音频(如索引中已有缓存则跳过)
5. 按需提取片段和帧(agent 自主判断转录稿是否足够)
6. 用视觉模型分析帧(二分查找式采样)
7. 生成 Markdown 表格剪辑规划 + 总体建议
8. 迭代——用户追问,规划逐步细化
```
## 目录结构
```
video-edit-planner/
├── SKILL.md # Skill 定义(工作流程、指引、注意事项)
├── README.md # 英文说明
├── README.zh.md # 本文件(中文)
├── scripts/
│ ├── transcription/ # 内置 funasr-script(自包含 uv 项目)
│ │ ├── pyproject.toml
│ │ ├── uv.lock
│ │ ├── funasr_common.py # 共享:ffprobe、音频提取、模型运行
│ │ ├── funasr_nano.py # Fun-ASR-Nano 入口(默认,高质量)
│ │ ├── funasr_fast.py # SenseVoice 入口(快速预览)
│ │ └── funasr_regular.py # Paraformer 入口(对比用)
│ ├── frames/
│ │ └── extract_frames.py # 片段提取 + 抽帧(ffmpeg 封装)
│ └── index/
│ └── manage_index.py # JSON 索引管理(8 个子命令)
└── references/
└── frame-extraction-guide.md # 视觉模型 token 成本、分辨率/批次指引
```
## 索引文件
所有处理产物记录在 JSON 文件(`<视频文件名>.vedit.json`)中,存放在视频文件同目录:
- **transcriptions** — JSON 路径、音轨索引、时长
- **clips** — 起止时间、文件路径、提取原因
- **frames** — 时间戳、文件路径、场景分数、提取方法
所有路径存储为**相对路径**(相对于视频目录),移动整个目录不会破坏引用。JSON 文件可读性强,可用任意文本编辑器直接编辑。
## 许可证
MIT