/music-video-generator:music-videofrom Music Video Generator
Turns a song into a finished music video: beat-locked edit with AI performer clips, archive footage, GPU shader compositing, and named styles like slopcore. Also produces visualizers, lyric videos, and social cuts.
Ships in Music Video Generator. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
This skill turns a song into a finished music video: a beat-locked edit of AI-generated performer clips and/or archive and library footage, finished in a GPU compositor (moderngl), rendered with the original audio at 1920x1080 by default (any size, including 1080x1920). The picture is the graded footage, full frame; each video's identity comes from what is drawn on top of it (signature overlays, type, title), designed for the song inside the user's brief. A history file keeps later videos from repeating earlier ones.
Paths. $SKILL below means this skill's base directory, which Claude Code shows when the skill
loads. Per-user data lives in ~/.claude/music-video/: history.md (created from
$SKILL/assets/history_template.md on first use), refs/ (frame sheets of accepted videos) and
local.md.
Standing preferences. If ~/.claude/music-video/local.md exists, read it before Phase 0: it holds
this user's own tools and standing preferences as plain Markdown, one per line, and it wins over the
defaults here. When the user states a preference meant to last (their provider and model, a resolution
they always want, their credit line, something they never want to see again), add a line to it and say
that you did. One-off choices for a single video go in the project's notes, not here.
The engine. The pipeline scripts are not part of the plugin. They live in the engine/ folder of
the skill's public repository, github.com/TheMarco/claude-music-video, pinned to one commit, and the
user installs them once per engine version into ~/.claude/music-video/engine/<commit>/, following
"Install the engine" in that repository's README. $ENGINE below means that folder:
SKILL="<base directory>"
ENGINE_REV=eb54b0f4a219a4eb763bda804367d085b7626c8c
ENGINE="$HOME/.claude/music-video/engine/$ENGINE_REV"
Shell variables don't carry over from one command to the next. Start every command that uses $SKILL,
$ENGINE or $ENGINE_REV with these three lines.
Check for the engine before anything else: test -f "$ENGINE/template/mv/scripts/render.py". When
it is missing, stop. Tell the user this skill needs engine version eb54b0f, give them
https://github.com/TheMarco/claude-music-video#install-the-engine, and wait for them to say it is
installed. They run those steps themselves: don't download or install the engine for them, and don't
fall back to an older engine folder that happens to be there. Then check again and go on. The template in it ($ENGINE/template/mv/scripts/) is a working pipeline. Copy it
into each new project. Three files belong to the video and get written for it: edl.py (the cut),
look.py (palettes, grades, the finish) and fx.py (its overlays and shaders). The rest is the engine.
<project>/
song.mp3, reference photos from the user
.venv/ Python venv (see setup)
mv/NOTES.md the brief in the user's words, decisions, job ids, where the work stands
mv/scripts/ copied template; edl.py, look.py, fx.py written per video;
ENGINE_REV, the engine commit the copy came from
mv/data/ song.json, lyrics.json, audio_feats.npz, codes.json, crops.json, edl.json, budget.json
mv/clips/ <CODE>.mp4 AI clips (+ _matte, _depth.mp4) mv/keyframes/ generated stills
mv/archive/<identifier>/ archive films mv/work/ segments, stills, sheets
mv/review/ copies for the user to check mv/out/ renders
Every request uses the same pipeline; the request type decides which phases matter.
| Request | Footage | What to lean on |
|---|---|---|
| Music video with performers | AI clips + archive | The whole flow below; "Choosing the mix" |
| Archive-only, or no budget | archive.org, the user's own footage | "Archive-only videos"; references/compositor.md |
| Visualizer | procedural backgrounds, artist photos, a few archive textures | An audio-reactive picture built in fx.py from the spectrum, waveform and drum envelopes; no AI needed |
| Lyric video | any backgrounds | Confirmed lyrics; line and word timings from ov.lyric_at(t); a type treatment designed for the song |
| Performance / lipsync | AI lipsync clips | references/video-providers.md "Lipsync": one take per sung line, shown only where it was recorded; sync_offset.py --save, mouth_check.py, mv/data/mouths.json |
| Photo or album-art video | stills in codes.json | Slow zoom and pan per shot; grades; overlays between photos |
| Vertical or square cut, teaser | an existing edit | render.py --size 1080x1920 (matted shots reframe on the person); --start/--end for a 15-30 s hook (see Phase 6) |
| The user's own footage | local files in codes.json | Same as archive; check framing with contact sheets |
| Slopcore, or another named style | AI performer, lip sync on every sung line | "Named styles" below: the style's file is the specification |
| Remake of an existing music video | the original video plus new footage | The original's soundtrack is the song and its timing is final: singer shots at their own song times (sync=0), the original audio stream kept (Phase 6, "Lip sync"); anything the user excludes (a person, a logo) checked on every shot's full visible span (Phase 5) |
| Changes to an existing project | whatever it has | Read mv/NOTES.md first (or whatever notes an older project has); see "Updating a project's engine" if its scripts are older than the template |
A named style is a genre written down as a specification, so the user doesn't have to send reference
videos for it. The skill's styles are in $SKILL/references/styles/; styles of the user's own, in the
same shape, in ~/.claude/music-video/styles/.
| Style | File | The user asks for |
|---|---|---|
| Slopcore: the AI-made pop video that knows it is AI-made; lip sync on every sung line, big words on the sung words, an interface gag per line, fine print at the edges | references/styles/slopcore.md | "slopcore", or a video like Astra Blue's "I'm A.S.I." or "P DOOM", or anabology's "The Clodyssey" |
When the user names a style, read its file before Phase 0 and apply all of it. It sets the Phase 0
defaults, names the skill defaults it turns off (for slopcore, "text is sparse" and part of the habits
list in Phase 3), and gives the density the stills are checked against. Write in mv/NOTES.md that the
video uses the style. The identity rules still hold: a style fixes the genre, never an earlier video's
type, palette, gags or signature.
These matter more than any technique below.
mv/NOTES.md as it grows, in
the user's own words.mv/NOTES.md current. The brief, the chosen concept, decisions the user made, generation
job ids, and the phase the work is in. A project outlasts a session and a context window; these notes
are what the next one starts from, so read them first when returning to a project.mv/review/ and give the path. For a real
person, render one test clip and wait for approval before the batch.facecheck.py passes before a render is shown (Phase 6,
"Faces stay clear").contrastcheck.py measures it and passes
before a render is shown (Phase 6, "Contrast").sync=0) with the original
audio: no lip-sync measurement, no offsets. If the user reports it out of sync, check that the shots
sit at their original times and ask whether the original plays in sync for them; build nothing.Ask these in one plain message, each with your default, so the user can answer only what they care about. For a named style, the defaults in its file replace the ones here; say which style they come from.
Talk this through with the user; it drives the budget and the look.
| Mix | When it fits | Cost |
|---|---|---|
| Archive only (0% AI) | Era, place or history themes; abstract or visualizer videos; no budget; no likeness risk. Performers come from archive (soundies, dance films, crowds) and the compositor does the rest. | Free |
| Light AI (10-30%) | Hero shots of the artist for the intro, drops and ending; archive carries the rest. | Low |
| Balanced (40-50%) | Performers carry the drops and choruses, archive carries verses and breakdowns. | Medium |
| AI-heavy (70-100%) | Story videos, lipsync, a performer on screen most of the time. | Scales with runtime |
Planning numbers: a 10 s clip usually gives 3 to 5 usable cuts, so render about 1.5 times the AI screen time you need. The EDL builder prints the actual archive/AI split; check it against what was agreed.
Without AI clips, the edit and the compositor carry the variety: speed and time (motion-blended slow
motion, reverse, freeze, stutter), double exposures on the OVER track, person mattes on archive shots
(matte=True) so overlays can sit behind people, grades that unify decades of film stock, and the
concept's overlays in fx.py. references/compositor.md lists the per-shot options.
python3 mv/scripts/budget.py set N --unit credits.budget.py plan LABEL AMOUNT; after it budget.py add LABEL AMOUNT, failed and
rejected takes included. Run budget.py to see spent and left, and stop to ask before exceeding.Needs Python 3.10-3.13, ffmpeg on the PATH, and a GPU with OpenGL 3.3 (any Mac from the last decade, or a Linux or Windows machine with current drivers).
python3 -c 'import sys; assert (3, 10) <= sys.version_info[:2] <= (3, 13), sys.version'
mkdir -p mv && cp -R "$ENGINE/template/mv/scripts" mv/ && echo "$ENGINE_REV" > mv/scripts/ENGINE_REV
mkdir -p mv/data mv/clips mv/keyframes mv/archive mv/review mv/work mv/out
python3 -m venv .venv
.venv/bin/pip install -q -r "$ENGINE/template/requirements.txt"
.venv/bin/python -c "import moderngl; print(moderngl.create_standalone_context().info['GL_RENDERER'])"
If the first line fails, build the venv with a Python in that range (python3.12 -m venv .venv). On
Windows the venv's Python is .venv\Scripts\python. Lyrics transcription uses mlx-whisper on Apple
Silicon (installed by the requirements); elsewhere pip install openai-whisper. models.py downloads
the Whisper, person-matte and depth models on first use with plain anonymous requests and pinned
checksums; keep model downloads in models.py rather than the libraries' own downloaders. Fonts are
picked per video in fx.py: fonts.py fetches openly licensed display and mono faces (the same on
every system), F and FS in overlay.py point at the macOS system font folders, and any .ttf or
.otf path works (references/compositor.md, "Fonts"). Run every script from the project root.
A project's mv/scripts/ENGINE_REV names the engine commit its scripts came from; a project without
that file is older than any engine that writes it. When it differs from $ENGINE_REV, copy
mv/scripts/ to mv/scripts_old/, then copy the template's engine files over everything except the
project's own edl.py, look.py and fx.py, write the new ENGINE_REV, and install the template's
requirements again. The part of edl.py below its EDIT block is engine too: carry the template's
changes there into the project's copy, keeping any project additions, and re-run edl.py. A project from engine
1.1.0 or earlier also needs the four-line fx.py change in references/compositor.md ("The picture
never trails the sound"), or its beat-timed accents land a frame after the cuts. A project from before
engine fbd5bf8 gets heads.py, facecheck.py and contrastcheck.py with the update, but its fx.py
still places and draws blocks its own way: run all three, move any block facecheck.py lists onto
ov.place, and outline the type contrastcheck.py lists. Render stills at 4-6
moments with both and compare before changing anything else. A project from before engine ade7169 gains
devices.py and make_depth.py and needs no change to keep rendering as before; one that patched
render.py and media.py for vertical footage sets SEG_SIZE in its look.py instead. A project
from before engine 56021ac gains screen.py and renders as before; one that baked a screen into copies of
a clip can drop those copies and use screen= in edl.py with SCREENS in fx.py. A project from
before engine eb54b0f gains fonts.py, readcheck.py and particles.py, and its device panels now start rising 0.2 s
before their time so they have settled on the word: check stills where a panel sits close to a cut.
.venv/bin/python mv/scripts/analyze_song.py song.mp3 --title "Title" --artist "Artist" --lyrics [--language es]
--language is the language the song is sung in (a Whisper code; en when left out).
This writes a draft mv/data/song.json: BPM, beat-0 offset t0, sections (name, start, end, kick,
calm), drops, shocks, countdowns, suggested letterbox spans, end-card time. AI-generated songs often
drift by several BPM over their length; the analyzer then writes a beats map that follows the drift,
and every script uses it automatically (beat(k) and beat_at(t) in timing.py). A "WEAK BEAT"
warning (ballads, rubato) means cutting on phrases, lyrics and energy changes instead of strict beats.
Treat it as a draft:
lyrics.json marks likely ones with suspect. Ask the
user for the real lyrics if anything matters on screen.--bpm; if a fast song
still comes out halved, --bpm with the doubled value. The click track below settles it.lip_check.py prints word timings for the 8 s around any song time.Check the grid before anything is cut to it. .venv/bin/python mv/scripts/gridcheck.py prints,
per section, how the song's kicks sit on the grid, with a hint when the first beat looks half a beat
off, the tempo half or double, or a section drifting; and it writes mv/review/grid_check.wav, the
song with a click on every beat and a higher one on every bar line. Follow up each hint (correct bpm,
t0 or the sections in song.json and run it again), then give the user the file along with the
section list to confirm by ear: a wrong grid spoils every cut after it.
Word times for lip sync and word-timed type come from the separated vocal. On the full mix Whisper's word times can be a third of a second off; on a clean vocal stem they have been within 0.03 s. When the video has lip-sync takes, words that land on the sung word, or karaoke lines, separate the vocal first and transcribe that:
.venv/bin/pip install -q demucs && .venv/bin/demucs -n htdemucs_ft --two-stems vocals -o mv/stems song.mp3
.venv/bin/python mv/scripts/analyze_song.py song.mp3 --lyrics --vocals mv/stems/htdemucs_ft/song/vocals.wav
.venv/bin/python mv/scripts/align_lyrics.py lyrics.txt # the user's lyric, one sung line per row
Demucs is optional, installs PyTorch and downloads its own model on first run; tell the user before
installing it. align_lyrics.py keeps Whisper's times and puts the real words on them (spoken lines
and ad-libs included, written as they are heard); lines it marks with ~ have estimated word times
and want a listen. Take every line start from this file. Never read line starts off the stem's
loudness: a dip can sit a whole phrase away from the line (a spoken "play it again" before a verse was
taken for the verse's first word, and every slice cut from those times opened inside the previous
line and lost the end of its own).
Then .venv/bin/python mv/scripts/audio_feats.py writes the per-frame spectrum, loudness, kick,
snare, hi-hat and waveform data the overlays can react to.
Design this for every video, after the song analysis and before any footage is generated or collected: the concept's light, colour and era go into the generation prompts and the footage search, and its chapters and grades into the edit. A video has to do two things: feel like this song and this brief, and have an identity no earlier video in the history had. The first is never traded for the second.
Every video keeps the craft:
STARTS entry in look.py that matches the mood: real blacks
for dark songs, grain, glow and halation where the mood is filmic or nocturnal. An empty finish with
a pale grade reads flat.Every video changes the identity: the signature overlays, the title and credit treatment, type, the specific palette, transitions. For a different song, nothing listed under a history entry's identity lines returns unless the user asks.
Brief and song first. Write down the brief's mood and look words, and what the song does at its loudest point (tempo, drops, how the energy feels). Every concept has to pass both.
Read ~/.claude/music-video/history.md (create it from $SKILL/assets/history_template.md if
missing): the identity lines of recent videos and any rejected directions. For a new version of the
same song, keep the brief's look and the edit's energy; replace what the user objected to.
Collect motifs and sparks. 5-10 concrete motifs from the title, lyrics, theme and footage; method
and sparks in references/effects-ideas.md. For more, python3 "$ENGINE/scripts/concept_dice.py"
draws random overlay ideas; use the ones that serve the brief and drop the rest.
Write three concepts, three different identities inside the same brief. For each: one or two
sentences on what a viewer sees and feels at the drop (light, color, what fills the frame, what
moves); the look (palette, finish start, and its colour pattern, below); title and credits; type, or
none, with the face and where it comes from (below); 3-6 signature overlays,
at least half new code, building toward the drop or last chorus; the explaining layer (one graphic
per line from the questions in references/effects-ideas.md, "One explaining graphic per line", most
of them devices from the engine's library, and the one graphic that escalates across the video); the
edit's devices; the story in one line per chapter. Each overlay says how much of the frame it covers
and when: most of the time the footage is what you see.
Sensation over conceit: a concept whose appeal is a clever mapping that needs explaining (the verses
as chess moves, the song as a lecture) is a design idea, not a video idea. Drop it.
The colour pattern. Say for each concept how much of the frame its colour takes: restrained (the
footage's own colour, one accent on a few percent of the frame), committed (one saturated colour
carries a third to half of the picture through the grade), a full palette (three or four colours with
fixed jobs), or drenched (the whole picture lives in one hue). Then write the pattern in three
words: the ground (dark, mid, light), the hue family, and the accent's temperature. The three
concepts differ in at least one of those, and none repeats the last video's pattern. Changing the
hex and keeping the pattern is the same look: "dark ground, one warm accent, cream type" stays that
whether the accent is amber or vermilion.
The face. Choose type from a thing in the song's world, not from its genre: a ticket stub, a
truck door, a cassette inlay, a shop sign, a subtitle on a bootleg tape. "A synth song, so chrome
script" and "a serious song, so a serif" are the associations to break. mv/scripts/fonts.py lists
openly licensed faces by what they come from and fetches the one chosen; fonts.py --sheet sets
the song's own words in all of them, to choose by eye. The nearest system font is the fallback, not
the choice. One family, or a display face and a text face with fixed jobs, never three. Size and
tight tracking carry a big word; bold and big together is the reflex.
Test each concept against the craft list above and the habits below; replace any that fails.
Propose. Send the three in one short message with a recommendation, and ask which one in a plain question. Recommend the one that fits the brief best and hits hardest at the drop, not the most novel or the cleverest. If the user says to choose, that is the one.
Avoid these habits. Sessions reach for them whenever they go for the familiar, and they make different videos look like one family. Each is off unless the user or a named style asks for it:
These are graphics, not finish. Glow, grain, halation, punch, shake and letterbox framing are craft and stay available to every video.
Once the user has chosen, write the concept into mv/NOTES.md: it steers the footage (Phase 4) and the
edit (Phase 5), and it is built in Phase 6. Include a line table: each line's time, its explaining graphic
(the device and the facts it shows) and any depth treatment on its shot, so the footage prompts carry what
the graphics need (the object to label, an empty side for a panel, a wide with depth for a treatment, a
blank dark screen for a display that shows the video's own picture).
In an instrumental the rows are the written script or the sections.
Use whatever video-generation MCP the user has connected; the skill holds no provider keys and works
only through that MCP's tools. references/video-providers.md covers the method for any provider:
finding the tools and reading each model's capabilities (start frame, reference images, durations,
resolutions, audio, price), getting local reference photos to the provider, downloading outputs with
fetch_clip.py, polling and costs. It ends with notes on one provider (Hedra) as an example.
references/video-providers.md, "Method that carries over"). Render one test clip, put it next to
the photo in mv/review/, and wait for the user's verdict.mv/keyframes/), check it, then animate from it as the start frame.references/video-providers.md, "Lipsync").
Cut each take's reference audio with lipsync_slice.py from a line start in lyrics.json and fix
every warning it prints before spending credits; one test take first, the user judges the sync, then
the batch.
Any source with a singing mouth, AI or not, gets the lip-sync check in Phase 6 before delivery.mv/clips/<CODE>.mp4 with short codes (P1-P6 for one performer, Q1-Q6 for another):
python3 -I mv/scripts/fetch_clip.py mv/clips/P1.mp4 URL. Then make mattes: .venv/bin/python mv/scripts/make_matte.py mv/clips/*.mp4 (skip files already
ending in _matte), and depth maps for the clips whose shots get a depth treatment or behind_depth:
.venv/bin/python mv/scripts/make_depth.py mv/clips/W1.mp4 ... (about 7 s per second of footage),
and screen tracks for clips with a blank screen to fill: .venv/bin/python mv/scripts/screen.py W1,
then look at its check sheet (references/compositor.md, "Screens in the shot")..venv/bin/python mv/scripts/conform.py mv/clips/*.mp4. Some generators write 24 fps takes on a
60 fps clock with uneven gaps between frames; read as stated, those clips get frames duplicated or
dropped and the video stutters. conform.py leaves clean clips alone and rewrites the others with
every frame once. Never change a clip's rate with a plain -r or an fps filter.contact.py) next to the outfit and set stills and look at each clip for: the right outfit, every
piece of it (top, shoes, accessories); the face in frame when the take sings; the framing the prompt
asked for; nobody in shot who shouldn't be. Retake what fails now. A wrong top that reaches the
user in a finished cut costs a render and a round of review.mv/NOTES.md when you submit it, so a lost context can pick the jobs up.Any video or image file can be a source: add "CODE": "path/to/file.mp4" (or .jpg, .png) to
mv/data/codes.json. references/archive-org.md covers archive.org and other free sources: search,
rights, downloading, scanning films for usable shots and contact sheets. In short: ia_search.py to find
items, ia_fetch.py to download, list them in mv/data/codes.json as short codes (A1, A2 for one
theme, B1 for another), scan_archive.py to find night-light and flash moments, contact.py to look at
labeled thumbnails and pick in-points. Black bars are cropped automatically; override odd framing in
mv/data/crops.json. Several codes can point at one file with different crops (a 4:3 film cropped high
for close-ups and centered for wides); edl.py counts reuse per file.
Footage where a singer's mouth is on screen (an existing music video, the user's performance footage,
concert film) is placed with sync= like a lipsync take: an existing video cut against its own
soundtrack uses sync=0, which shows every frame at its own time, exactly as the original plays.
Plan the story first, even for a mood piece. Before the EDL, write a chapter table: one row per song section with what happens, the footage pool, the shot sizes and the grade. Show it to the user with the plan. A made-up example for a song about leaving town at night:
| Section | What happens | Footage | Sizes | Grade |
|---|---|---|---|---|
| intro | the town at dusk, lights coming on | B1, B4 | W, W, M | cold |
| verse 1 | the same day again: clocks, queues, traffic | A2, A5 | M, C, W | cold |
| chorus 1 | the road out of town | C1, C3, P1 | W, M, C | cold |
| drop 1 | the night opens up: neon, speed | C2, P2, P3 | W, C, X | warm |
| breakdown | stopped at the edge of the sea | D1, P4 | W, M | warm |
| drop 2 | driving on, the town gone | C4, P5, P6 | W, M, C | warm |
Each chapter uses its own footage, and no section interleaves every source: a video that rotates all
its films shot by shot reads as a montage with no progression. Colour follows the story too: one grade
per chapter, changing at a story turn (STORY_GRADES and AI_STORY_GRADES in edl.py), never from
film to film. Tag shot sizes with size="W" (W, M, C, X), open each chapter wide, and avoid neighbours
of the same size; varied angles and sizes are what make the footage feel shot rather than collected.
Write this video's palettes and grades in look.py first (Phase 6, "Build the concept"): edl.py
stops on a grade name look.py doesn't define. Then write the cut in the EDIT block of
mv/scripts/edl.py as beat-aligned sections of shots (its docstring lists every shot option), and run .venv/bin/python mv/scripts/edl.py. It checks that
sections tile the song, adds the black end-card tail, clamps in-points to each source, checks grade
names against look.py, prints the archive/AI split and a table of cuts, shot length and sources per
song section, and warns about: footage reused (motif=True marks a deliberate repeat), look changes
between consecutive archive shots that aren't at a story turn, an average shot length outside
PACE_BEATS, sections with more than MAX_SOURCES sources, shot-size problems, and singer shots whose
mouth may move off the lyrics. Fix each warning or know why it stands.
Pace comes from the song. A 120-130 BPM dance track wants most shots between half a beat and two beats
in the loud sections, longer in breakdowns, faster into drops: about 150-180 cuts in three and a half
minutes, an average of 2-4 beats per shot. A ballad or a weak beat wants phrases (raise PACE_BEATS).
Few long takes in a fast song read as stuck, and twice the cuts reads as noise. The concept adds devices
on top (match cuts, repetition, freezes, ramps), as chosen in Phase 3. Save the most striking footage
for the moments the song builds to.
A face that is revealed is seen whole before the cut. A tilt up to a face, a turn to camera or a walk into frame holds until the whole face has been on screen for about a beat; move the in-point or the length rather than cutting on half a face. Check the last frames of every such shot. (A tilt from cupped hands up to the face once cut away at the lips; starting the take 1.25 s later gave the face a full second.)
Check every shot before rendering. .venv/bin/python mv/scripts/contact.py mv/work/shots --edl
makes contact sheets of every shot at its midpoint, cropped as rendered, and prints a brightness report.
Look at all of them: title cards, in-points on the wrong side of a cut, shots too dark to read. Shots
flagged bright (mean luma above 0.42 or 90th percentile above 0.85) usually want expo=0.6-0.8.
A shot shows more of its source than its own length: while the next shot dissolves in, it keeps playing
for the length of that dissolve (xd). edl.py warns about shots that run across a cut in their source
over that full span, and about footage reused anywhere (AI clips included). When the user excludes
something from a source (a person, a logo, a scene), check the first and last frame of every shot's full
visible span, dissolve tail included, not only its midpoint: the contact sheet shows midpoints, and
dissolves in old films carry a ghost of the next shot for a second or more.
Build the concept. look.py: the FINISH (from a start), on top of the palettes and grades written
for the edit. fx.py: overlays
(draw_front, draw_behind), particles that live in the shot (PARTICLES, particles.py), the
explaining graphics from the line table through a devices.Plan,
the depth treatments as depth_fx on their shots in edl.py, shaders (GLSL_COMP with the person
matte and DEPTH, GLSL_FINAL) for matte
tricks, light and accents, and per-frame uniforms from the audio and song position (they can also drive
any engine value). The engine draws nothing by itself and stays untouched.
$ENGINE/examples/fx_examples.py shows the mechanics; it is not a kit. references/compositor.md
documents the engine, the per-shot options and the fx.py hooks, and "Keeping faces clear" in it how
every block stays off every face.
.venv/bin/python mv/scripts/contact.py mv/work/shots --edl # every shot + brightness
.venv/bin/python mv/scripts/heads.py # head boxes, every frame (--size 540x960 for 9:16)
.venv/bin/python mv/scripts/render.py mv/work/stills/s --stills 8,30,48,62,110,152,196
.venv/bin/python mv/scripts/sheet.py mv/work/stills/s mv/work/stills/sheet
.venv/bin/python mv/scripts/facecheck.py --size 1920x1080 # every frame's overlay against the heads
.venv/bin/python mv/scripts/contrastcheck.py --size 1920x1080 # every element against its picture
.venv/bin/python mv/scripts/readcheck.py --size 1920x1080 # long enough, large enough, inside the margins
.venv/bin/python mv/scripts/render.py mv/out/<name>_v1.mp4 # full render
.venv/bin/python mv/scripts/beatsheet.py mv/out/<name>_v1.mp4 mv/work/drop1.jpg <drop_time> 32 # one frame per beat
.venv/bin/python mv/scripts/qc.py mv/out/<name>_v1.mp4 --ignore-after <end>
.venv/bin/python mv/scripts/render.py mv/out/<name>_9x16.mp4 --size 1080x1920 # vertical cut
.venv/bin/python mv/scripts/render.py mv/out/<name>_hook.mp4 --size 1080x1920 --start <drop> --end <8 or 16 bars later>
Faces stay clear. Once the edit is cut, heads.py renders it without overlays and tracks every head
on every frame into mv/data/heads.json; run it again after every EDL change. Look at each of its
sheets (mv/review/heads_NN.jpg) and add the heads it missed, back views and small figures above all,
in mv/data/heads_manual.json. fx.py places every block with ov.place over the block's whole time
on screen, so a block moves at a cut or shrinks rather than sit on a face, and facecheck.py at the
output size has to pass (exit 0) before stills or renders go to the user. references/compositor.md,
"Keeping faces clear", has the method and the rules that came out of it.
Contrast. contrastcheck.py at the output size scores every element of the overlay against the
bare picture around it (heads.py's clean frames), frame by frame, and lists anything short of 3:1
(large type), 4.5:1 (small type) or 1.5:1 (a card's edge) for a quarter second or more, with review
sheets in mv/review/contrast_NN.jpg. It has to pass as well. Light type with a dark outline and a
soft shadow reads on any shot; a shadow alone does not hold white type on a white jacket or a bright
sky. references/compositor.md, "Contrast", has the fixes.
Reading. readcheck.py at the output size follows every element of the overlay through the video
and lists type that leaves before it can be read (0.4 s for a word or two, about 1 s for three words,
1.7 s for six), lines under 2% of the frame's short side for half a second or more (unreadable on a
phone; --fine-print for a style that wants fine print), and anything inside the edge margins, which
are deeper at the top and bottom of vertical output where the feed's own buttons sit. Its sheets
(mv/review/read_NN.jpg) show each case at phone size, 360 px wide. It is a report, not a gate: look at
every line of it, fix what is a mistake, and know why the rest stands.
Judge the stills before the full render, at the drops, the loudest chorus, the breakdown, the intro and the end card. The y-flip, palette and exposure mistakes all show up there. Don't approve your own stills because the idea is clever.
~/.claude/music-video/refs/, put the new
stills next to them: as rich and as hard-hitting, clearly a different video. Without any, judge
against the craft list in Phase 3.sheet.py's tone readout. For a dark or moody brief, dark shots need real blacks (black
share 0.25 or more); a pale, printed-looking picture sits around 0.05-0.15 on every shot.mv/archive/<id>/meta.json has the license).A three-and-a-half-minute render takes a few minutes on a recent Apple Silicon Mac; segments are cached
in mv/work/seg/ (delete a clip's segments there after replacing the clip). Fine grain raises the
bitrate: expect about 900 MB for three and a half minutes at CRF 19 with heavy grain. After the render,
beatsheet.py shows whether the picture lands on the beats around a drop, qc.py lists black frames,
frozen stretches and flash frames (one or two frames that differ from both neighbours: look at each,
they read as glitches), and ffprobe on the file should show one video and one audio stream as long as
the song.
Lip sync. When the song is an existing video's own soundtrack and the user sees that video play in
sync, its timing is final: singing shots at their own song times (sync=0), no offset. Don't "correct"
it from a measurement. Whisper's word timings on a full mix can be off by a third of a second, enough to
make a source that plays in sync look 0.36 s early on a strip read against them; a remake was shifted by
exactly that and the user, who saw the original in sync, had to undo it. lip_check.py strips help place
a lipsync take or check the user's own footage, and av_offset (lip_check.py CODE --save SECONDS) is
for a source the user sees out of sync when it plays on its own. Ask the user to watch the source before
setting one.
Generated lip-sync takes are the opposite case: each one is placed by measurement, never by the time
its slice was cut at. sync_offset.py CLIP --save finds where the take's sound sits in the song and
refuses a take whose sound is not the song (re-sung or garbled lines happen; that take needs a retake).
In the edit, a take enters on its line's first word and leaves before any word its slice did not carry.
When the song is a video's own soundtrack, keep that audio unchanged in the final file: the render
encodes the song as AAC, so put the original stream back with
ffmpeg -i OUT.mp4 -i ORIGINAL.mp4 -map 0:v:0 -map 1:a:0 -c copy -movflags +faststart FINAL.mp4.
Hooks for Reels, TikTok and Shorts. These platforms replay a video in a loop, so a hook should
start on a downbeat and run whole bars: --start and --end move to the nearest bar line (--exact
keeps the times as given), and the audio gets a 3 ms fade at each edge so it doesn't click. Feeds
show the first frame before playback starts, so start on a strong full-frame shot, not black or the
middle of a dissolve. Eight or sixteen bars from a drop usually work.
Give the output path, duration, resolution and size; what changed since the last version; credits
spent this round, in total, and left; the sources credited on the end card; and anything the user must
check or decide: unclear lyric lines, archive items without a license field (Prelinger home movies have none; fine to use, worth checking
before commercial release), and any shot you are unsure about. Clear superseded renders only when asked.
Bring mv/NOTES.md up to date with the version delivered and what is still open.
When the user accepts a video, add its entry at the top of ~/.claude/music-video/history.md in the
template's format (brief, look with its colour pattern, edit, type with its faces, graphics, signature) and save a six-frame sheet of it to
~/.claude/music-video/refs/<title>.jpg (drops, loudest chorus, intro). When the user rejects a
direction outright, add it under "Rejected directions" with their reasons.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
music-video, video-production, beat-grid, slopcore, gpu-compositing, lyric-video
npx claudepluginhub themarco/claude-music-video --plugin music-video-generatorOther plugins' skills for the same job