mcp-demo/projects/auto-editor/README.md
2026-07-27 14:36:05 +08:00

2.0 KiB
Raw Blame History

带货短视频自动化剪辑全链路流水线

基于分镜头向量检索能力,实现「素材预处理入库 → 口播脚本自动匹配镜头 → 智能剪辑合成 → 成片质检导出」的全链路自动化。

快速开始

# 1. 安装
cd auto-editor
pip install -e ".[all]"

# 2. 配置环境变量
cp .env.example .env
# 编辑 .env 填入 API Key 等配置

# 3. 启动 Milvus需要 Docker
docker compose up -d

# 4. 素材入库
python -m auto_editor.ingest.pipeline --input ./raw_assets --output ./data/hot

# 5. 生成成片
python -m auto_editor.api.server  # 启动 API 服务
curl -X POST http://localhost:8000/edit \
  -H "Content-Type: application/json" \
  -d '{"script": "这款产品效果非常好...", "duration": 30}'

项目结构

auto-editor/
├── src/auto_editor/
│   ├── core/              # 核心模块数据模型、FFmpeg、Whisper、元数据
│   ├── config/            # 配置管理Pydantic Settings
│   ├── ingest/            # Phase 1: 素材预处理流水线
│   ├── vectorize/         # Phase 2: 向量化引擎
│   ├── script_engine/     # Phase 3: 脚本结构化引擎
│   ├── retrieval/         # Phase 4: 检索与匹配引擎
│   ├── editing/           # Phase 5: 剪辑合成引擎
│   ├── packaging/         # Phase 6: 包装与质检
│   ├── rules/             # Phase 7: 营销规则引擎
│   └── api/               # Phase 8: API 服务层
├── configs/               # 规则配置、模型配置
├── tests/                 # 单元测试
└── scripts/               # 运维脚本

技术栈

组件 选型
向量模型 Qwen3-VL-Embedding (DashScope API)
向量库 Milvus 2.x
字幕提取 faster-whisper (本地)
镜头检测 TransNetV2 (本地 GPU)
脚本拆分 Qwen3-8B / 云端 API
TTS CosyVoice / GPT-SoVITS / doubao-seed-tts
视频处理 FFmpeg
任务队列 Celery + Redis
API FastAPI