Communitygithub.com

song-mv-storyboard

Pipeline for producing song MV (pixel art / 2D animation): understand the song → calibrate lyrics timeline → full storyboard overview → user review → short test → animation → quadruple sync verification. Use when the user provides a song and requests an MV, storyboard, or animated lyric video.

What is song-mv-storyboard?

This skill implements a structured, multi-stage pipeline for creating music video storyboards and animations (pixel art or 2D animation) from a user-provided song and optional reference video. It enforces a **storyboard-first, animate-later** principle, with mandatory user approvals at critical checkpoints. The pipeline covers: audio extraction and song understanding (Stage 0–1), lyrics timeline calibration using scroll-captured recordings or LRC files (Stage 1), full-song storyboard generation with quadruple sync checking (time, semantics, music, emotion) (Stage 2), short animation test (Stage 3), full animation render (Stage 4), and automated plus manual verification (Stage 5). It is designed to work within tight resource constraints (8GB RAM) and actively prevents common pitfalls like timeline drift and design creep. The skill outputs standard project files (song brief Markdown, JSON storyboard, timeline, overview images) and a final MP4 video. It is intended for use with coding AI agents (e.g., Claude Code, Cursor, Codex) that can execute Python scripts, run ffmpeg commands, read/write project files, and display generated images for user review. The skill emphasizes **minimal execution** (read only what is needed, skip re-analysis of confirmed data), **dependency handling** (report missing files/scripts upfront), and **storyboard protection** (never modify approved shots without justification and re-verification). Real-world lessons from a past MV production (2026-10) are embedded, especially regarding timeline calibration and verifying recording alignment against the final audio track.

Works with✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/3617791313-prog/ai-music-mv-storyboard-skill/tree/HEAD

Ask in your favorite AI

Open a new chat with this agent skill pre-loaded.

Documentation

What does song-mv-storyboard do?

Principle: Storyboard first, animate later; change where there is reason, pause where there is emotion. At the end of each stage, update the status block at the beginning of project/STATUS.md (template: templates/STATUS_template.md under this Skill directory; fields: Current Stage / Created / Run / Verified / Pending Human Review / Blockers / Next Step). Only write content that has actually been executed; created does not equal run, run does not equal verified.

Execution Rules (Apply Through All Stages)

  • Minimal Execution: Only read the files needed for the current stage; do not read through the entire project. For already confirmed song analysis, lyrics timeline, character settings, and approved storyboard, rely on project files; do not re-analyze. Report only four items: changes made, actual run and verification results, unresolved issues, and decisions required from the user. Saving tokens must not skip review gates or verification.
  • Dependency & Failure Handling: A file existing does not mean the functionality is implemented. If a script is missing, first judge whether it can be safely filled in; after filling, run at least one minimal test. Mark unimplementable functions as "unverified". If the timeline is unreliable or critical assets are missing, pause the affected stage; do not substitute calibration with guessing.
  • Storyboard Protection: By default, do not modify approved shots. If a change is necessary, first explain which shots and time ranges are affected, change only the problematic shots, and then run the corresponding minimal tests (single frame, --compare, or specific item tests). If the user asks to keep something unchanged, prove it using file comparison, timeline comparison, or image comparison; if comparison is not possible, state that honestly.
  • Memory & Rendering (Target Environment 8GB RAM): Do not load all frames of the entire MV into memory at once; render frame by frame or in small batches, passing directly to ffmpeg for encoding. When analyzing video, process in segments and reduce resolution; keep caching controllable. Generate low-resolution previews first; only render the final version after short-shot tests pass.

