Home / All Skills / Docs & Knowledge / music-to-video
Docs & Knowledge · heygen-com/hyperframes

music-to-video

Turn a music track (an audio file, a video to pull audio from, or a track generated from a mood brief) into a beat-synced video — lyric video, slideshow, or kinetic promo. The music drives all pacing; any user-supplied images/videos are cut onto the same beat grid, and a complete video needs zero assets. Narrated pieces → the input-matched workflow (see /hyperframes). Unclear → /hyperframes.

L4 High-Privilege · Graded auth & full auditV1 Commit-PinnedExecute CommandInstall DepsNetwork AccessWrite FileDual-pass Audit
Author heygen-comGitHub heygen-com/hyperframes ↗Stars 48297License Apache-2.0(仓库根 LICENSE;GitHub API spdx Apache-2.0)Commit b8328f9573
Control levels describe skill capabilities and suggested control measures; they do not represent quality or safety certifications, nor do they dictate usability. Usage decisions rest entirely with users and administrators. Different agent hosts apply varying constraints; do not assume hosts provide automatic protection. Third-party skill copyrights belong to their original authors. Use at your own risk.

1How It Works & Mechanism

An end-to-end 7-step gated workflow skill: Step 0 Initialize project (hyperframes.json + assets/bgm.mp3) → Step 1 Music analysis (audiomap.json) → Step 2 Frame skeleton (STORYBOARD.md) → Step 3 User-gated plan population → Step 4 Parallel build with one frame-worker sub-agent per frame → Step 5 Deterministic assembly into index.html → Step 6 User-gated check + render.

skills/music-to-video/SKILL.md
Workflow: Step 0 setup → `hyperframes.json` + `assets/bgm.mp3`; Step 1 analyze → `audiomap.json`; Step 2 skeleton → `STORYBOARD.md` (frames, groups `TBD`); Step 3 plan → complete `STORYBOARD.md` + `frame.md`; Step 4 build → `compositions/frames/NN-*.html`; Step 5 assemble → `index.html`; Step 6 render → `renders/video.mp4`.
Two user gates: Step 3 plan approval and Step 6 render approval (autonomous mode issues a heads-up and continues); 'Do every step yourself except **Step 4**, where you dispatch **one sub-agent per frame**.'

Beat analysis is executed by a single authoritative script: analyze-beatgrid.py (Python: librosa beat tracker + 16th-note bar grid + drum kit band-split classification + riser/glitch/hard-stop events + energy narrative), producing a deterministic audiomap.json; the SKILL strictly forbids re-detecting beats using other tools or by ear.

skills/music-to-video/SKILL.md
`analyze-beatgrid.py` is the **only** beat analyzer — never re-measure beats with another tool or by ear. Its energy / density / rolls / onsets / silences are always reliable.
Script header docstring: 'Turns a BGM track directly into a deterministic `audiomap.json`… merges: reliable tempo + beat grid + downbeat (librosa beat tracker), metrical position per event, drum-element classification (band-split), special audio events, energy narrative, phrase layer + density budgets'; Deps: ffmpeg/ffprobe + librosa/numpy/soundfile.

The script remains honest about unreliable fields: bpm/beats_sec are only trustworthy when music truly has rhythm—on calm music, the grid is merely a metronome imposed by the tracker; the pacing (beat_cut/phrase_flow) for each frame is decided by the orchestrator in Step 2.

skills/music-to-video/SKILL.md
Its `bpm` and `beats_sec` are reliable **only when the music is genuinely rhythmic**; on calm music the grid is a metronome the tracker imposed, so pace by phrases and energy instead and never hard-cut to it.
pacing is a mandatory field for every frame starting from Step 2, and it constrains asset treatment and template selection in Steps 3/4 (asset treatment must obey pacing) — explicitly modeling musical perception decisions into the data structure.

Workforce allocation model: The orchestrator (this skill) only plans and assembles, delegating each frame to a frame-worker sub-agent to build a single composition file based on fixed context (PROJECT_DIR, frame_id, Storyboard block, audiomap, frame.md, asset paths, and contracts); frame count tracks 'distinct treatments' rather than beat count (packing density within frames) to prevent fast-tempo music from exhausting sub-agent counts.

