From agi-super-team
Matches MP3 lyrics segments to video clips with time-axis alignment, emotion mapping, subtitle burning, and audio mixing. Useful for AI MV makers syncing lyrics to visuals.
How this skill is triggered — by the user, by Claude, or both
Slash command
/agi-super-team:lyrics-video-syncThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
AI MV 制作中,音频和视频经常脱节:
AI MV 制作中,音频和视频经常脱节:
音频文件(MP3) → 歌词提取/对齐 → 场景时间轴匹配 → 音频分段 → 视频混合 → 字幕烧录
支持格式:
[00:15.00]樱花飘落的季节{lines: [{text, start_s, end_s}]}# 使用 Whisper 识别歌词(带时间戳)
python3 scripts/extract_lyrics_whisper.py \
--audio input.mp3 \
--output lyrics.json \
--language ja \
--model large
python3 scripts/manual_lyrics_editor.py \
--audio input.mp3 \
--output lyrics.json
输出统一格式 (lyrics.json):
{
"bpm": 90,
"duration": 236.8,
"lines": [
{
"index": 0,
"text": "桜が散る季節に",
"text_cn": "樱花飘落的季节",
"start_s": 24.0,
"end_s": 28.5,
"section": "verse1",
"emotion": "gentle",
"energy": 0.4
}
],
"sections": [
{
"type": "intro",
"start_s": 0,
"end_s": 24,
"energy": 0.3,
"emotion": "peaceful"
},
{
"type": "chorus",
"start_s": 94.7,
"end_s": 122.3,
"energy": 0.8,
"emotion": "passionate"
}
]
}
| 歌词特征 | 推荐画面 |
|---|---|
| 自然意象(花/雨/风/月) | 对应自然景观 |
| 情感词(想/哭/笑) | 角色表情特写 |
| 动作词(走/跑/飞) | 对应角色动作 |
| 抽象词(梦/希望/自由) | 抽象/梦幻画面 |
| 重复/叠句 | 重复构图但不同角度 |
python3 scripts/map_lyrics_to_scenes.py \
--lyrics lyrics.json \
--scenes scenes.json \
--output edit_plan.json \
--strategy emotion_energy
映射策略:
每个视频 clip 对应一段音频,精确裁剪:
python3 scripts/segment_audio.py \
--audio input.mp3 \
--edit-plan edit_plan.json \
--output-dir segments/ \
--fade-in 0.3 \
--fade-out 0.5
# 单个 clip + 对应音频段
ffmpeg -y -hide_banner \
-i clip.mp4 \
-i segment_01.m4a \
-c:v libx264 -crf 18 \
-c:a aac -b:a 192k \
-shortest \
clip_with_audio.mp4
# 多 clip 合并 + 全曲音频
ffmpeg -y -hide_banner \
-f concat -safe 0 -i clips.txt \
-i full_audio.mp3 \
-c:v libx264 -crf 18 \
-c:a aac -b:a 192k \
-shortest \
final_mv.mp4
# 对话/人声场景降低音乐音量
ffmpeg -i video.mp4 -i audio.mp3 \
-filter_complex "[1:a]volume=0.3[a]" \
-map 0:v -map "[a]" output.mp4
python3 scripts/lyrics_to_srt.py \
--lyrics lyrics.json \
--output subtitles.srt \
--style dual \
--font "Noto Sans CJK JP"
字幕样式选项:
ffmpeg -y -hide_banner \
-i final_mv.mp4 \
-vf "subtitles=subtitles.srt:force_style='FontSize=18,PrimaryColour=&H00FFFFFF,OutlineColour=&H00000000,Outline=2,Alignment=2'" \
-c:a copy \
final_mv_subtitled.mp4
支持更丰富的样式:
python3 scripts/lyrics_to_ass.py \
--lyrics lyrics.json \
--output subtitles.ass \
--template karaoke_glow
# 从音频到带字幕的MV
export PATH="$HOME/tools:$PATH"
# 1. 提取歌词
python3 scripts/extract_lyrics_whisper.py \
--audio sakura_mv.mp3 -o lyrics.json
# 2. 映射到场景
python3 scripts/map_lyrics_to_scenes.py \
--lyrics lyrics.json \
--scenes video_plan.json \
-o edit_plan.json
# 3. 分段音频
python3 scripts/segment_audio.py \
--audio sakura_mv.mp3 \
--edit-plan edit_plan.json \
-o segments/
# 4. 逐clip混合音频
for clip in clips/*.mp4; do
name=$(basename "$clip" .mp4)
seg="segments/${name}.m4a"
[ -f "$seg" ] && ffmpeg -y -i "$clip" -i "$seg" \
-c:v copy -c:a aac -shortest "mixed/${name}.mp4"
done
# 5. 合并全部 + 烧录字幕
ffmpeg -f concat -safe 0 -i mixed.txt -i sakura_mv.mp3 \
-vf "subtitles=subs.srt" -c:a aac -shortest final.mp4
lyrics-video-sync (歌词匹配)
← cinematic-video-gen (prompt增强,确保画面匹配歌词意境)
← qingyun-api (实际视频生成)
← av-sync-workflow (节拍级精度的音视频同步)
→ ffmpeg-video-editor (最终合成)
av-sync-workflow 的 beat syncscripts/
├── extract_lyrics_whisper.py # Whisper歌词提取
├── map_lyrics_to_scenes.py # 歌词→场景映射
├── segment_audio.py # 音频精准分段
├── lyrics_to_srt.py # 歌词→SRT字幕
├── lyrics_to_ass.py # 歌词→ASS高级字幕
├── manual_lyrics_editor.py # 手动标注工具
└── verify_sync.py # 同步验证
创建日期: 2026-04-10 创建人: 小a (CEO) — 基于《樱花落尽时》MV制作需求
npx claudepluginhub aaaaqwq/agi-super-team --plugin agi-super-teamGenerates SRT/ASS subtitle files from lyrics text with time synchronization, and burns subtitles into video using FFmpeg.
Generate viral-ready karaoke / lyric-video subtitles with per-word highlighting in one command. Adaptive font size from media resolution. Ready-made style presets for TikTok, Reels, Shorts, 抖音, 小红书, YouTube, and cinematic long-form. Trigger on "karaoke 字幕", "卡拉OK", "lyric video", "逐词歌词", "按字高亮", "TikTok 字幕", "抖音字幕", "Reels caption", "Shorts caption", "小红书歌词", "viral subtitles", "爆款字幕", or when a song / podcast / video clip is given and per-word highlighted captions are asked for. For general caption format conversion without karaoke styling, use /lai-caption.
Turns a music track into a beat-synced video (lyric video, slideshow, or kinetic promo) using HyperFrames. Music drives all pacing; zero assets needed for a complete video.