Stage 0: Inventory (Read-Only, Do Not Generate)

  1. List all inputs: audio/screen recording, lyrics, reference video, character settings, existing code (src/, scripts/), STATUS.md. Read STATUS first; do not redo confirmed items.
  2. Dependency Check: Verify the following files exist, one by one:
    • Under this Skill's templates/ directory: storyboard_template.json, lyrics_timeline_template.json, song_brief_template.md, STATUS_template.md;
    • In project: scripts/storyboard_sheet.py, scripts/check_recording_alignment.py (copied from this Skill's scripts/);
    • src/render.py (must provide frame(t), whose first return value is the PIL image at that moment). List missing items one by one. Scripts or templates that can be copied from this Skill directory or a previous project should be copied to the new path; do not overwrite existing files. If something cannot be supplemented, explain which stage it affects.
  3. If the reference video is split into multiple segments, wait until all are available before analyzing; if a file cannot be read, state the exact file name; do not pretend to have analyzed it.
  4. First test the current environment: whether commands can be run on the user's computer, which directories (including .claude/) can be written to, and the maximum single file size that can be uploaded. Do not assume limits. When a large file cannot be transferred, ask the user to export at 480p or only the necessary parts; only when .claude/ truly cannot be written to, fall back to saving cards or manual installation.

Stage 1: Understand the Song (Output: Song Brief + Calibrated Lyrics Timeline)

  1. Audio: ffmpeg -i <screen_recording> -vn -acodec pcm_s16le input/song/processed/song.wav. Record the duration, initial silence, and whether the beginning or end is missing; do not change the original song's speed, pitch, order, or length.
  2. If the screen recording contains a player progress bar, infer the relationship between screen recording time and song time using "frames where the progress seconds jump", not by visually estimating a single frame.
  3. Source priority for the lyrics timeline (project/lyrics_timeline.json): LRC → screen recording with scrolling lyrics → estimation. Beat/spectrum estimation can only be used as placeholder; it must be marked as needs_review and cannot serve as the final version.
    • When using a screen recording with scrolling lyrics: first run python scripts/check_recording_alignment.py <song.wav> <screen_recording>. It takes a window every 30 seconds throughout the song, calculates the offset and correlation between the recording and the final audio track, and lists silent segments in the recording's audio.
      • Only if the conclusion is SAME_AUDIO_CONSTANT_OFFSET (consistent offset everywhere, high correlation, no drift) can this offset be used;
      • If the conclusion is NEEDS_REVIEW (different audio source, or there is cutting, speed change, pause, interruption), mark the timeline as needs_review, pause formal storyboarding, explain the reason to the user and request another material.
      • After the offset is usable, use per-frame difference detection to find each frame where the lyrics start scrolling, using that as the start time for each line; then stitch together screenshots of the highlighted line at each line change, and verify the text and order line by line (each song has different offsets and line-change timings; record them separately for the current project — do not reuse values from other projects).
      • Write the check conclusion into meta.alignment_check of the timeline. Only lines that have been scrutinized line by line can be marked as calibrated.
    • Always use the original text provided by the user for subtitle text; do not modify words, add words, or delete repeated lines.
  4. Write the song brief (template song_brief_template.md). Content includes: core emotion, story in one sentence, character relationship changes, segment mood divided by actual time, and what each imagery represents. Distinguish between verifiable facts and creative interpretation; do not just grab nouns from the lyrics, and do not apply generic love song tropes to all love songs. → Stop: Report the brief and timeline reliability to the user. If the timeline is unreliable, ask the user to provide an LRC or screen recording with scrolling lyrics; do not guess further.

Stage 2: Full Song Storyboard (Output: storyboard.json + Storyboard Overview Image + Comparison Table)

  1. Base shot cuts on the calibrated timeline (cut points at lyric starts or measure lines). Reference rhythm: 4–12 seconds per shot; the same space can accommodate multiple consecutive lines; each cut must have a narrative or emotional reason. Fields are defined in storyboard_template.json (includes start/end of lyric, music, action, meaning, transition, status).
  2. For each shot, first write a static composition function that only outputs keyframes (reusing existing scenes and characters); do not animate.
  3. Run python scripts/storyboard_sheet.py to generate previews/storyboard/overview.png (small thumbnails of the whole song) and page_XX.png (8 frames per page, readable). Each frame includes: shot number, start/end time, lyrics sung during this segment, scene/action, emotion; keyframes automatically avoid dissolve transitions.
  4. Output a line-by-line comparison table: | Lyrics | Time | Meaning/Emotion | Visual | Correspondence | Action |. Check four types of synchronization separately:
    • Time sync: subtitles align with singing.
    • Semantic sync: the audience can understand the meaning at that line (character introduction, imagery landing on the correct line — can be foreshadowed early).
    • Music sync: actions and cuts coordinate with beats, phrases, and instrumental breaks.
    • Emotional sync: the overall emotional progression matches the song.
  5. If images cannot be generated, hand over the timeline and shot list, and clearly state "storyboard images have not been generated yet"; do not use text descriptions to pretend to be images. → Stop: Wait for the user to review the storyboard. When making modifications, only change problematic shots; mark approved shots as status: approved. After approval, run python scripts/storyboard_sheet.py --out previews/storyboard/approved to freeze keyframes, which will serve as the execution basis for subsequent animation.

Storyboard Is the Execution Basis (Applies to Stages 3 and 4)

  • Before starting work, read storyboard.json and the frozen keyframes under previews/storyboard/approved/; animation only adds motions and camera movements on top of the approved compositions, characters, and scenes.
  • After animation is done, run python scripts/storyboard_sheet.py --compare previews/storyboard/approved to generate side-by-side "Approved | Current" images for each shot, verifying character positions, composition, scene, action, camera movement, and transitions. Pixel differences are only hints; they cannot replace human judgment.
  • If there is a deviation, fix only that shot. When the current tool cannot achieve a specific storyboard requirement, explain the limitation first and provide an alternative solution; wait for the user to agree; do not quietly change the design.

Stage 3: Animation Test (Output: ~20-second test clip by default)

  1. By default, produce about 20 seconds; adjust to a user-specified length or after review confirms a longer test is needed. The test clip must correspond to the approved storyboard; do not change the confirmed direction.
  2. Add motions according to the approved storyboard: each motion must have a start, progression, and end; pay attention to center of gravity, eye line, and turns; no teleportation or sudden posture changes; for interactive actions (holding an umbrella, holding hands), the hands, umbrella handle, and character positions must be geometrically reasonable. When sharing one umbrella, the canopy must cover both people.
  3. Do not force prop interactions just to "make the scene move"; dynamic feeling should preferentially come from rain, light, reflections, slow camera movements, and small motions.
  4. Use only the same set of character models (same definition, natively rendered according to shot distance); do not redesign for wide shots and close-ups. → Stop: Wait for the user to confirm the test clip.

Stage 4: Full Song (Output: output/mv_full.mp4)

  1. Reuse approved shots as-is; only supplement the remaining shots (which must first have their storyboard approved and keyframes frozen); fix only the problematic shot, prioritizing timing adjustments, duration, and motion, without completely redoing it.
  2. Use a single process to pass frames to ffmpeg for encoding one by one (8GB RAM available); first produce a low-bitrate preview, then the final version.

Stage 5: Verification (Items that have failed or were not checked must NOT be reported as "complete")

Automated Verification (written into tests/, actually run):

  • The output file exists, can be decoded and played back, and has been written back to the user's project folder; video duration equals audio track duration; cross-correlation between the output audio track and song.wav yields zero offset, with no breaks in between;
  • The frames where subtitles appear are frame-accurate with the timeline; if necessary, compare side-by-side with the screen recording of scrolling lyrics;
  • Shot duration statistics; per-frame difference scan (to detect unintended hard cuts or teleportation); consistent rendering results for the same point in time; pixel grid clarity.
  • Simple visual conditions (e.g., "there are purple pixels in the frame at the beginning of a certain line" or "raindrop count is 0") can be written as tests, but they only prove that a certain color or element appears, not that the picture expresses the meaning of the lyrics.

Manual Review (or using a tool with visual capabilities to inspect each image):

  • Whether the picture truly expresses the meaning of the lyrics; whether character relationships and emotions match the song;
  • Whether interactions like umbrella holding or hand holding appear natural; whether characters, compositions, and transitions faithfully adhere to the approved storyboard (check using the --compare side-by-side images);
  • A contact sheet at 5-second intervals, and every modified shot.
  • For any item that has not been reviewed by a person or that the tool cannot judge, mark it as "pending manual check"; do not mark it as "passed".

Cost Control

  • First output single frames and storyboard images (seconds-level), then the test clip, and only finally render the full song; do not re-analyze already confirmed materials.
  • When problems arise, first reproduce them using single frames or very short segments; then fix the code; do not repeatedly re-render the entire clip for trial and error.
  • When the user says "don't change X", lock X with a test (e.g., compare the timeline before and after the change, compare image regions) to prove that it indeed has not changed.

Lessons from an Actual MV Production (2026-10)

  1. Correct subtitle timing ≠ correct visual semantics; correct visual content ≠ correct timing of appearance.
  2. Early beat-based timeline estimates were overall late and became increasingly wrong (chorus offset ~27 seconds); designing visuals based on the wrong timing, then calibrating subtitles, caused misalignment across the whole clip. Therefore, calibrate first, then storyboard.
  3. The time in the reference screen recording ≠ the time in the final audio track; you must use check_recording_alignment.py to verify the offset is stable at multiple points throughout the song before converting.
  4. Shots that are too fragmented and spaces that are too varied look like a collage of assets; a single background that loops too much looks like a static image. The right rhythm is a few long shots with continuous action in the same space.
  5. After the storyboard is confirmed, preserve its composition, characters, scene, and actions during the animation stage.

Related Skills