skills/music-to-video/SKILL.md
Extra density goes _inside_ a group, so **frame count tracks distinct treatments, not beats** — a fast track does not blow up the number of sub-agents.
frame-worker.md verified: Workers only write files without running the hyperframes CLI ('those commands operate on the assembled project, which doesn't exist yet'); Step 6 has the orchestrator perform unified check/snapshot/render — strict contracts prevent sub-agents from running validations against the wrong target unit.

Deterministic assembly is guaranteed by scripts: assemble-index.mjs runs without sub-agents or heuristic judgment, mounting each frame by the accumulated data-start from the STORYBOARD, BGM on track 11, with hard cuts between frames (no transition injector needed—frames already fill tracks seamlessly); validate-plan.mjs validates the plan in Step 3 (duration mismatches, uncovered frames, and missing src are treated as hard errors).

skills/music-to-video/SKILL.md
`assemble-index.mjs` is deterministic — no subagent, no judgment. It references each frame file at its cumulative `data-start`, mounts `assets/bgm.mp3` on track 11, and hard-cuts frame → frame (frames tile the track with no gaps, so there is **no transition injector**).
'Frame count tracks distinct treatments' + hard cut assembly = simple, verifiable timeline math: total duration must equal audiomap.audio.duration_sec (Gate criterion).

Clear asset/BGM provenance chain: User supplies audio/video → extract; none provided → route to /media-use for mood→track generation (provider auth belongs to media-use; the SKILL only relays output via `npx hyperframes auth status` and states 'Never write keys into a per-repo .env'); local offline providers act as fallbacks.

skills/music-to-video/SKILL.md
If signed out, apply one branch: - **Collaborative:** wait for sign-in or an explicit choice to continue offline with the local provider. - **Autonomous:** state the status and continue through the available local provider.
Execution boundary division: This workflow itself holds no keys; 'Auth ownership and offline fallbacks live in `/media-use` `references/setup-providers.md` § Providers.'

2Core Capabilities

01Authoritative beat/energy/event analysis (analyze-beatgrid.py → deterministic audiomap.json)
02Frame skeleton design based on musical structure (cutting frames on hard_stops, key_moments, roll edges, and onset silences, snapping to audiomap anchors)
03Dual catalogs for templates and motion primitives: L1 templates (card-flyby, held-text-strobe-burst, etc., with program.json) + L0 motion-primitives (42 index.html recipes)
04Plan validation (validate-plan.mjs: hard errors on duration mismatch, unmapped ranges, missing src) and deterministic assembly (assemble-index.mjs)
05Asset staging (stage-assets.mjs cuts user images/videos per frame onto the exact same beat grid)
06Frame-level parallel building (one frame-worker sub-agent per frame) with a resume matrix (resuming from any intermediate state)
07Pre-delivery verification loop: check . --snapshots for visual inspection at t=0, frame starts, DROP-SURGE, hard_stops, and the final frame + render upon user approval

3External Dependencies

KindDependency / Endpoint
packagePython3 + librosa/numpy/soundfile(analyze-beatgrid.py;缺失时 pip install)
cliffmpeg/ffprobe(analyze-beatgrid.py 解码)
clihyperframes CLI(init/update/auth status/check/render;render 带 --skill=music-to-video)
network(间接)pip/npm 官方注册表首次拉包;BGM 生成走 /media-use provider(HeyGen/Lyria 等,auth 属 media-use)
network产物运行期 CDN(模板引用 jsdelivr gsap/three;作品级依赖)

4Recommended Governance & Evidence

Suggested Controls for Safe Operation
For Agent Runtime
Graded/per-use authorization, sandbox recommended
For Administrators
Approval workflow, rollback support, full audit
Evidence & Triggers (File Paths & Excerpts)
  • scripts/: Executes local scripts or commands: python3 analyze-beatgrid.py assets/bgm.mp3 -o audiomap.json (local decoding and analysis; ffmpeg s
  • scripts/ 或 SKILL.md: Declares dynamic installation of external language package dependencies
  • 网络端点: Declares external network access: pip install (official PyPI packages, only when dependencies are missing), npx hyperframes initial/update package pulls (official npm/GitHub channels)
  • 本地工作目录: File I/O and artifact output: Complete set of project artifacts under videos/<project>/: hyperframes.json, assets/bgm.mp3, audiomap.json, STOR
Audit Notes: This workflow itself does not handle credentials directly (it explicitly avoids writing keys, and auth belongs to /media-use), but it will: (1) Run local Python analysis (executing `pip install librosa numpy soundfile` from official PyPI packages only when dependencies are missing); (2) Execute official hyperframes CLI commands (init/update/check/render, where render requires user approval) and fetch packages via official npm/GitHub channels; (3) Run `npx hyperframes auth status` to relay account login/usage status (account-level status inspection, not plaintext tokens; broadly documented according to standardized tiering, keeping it yellow because it neither reads keys nor exfiltrates data, and endpoints are official and expected); (4) Delegate BGM generation to /media-use (whose credential surface is handled under media-use, classified as orange). All outbound destinations are official/expected endpoints → yellow.

5Second-Pass Verification

  • [ok] 『analyze-beatgrid.py 是唯一分析器』 — SKILL.md Step 1/Two ideas 两处声明 + 目录实测无其它分析脚本;audio 相关生成/转写均指向 media-use。
  • [ok] 帧数与子代理数解耦声称 — SKILL.md 'frame count tracks distinct treatments, not beats' + frame-worker.md 'One frame = one file; groups live inside' 复核一致。
  • [ok] worker 不跑 CLI 的纪律 — SKILL.md Step 4 'The worker never runs the `hyperframes` CLI…' + frame-worker.md 'Writing the file is your terminal action; the orchestrator runs lint/check' 双重复核。
  • [discrepancy] auth status 是否触碰凭证 — 首轮注记『无凭证面』需细化:Step 0 确实运行 `npx hyperframes auth status` 并中继输出(登录/用量状态,账户级而非明文 token),且 BGM 生成委托 media-use 时其凭证面在 media-use。已在 credential_reads/reason 如实表述并维持 yellow。
  • [ok] 渲染门禁与时长一致性判据 — Gate 文本 'the user approved … `renders/video.mp4` exists with audio, duration == audiomap.audio.duration_sec' 与 assemble 的确定性设计自洽。

6Verdict & Scenarios

  • Seven-step pipeline + step-by-step gates + two user approval checkpoints transform 'music-to-video' from guesswork into an auditable, resumable, deterministic workflow
  • A single authoritative audiomap runs through the entire chain, explicitly modeling beat/pacing decisions (beat_cut/phrase_flow required per frame) to eliminate multi-tool drift
  • Separation of orchestration and execution: the orchestrator defines WHAT, frame-worker defines HOW, and scripts handle deterministic math, creating auditable duty boundaries
  • Full video generation from zero assets + user assets cut to the same grid, with two-tier template/primitive catalogs lowering per-frame production costs
  • Best for: Ideal for creative sessions turning music tracks (file, extracted, or generated from a mood) into beat-synced final videos (lyric videos, slideshows, kinetic promos), especially scenarios with clear rhythm, no narration, and zero-asset requirements; also serves as a complete reference paradigm for 'deterministic assembly + sub-agent parallel construction + gated workflows'.
    Not for: Not suitable for narrated/spoken content (→ input-matched workflows in /hyperframes, such as faceless-explainer or general-video); not suitable for content where music serves merely as background padding rather than driving the beat; not suitable when no music file exists and generation or login is declined (missing BGM stalls Step 0 unless a local provider is used).
    Install Agent-Ready
    ① Verified Mirror 2026-09-09
    Option A · Direct DownloadDownload music-to-video.tar.gz
    sha256: 7806505645ff0114…
    Option B · Copy Guide for Agent
    install.json
    Agents automatically download and verify mirrors from this JSON guide.
    ② Upstream GitHub
    GitHub Repo ↗
    Pinned to commit b8328f9573.