mv-generator

$npx mdskill add aAAaqwq/AGI-Super-Team/mv-generator

Generate complete music videos from audio and lyrics instantly.

  • Creates end-to-end music videos for virtual singers.
  • Integrates audio analysis, image generation, and video synthesis.
  • Analyzes BPM and lyrics to design scenes and frames.
  • Outputs final merged video with synced audio and subtitles.

SKILL.md

.github/skills/mv-generatorView on GitHub ↗
---
name: mv-generator
description: MediaClaw 内置的音乐视频端到端生成技能。
  End-to-end MV (music video) generation pipeline for virtual singers.
  Audio analysis → Scene timeline → Frame generation → Video generation → Final merge.
  Use when: creating music videos, generating MV frames, syncing video to audio.
---

# MV Generator — 音乐视频生成管线

MediaClaw 内置的音乐视频端到端生成技能。

## 触发词
- 生成MV
- MV制作
- 音乐视频
- mv generator
- 虚拟歌手MV

## 管线流程

```
音频文件 + 歌词 + 角色卡
        │
        ▼
┌────────────────────────────┐
│  Step 1: 音频分析            │
│  scripts/audio-analyzer.py  │
│  → 时长、BPM、场景时间线     │
└────────────┬───────────────┘
             │
             ▼
┌────────────────────────────┐
│  Step 2: 歌词解析            │
│  scripts/lyrics-parser.py   │
│  → 段落结构、情绪曲线        │
└────────────┬───────────────┘
             │
             ▼
┌────────────────────────────┐
│  Step 3: 场景+帧设计         │
│  scripts/scene-design.py    │
│  → 场景类型、运镜、首尾帧prompt │
└────────────┬───────────────┘
             │
             ▼
┌────────────────────────────┐
│  Step 4: 帧图像生成          │
│  qingyun gpt-image-1 API    │
│  → 每场景 first+last frame  │
└────────────┬───────────────┘
             │
             ▼
┌────────────────────────────┐
│  Step 5: 视频片段生成        │
│  kling-2 / veo-3.1 / etc    │
│  → 首帧→尾帧 5s 视频片段    │
└────────────┬───────────────┘
             │
             ▼
┌────────────────────────────┐
│  Step 6: 最终合成            │
│  FFmpeg merge               │
│  → 音轨对齐+转场+字幕       │
└────────────────────────────┘
```

## 输入

| 参数 | 必填 | 说明 |
|------|------|------|
| `audio_file` | ✅ | 音频文件路径 (.mp3/.wav/.m4a) |
| `lyrics` | ✅ | 歌词文本 |
| `character_card` | ✅ | 角色卡 JSON(外貌、声音、风格) |
| `style` | ❌ | cinematic / realistic / anime / ethereal |
| `num_scenes` | ❌ | 分镜数(默认 9) |
| `output_dir` | ❌ | 输出目录(默认: `MediaClaw/output/<project>/`) |

## 输出目录结构

```
output/<project-name>/
├── README.md              ← 项目概要 + 时间轴
├── frames/                ← 首尾帧图像
│   ├── 01_first.png
│   ├── 01_last.png
│   └── ...
├── audio/                 ← 音频文件(多版本)
│   └── song_v1.mp3
├── script/                ← MV 剧本
│   ├── mv_final.json      ← 精准时间轴 JSON
│   ├── mv_final.md        ← 人类可读剧本
│   └── character.json     ← 角色卡
├── docs/                  ← 文档和参考素材
│   └── avatar.png
└── video/                 ← 生成的视频片段(Step 5 产出)
    ├── scene_01.mp4
    └── ...
```

## 经验总结(来自 Chloe《樱花落尽时》项目)

### 图像生成最佳实践
| 项目 | 推荐 | 备注 |
|------|------|------|
| 模型 | qingyun `gpt-image-1` | 成功率最高 |
| API | `/v1/images/generations` | 比 edits 更稳定 |
| 尺寸 | `1024x1536`(竖版) | 必须用规定尺寸 |
| 并发 | 2-3 并发 | 过多会 SSL EOF |
| 重试 | 失败单独重试 | 不整批重跑 |

### 角色一致性技巧
- **统一 prompt prefix**: 包含角色核心外貌特征
- **参考图**: 用 edits API 传入角色头像(但成功率低)
- **场景限定词**: 每帧 prompt 固定前缀 + 场景变量

### 音频同步
- 用 `mutagen` 读 MP3 时长(无需 ffprobe)
- 场景时间按歌曲结构比例分配
- BPM 检测需 `librosa`(可选)

### 视频模型选择
| 情绪 | 模型 | 场景类型 |
|------|------|---------|
| ≤ 6.0 | kling-1.6 | 静态/自然/国风 |
| 6.0-8.0 | kling-1.6 或 kling-2 | 过渡 |
| ≥ 8.0 | kling-2 | 爆发/力量 |
| 360°旋转 | veo-3.1 | 特殊运镜 |

## 依赖
- Python: mutagen, requests
- 外部 API: qingyun (图像), xingjiabi (视频), Google (veo-3.1)
- 可选: librosa (BPM), ffmpeg (合成)

## 参考
- [audio-analyzer.py](scripts/audio-analyzer.py) — 音频分析
- [Chloe 项目完整输出](../../output/chloe-sakura-mv/)
- [virtual-singer-mv-script](~/clawd/skills/virtual-singer-mv-script/) — 独立 MV 剧本 skill

More from aAAaqwq/AGI-Super-Team

SkillDescription
a-fund-monitor监控 A 股基金实时估值与盘后净值,自动判断交易日并生成提醒或分析。
add-leadAdd company/person/relationship to CRM
ads-agentAI-агент для управления Facebook рекламой. Вызывай для анализа, оптимизации, создания кампаний и отчётов.
afrexai-compliance-auditRun internal compliance audits against major governance and security
afrexai-personal-financeComplete personal finance system — budgeting, debt payoff, investing, tax optimization, net worth tracking, and financial independence planning. Use when managing money, building wealth, paying off debt, planning retirement, or optimizing taxes. Zero dependencies.
after-salesUse when managing post-purchase experience, building customer loyalty, or increasing repeat purchases
agent-contactsAI agent contacts — add, list, remove MCP contacts. Use when someone gives an agent URL, or when you need to view/remove contacts.
agent-model-switcher批量查看和切换子 agent 的模型配置,用于统一调整多 agent 的 provider/model 设置。
agent-patternsFormat SPAWN REQUEST messages to launch parallel agents, generate structured agent status reports, and define communication protocols within the sprint system. Use when the user needs to coordinate multiple agents, format spawn requests, produce agent reports, or establish inter-agent communication patterns.
agent-task-confirmUse when confirming whether a dispatched agent task was actually received, activated, and progressing after sessions_send or other task handoff actions.