music-reels-cut
Beat-synced vertical 1080x1920 mp4 from source footage and a music track. Cut density follows the
song's real beats and phrases, not a guessed BPM.
Tools
scripts/beats.mjs: beat, downbeat and section detection with the public life2film-engine package (WASM, runs offline). Needs Node 20+, ffmpeg, npm i life2film-engine in the working folder.
scripts/render_template.py: the orchestrator. Copy it, edit the # EDIT: lines, run it with uv run --script.
- ffmpeg with
-filter_complex_script (the chain is too long for an inline argument).
Workflow
- Inputs. Audio file, source video (any aspect), density preset:
chill (1 s verse / 0.5 s chorus), medium (0.5 / 0.25, default), wild (0.25 / 0.125, near subliminal). Target length defaults to min(audio length, 60 s). Ask once, in one message.
- Beats.
npm i life2film-engine
node scripts/beats.mjs song.mp3 > beats.json
jq '{bpm, confidence, pulse_strength, sections}' beats.json
If pulse_strength is under 0.2 the BPM is a guess; say so. A BPM that looks halved is half-time: treat 0.5 s cuts as on-beat, 0.25 s as half-beat. sections come from loudness per four-bar phrase (loud = chorus, quiet = verse); check them against the song and edit beats.json by hand if a phrase is mislabelled.
- Frame pools. Extract a preview frame every ~15 s with
ffmpeg -ss T -i src -vframes 1 -vf scale=320:-1, look at each, sort timestamps into INTIMATE (close-ups, dark, faces), WIDE (landscape, crowds, walking) and TEXTURE (sky, water, abstract). Mix pools in the chorus; do not stay in one pool for more than four cuts.
- Render script. Copy
scripts/render_template.py next to beats.json, set SRC_VIDEO, SRC_AUDIO, the three pools and DENSITY, run it.
- Verify. Pull ~7 frames at section boundaries (intro, mid-verse, chorus, peak, outro) and look at them: aspect not stretched (see lesson 2), effect changes visible between adjacent cuts, flashes landing on downbeats.
Effect palette (14)
INTRO_FADE, OUTRO_FADE, INTIMATE_DARK (dark grade), FLASH_WHITE (downbeat snap), MIRROR_H, DBL_MIRROR, DBL_MIRROR_HUE, WATER and WATER_HUE (reflection), KALEIDO and KALEIDO_RGB (4-way quadrants), TILE3X3, CHROMA (RGB shift), INVERT, PIXEL_CHROMA (pixelise plus frame echo). Add one in chain(idx, ss, dur, fx) by copying an existing branch: trim, composite, eq=..., setsar=1,format=yuv420p[c{idx}].
Lessons
- Real beats only. Detection takes seconds and removes the guesswork. Energy drives density: loud chorus 0.25 s, quiet verse 0.5 s.
- Aspect trap in stacked effects. For a 9:16 source
scale=1080:960 stretches. Use scale=1080:1920,crop=1080:960:0:480. Same for any vstack/hstack of two halves where target ratio differs from the source.
setsar=1 at the end of every chain. overlay/hstack/vstack change SAR silently and concat then fails with Input link parameters do not match.
-filter_complex_script, not inline, past ~60 cuts.
- FLASH_WHITE on downbeats lets the eye lock on at 0.25 s cuts; without it eighth-note chaos feels arrhythmic. Match with
near_downbeat(t, eps=0.12).
- 0.25 s is the visual floor. 0.125 s works as an occasional accent, not a sustained section.
- Variety. Stride-shuffle the pool (
pool[(idx * 7) % len]): a non-repeating order without a random seed.
- Size. CRF 21 + preset medium gives ~75 MB for 40 s of 1080p vertical. For TikTok under 50 MB use CRF 24 + preset slow.
- Trust the detector over your ear for sections. A passage guessed as a breakdown can be the loudest chorus; rewrite the cuts to match.
- Landscape source into vertical. Do not
scale=1080:1920 (stretches faces). Zoom-crop scale=-1:1920,crop=1080:1920 loses the sides; scale=1080:-1,pad=1080:1920:0:(1920-ih)/2:black letterboxes. Ask which.
Don't
- Guess the BPM or section boundaries from the file name or a hunch.
- Ship without looking at output frames.
1---2name: solo-music-reels-cut3description: Cut a vertical reels/shorts/TikTok music video from a source video plus a new audio track. Real beat detection (no guessed BPM), section-aware cut density (verse = mirror/water, chorus = kaleidoscope/RGB shift, peak = fastest cuts with a flash on every downbeat), 14-effect ffmpeg palette. Use when user says "cut a reel for this song", "music video from this footage", "beat-synced clip", "shorts from this track", "сделай ролик на трек", "клип на мою музыку", or hands over an audio file and a video expecting a montage. Do NOT use for cutting speech or interviews (use /video-edit) or for splitting a song into stems (use /stem-split).4license: MIT5metadata:6 source: https://skillmd.com/skills/fortunto2/solo-music-reels-cut7 author: fortunto28 version: "1.1.0"9 openclaw:10 emoji: "🎬"11---1213# music-reels-cut1415Beat-synced vertical 1080x1920 mp4 from source footage and a music track. Cut density follows the16song's real beats and phrases, not a guessed BPM.1718## Tools1920- `scripts/beats.mjs`: beat, downbeat and section detection with the public `life2film-engine` package (WASM, runs offline). Needs Node 20+, ffmpeg, `npm i life2film-engine` in the working folder.21- `scripts/render_template.py`: the orchestrator. Copy it, edit the `# EDIT:` lines, run it with `uv run --script`.22- ffmpeg with `-filter_complex_script` (the chain is too long for an inline argument).2324## Workflow25261. **Inputs.** Audio file, source video (any aspect), density preset: `chill` (1 s verse / 0.5 s chorus), `medium` (0.5 / 0.25, default), `wild` (0.25 / 0.125, near subliminal). Target length defaults to `min(audio length, 60 s)`. Ask once, in one message.272. **Beats.**28 ```bash29 npm i life2film-engine30 node scripts/beats.mjs song.mp3 > beats.json31 jq '{bpm, confidence, pulse_strength, sections}' beats.json32 ```33 If `pulse_strength` is under 0.2 the BPM is a guess; say so. A BPM that looks halved is half-time: treat 0.5 s cuts as on-beat, 0.25 s as half-beat. `sections` come from loudness per four-bar phrase (loud = chorus, quiet = verse); check them against the song and edit `beats.json` by hand if a phrase is mislabelled.343. **Frame pools.** Extract a preview frame every ~15 s with `ffmpeg -ss T -i src -vframes 1 -vf scale=320:-1`, look at each, sort timestamps into `INTIMATE` (close-ups, dark, faces), `WIDE` (landscape, crowds, walking) and `TEXTURE` (sky, water, abstract). Mix pools in the chorus; do not stay in one pool for more than four cuts.354. **Render script.** Copy `scripts/render_template.py` next to `beats.json`, set `SRC_VIDEO`, `SRC_AUDIO`, the three pools and `DENSITY`, run it.365. **Verify.** Pull ~7 frames at section boundaries (intro, mid-verse, chorus, peak, outro) and look at them: aspect not stretched (see lesson 2), effect changes visible between adjacent cuts, flashes landing on downbeats.3738## Effect palette (14)3940INTRO_FADE, OUTRO_FADE, INTIMATE_DARK (dark grade), FLASH_WHITE (downbeat snap), MIRROR_H, DBL_MIRROR, DBL_MIRROR_HUE, WATER and WATER_HUE (reflection), KALEIDO and KALEIDO_RGB (4-way quadrants), TILE3X3, CHROMA (RGB shift), INVERT, PIXEL_CHROMA (pixelise plus frame echo). Add one in `chain(idx, ss, dur, fx)` by copying an existing branch: `trim`, composite, `eq=...`, `setsar=1,format=yuv420p[c{idx}]`.4142## Lessons43441. **Real beats only.** Detection takes seconds and removes the guesswork. Energy drives density: loud chorus 0.25 s, quiet verse 0.5 s.452. **Aspect trap in stacked effects.** For a 9:16 source `scale=1080:960` stretches. Use `scale=1080:1920,crop=1080:960:0:480`. Same for any vstack/hstack of two halves where target ratio differs from the source.463. **`setsar=1` at the end of every chain.** overlay/hstack/vstack change SAR silently and `concat` then fails with `Input link parameters do not match`.474. **`-filter_complex_script`, not inline,** past ~60 cuts.485. **FLASH_WHITE on downbeats** lets the eye lock on at 0.25 s cuts; without it eighth-note chaos feels arrhythmic. Match with `near_downbeat(t, eps=0.12)`.496. **0.25 s is the visual floor.** 0.125 s works as an occasional accent, not a sustained section.507. **Variety.** Stride-shuffle the pool (`pool[(idx * 7) % len]`): a non-repeating order without a random seed.518. **Size.** CRF 21 + preset medium gives ~75 MB for 40 s of 1080p vertical. For TikTok under 50 MB use CRF 24 + preset slow.529. **Trust the detector over your ear for sections.** A passage guessed as a breakdown can be the loudest chorus; rewrite the cuts to match.5310. **Landscape source into vertical.** Do not `scale=1080:1920` (stretches faces). Zoom-crop `scale=-1:1920,crop=1080:1920` loses the sides; `scale=1080:-1,pad=1080:1920:0:(1920-ih)/2:black` letterboxes. Ask which.5455## Don't5657- Guess the BPM or section boundaries from the file name or a hunch.58- Ship without looking at output frames.