Communitygithub.com

音乐转节拍同步视频工作流

将音乐曲目(音频文件、视频中的音频或根据情绪简报生成的曲目)转换为节拍同步的视频——歌词视频、幻灯片或动态宣传片。音乐驱动所有节奏;用户提供的任何图像/视频都会剪辑到同一节拍网格上,零资产也能生成完整视频。

音乐转节拍同步视频工作流 是什么?

这个AI技能,即“音乐转节拍同步视频工作流”(Music-to-Video),是一个高度专业化、基于工作流的代理,旨在将单一音乐曲目自动转化为完整的、节拍同步的视频。它专为HyperFrames生态系统设计,但可以独立运行,能够处理不同类型的输出,如歌词视频、动态宣传片或幻灯片。该技能核心功能是提供一种无需手动干预的体验:它分析音频,提取节拍、能量和结构,然后将这些数据驱动一个故事板,自动将文本、模板和用户提供的媒体资产与音乐精准同步。工作流严格分为几个步骤:音乐分析、帧骨架创建、用户参与规划、多代理并行构建帧、组装和渲染。它优先考虑高速、高能量的背景音乐(BGM),确保强有力的节拍驱动剪辑,同时也能处理更平静的曲目,通过音乐乐句而非节拍来控制节奏。该技能设计为自主运行,但在关键规划阶段(步骤3)和最终渲染(步骤6)会征求用户批准,在协作模式和自主模式之间取得平衡。它通过一个详细的、基于JSON的契约(audiomap.json)和一个标准化的故事板格式(STORYBOARD.md)来与其他代理和工具通信。一个关键的设计原则是“一个分析器,完全信任它”,它依赖一个单一的确定性Python脚本(analyze-beatgrid.py)来进行所有节拍分析,从而消除不一致性。该技能还包含用于资产登台、帧验证、故事板渲染和最终视频导出的工具,使其成为从音乐文件到完成视频的端到端解决方案。

兼容平台✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/Alemoterani/auto-edit-hyperframes/tree/HEAD/vendor/hyperframes/skills/music-to-video

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

插件安装: 在执行设置或更新命令之前,当此技能位于HyperFrames插件内部时,请遵循插件执行规则。独立安装则保留下面的更新说明。

首先,保持此技能最新——在执行前与用户确认: npx hyperframes skills update music-to-video。如果一切已是最新,这是一个快速的无操作;否则,在依赖它们之前,它会刷新此技能及其依赖的核心领域技能。

music-to-video — 一个基于音乐、节拍同步的视频工作流

使用此技能将音乐曲目转换为节拍同步的HyperFrames视频。您分析一次曲目,布置帧,填充逐帧计划,并将每个帧构建为一个合成。输入是一个音乐曲目加上用户可选的图像或视频——没有旁白,也没有网页捕获。排版和模板是基础(零资产也能生成完整视频);用户提供的任何媒体都会在同一个节拍网格上被剪辑进来。

您是编排者。在videos/<project>/目录下工作。按顺序执行步骤,并在继续之前通过每个关卡。两个步骤需要用户:步骤3(计划批准)和步骤6(渲染批准)——两者都是每个../hyperframes/references/brief-contract.md中的检查点关卡(在步骤0之前阅读):在自主模式下,将步骤3的摘要作为提醒发布并继续;步骤6的渲染批准仍然需要询问,这是唯一保留的问题。除了步骤4,您自己执行所有步骤,在步骤4中,您为每帧分派一个子代理。设计规则和运动规则不在此文件中——它们位于references/和frame-worker子代理中。

SKILL_DIR = 此技能目录。PROJECT_DIR = videos/<project-name>/。

工作流:步骤0 设置 → hyperframes.json + assets/bgm.mp3;步骤1 分析 → audiomap.json;步骤2 骨架 → STORYBOARD.md(帧,组 TBD);步骤3 计划 → 完整的 STORYBOARD.md + frame.md;步骤4 构建 → compositions/frames/NN-*.html;步骤5 组装 → index.html;步骤6 渲染 → renders/video.mp4。

塑造一切的两种理念

  • 一个分析器,并信任它。 analyze-beatgrid.py 是唯一的节拍分析器——切勿使用其他工具或凭耳朵重新测量节拍。其能量/密度/滚奏/起始点/静音始终可靠。其 bpm 和 beats_sec 仅在音乐真正有节奏感时才可靠;对于平静的音乐,网格是追踪器强加的节拍器,因此请根据乐句和能量来定节奏,切勿硬性剪切。判断您属于哪种情况是每帧的 pacing(步骤2)要做的。
  • 一帧一个文件;组存在于内部。 步骤2将曲目分割成帧,每一帧成为一个合成文件 compositions/frames/NN-<frame_id>.html,由一位帧工作者构建。一帧可以细分为组(每个组是一个模板或一组运动原语)。额外的密度放在组的_内部_,因此帧的数量追踪不同的处理方式,而不是节拍——快节奏的曲目不会增加子代理的数量。

步骤0:设置、背景音乐和输入

目标:确定音乐源,创建HyperFrames项目,并记录用户提供的任何媒体。

简报从意图层开始。 打开规则,按顺序:(1) BRIEF.md 存在 → 阅读它,不要询问它已回答的任何问题——它的 flow/storyboard 推导出模式(简报合同 § 1)。(2) 没有BRIEF.md但项目存在 → 从磁盘上的内容恢复;绝不重新询问。(3) 直接到达这里的全新创建请求 → 阅读 /hyperframes 并运行其意图层(references/intent-interview.md):它确认此路线的必须项(音乐源,目的地→宽高比 — ../hyperframes/references/routes/music-to-video.md),并宣布哪些被推迟——品牌和类型按设计在步骤3选择。初始化后立即写入BRIEF.md(切勿在此之前——init拒绝非空目录)并记录基于偏好的答案(brief-format.md)。编辑请求跳过所有这些。

音乐是脊梁——在任何其他事情之前确定一个曲目。此技能针对快速、高能量的BGM进行了优化:强大的节拍网格驱动剪辑(平静的曲目也能工作,但根据乐句而不是节拍来定节奏)。如果用户提供了音频——一个音乐文件,或一个需要提取音频的视频——请使用它。否则从请求中选择情绪并通过 /media-use(audio/references/bgm.md)生成一个曲目;当宿主应用程序提供自己的音乐工具时,请使用它。在首次经过身份验证的提供者操作之前,运行 npx hyperframes auth status 并逐字中继其输出。如果已登出,应用一个分支:

  • 协作: 等待登录或明确选择继续以离线方式使用本地提供者。
  • 自主: 声明状态并通过可用的本地提供者继续。

如果没有离线提供者能够满足所需的音乐能力,请提出障碍。切勿将密钥写入每个仓库的 .env 中。认证所有权和离线后备方案位于 /media-use references/setup-providers.md § 提供者。生成的曲目存放在 assets/bgm.mp3。暂存提供的图像或视频,以便帧可以在节拍网格上使用它们;否则,排版将承载视频。

歌词视频: 对于与人声同步的歌词,通过 /media-use 转录曲目来获取单词/行的时间,或者要求用户提供歌词文本并将行放置在节拍网格上。

仅当 hyperframes.json 缺失时才初始化。从简报中使用短横线命名法命名 <project>,例如 midnight-drive-loop——绝不要使用时间戳。init 检查已安装的技能与GitHub上的最新版本,如果任何技能过时则会更新全局集合。

npx hyperframes init "videos/<project>" --non-interactive --example=blank --skill=music-to-video
mkdir -p "$PROJECT_DIR/assets" "$PROJECT_DIR/renders"
cp "<user-music>" "$PROJECT_DIR/assets/bgm.mp3"   # 如果需要,先从视频中提取
# 仅当用户向您提供了图像/视频时:
node <SKILL_DIR>/scripts/stage-assets.mjs --from <dir> --hyperframes "$PROJECT_DIR" --into public

品牌(字体+调色板)在步骤3选择,不在这里。不要预先选择类型或曲目类型——资产只是可选的成分,类型从每帧的选择中产生。

关卡: hyperframes.json + assets/bgm.mp3 存在;宽高比/长度/帧率和(如果有的话)资产清单都已记录。


步骤1:分析音乐

目标:生成整个视频所依赖的一个规范时序分析。

analyze-beatgrid.py 是唯一的节拍分析器——切勿使用其他工具或凭耳朵重新测量节拍。它读取一次曲目并写入 audiomap.json:能量阶段(级别/密度/感觉)、起始点 + onset_rate、滚奏、静音、hard_stops、key_moments、乐句、节奏/网格以及 audio.duration_sec。它是确定性的——同一个文件总是给出相同的地图。大多数字段在任何音乐上都是可靠的;bpm 和 beats_sec 仅在音乐真正有节奏感时才可靠,判断这一点是您在步骤2做出的决定。

前置条件:Python 3 且已安装 librosa、numpy 和 soundfile。如果导入失败,请在运行分析器之前将它们安装到活动的Python环境中:

python3 -m pip install librosa numpy soundfile
python3 <SKILL_DIR>/scripts/analyze-beatgrid.py "$PROJECT_DIR/assets/bgm.mp3" \
  -o "$PROJECT_DIR/audiomap.json" --print

关卡: audiomap.json 存在;已知 audio.duration_sec。


步骤2:帧骨架(仅结构)

目标:读取音乐并布置帧——STORYBOARD.md 的骨架。

阅读 references/frame-skeleton.md。自行将 audiomap.json 转换为 STORYBOARD.md 的骨架——没有中间JSON。在真实的音乐变化处(hard_stops、SURGE / DROP key_moments、滚奏的边缘、没有起始点的段落、大的能量跳跃)将曲目切割成帧,将每个边界对齐到音频映射锚点。对于每一帧,设置 span_sec、pacing(来自步骤1信任判断的结论——当网格是真实的时为 beat_cut,当它是强加于平静音乐的节拍器时为 phrase_flow)、mood 和一行 feel(步骤3将模板与之匹配的纯音乐情况)。在此只进行分类和布局:保留每帧的 ### Groups 为 TBD (Step 3),前置元数据 style 为空——没有模板、文案、颜色或字体。预计大约1-6帧。

关卡: 帧铺满曲目(第一帧从0开始,最后一帧在 duration_s 结束);每帧带有 span_sec + pacing + mood + feel;每个 ### Groups 都是 TBD;任何地方都没有内容。


步骤3:填充计划(用户把关)

目标:将骨架转变为已批准的、完整的 STORYBOARD.md。

阅读 references/planning.md、storyboard-format.md、template-catalog.md、motion-primitive-catalog.md 和 montage.md(仅当用户提供了资产时)。在原地编辑同一个文件,做两件事:

  1. 选择品牌。 使用 ../hyperframes-creative/references/design-spec.md 中的表格,从 ../hyperframes-creative/frame-presets/ 中选择一个预设(匹配曲目的情绪;只有其字体和颜色重要——模板拥有构图)。将其未经修改地复制到 frame.md 中,并从其中填充前置元数据 style(字体 + 一个 ≤4–6 色板)。
  2. 填充每一帧。 决定其组,并为每个组赋予一个处理方式:来自目录的匹配模板(带有绑定参数和真实的音频映射锚点)、来自原语目录的自由组合,或一个遵循 pacing 的资产处理方式。在您自由组合一个命名的外观之前,先在实时目录中搜索它:对于用户要求的每个外观、效果、处理或过渡——“CRT扫描线”、“故障”、“胶片颗粒”、“闪光扫描”——运行 npx hyperframes catalog --query "<外观,用简单的英文>" --json 并阅读前几个结果。template-catalog.md 和 motion-primitive-catalog.md 只列出了此技能自己的本地材料;搜索会排列整个托管注册表(约400个块和组件)的优先级,并且不需要安装任何东西——没有项目、没有先前的 add、没有账户。仅当搜索后没有合适的结果时,才自由组合一个外观。编写文案。您拥有WHAT(模板/原语+内容+锚点);帧工作者拥有HOW——切勿向故事板中写入毫秒级的补间。
node <SKILL_DIR>/scripts/validate-plan.mjs --storyboard "$PROJECT_DIR/STORYBOARD.md" \
  --audiomap "$PROJECT_DIR/audiomap.json" --templates <SKILL_DIR>/references/templates

修复每个 ✗(硬错误:持续时间不匹配、帧未铺满曲目、缺少 src);警告尽最大努力。然后在聊天中将逐帧摘要作为提案呈现(../hyperframes/references/review-loop.md § 1),并根据用户的回复进行迭代,直到他们批准;对于 storyboard: yes,也将其写为 storyboard.html(../hyperframes-creative/references/storyboard-recipe.md § 3)供他们打开。在自主模式下,这是一个检查点关卡:将摘要作为提醒发布并继续(validate-plan.mjs 通过是一个质量关卡,仍然会阻塞)。

关卡: frame.md 是预设的逐字副本;validate-plan.mjs 退出码为0;用户已批准计划(自主模式:已将摘要作为提醒发布)。


步骤4:根据计划构建帧

目标:将每一帧构建为一个独立的合成文件。

创建 compositions/frames/。阅读 sub-agents/frame-worker.md 和 ../hyperframes/references/subagent-dispatch.md。为每帧分派一个帧工作者,尽可能并行(否则按波次)。每个工作者只获得一帧和以下上下文:

PROJECT_DIR: <绝对路径>
frame_id: <NN-frame_id>              # = 帧文件主干,例如 02-f2;合成ID
您的块:PROJECT_DIR/STORYBOARD.md 中的 `## Frame N — <frame_id>` 块
audiomap: PROJECT_DIR/audiomap.json
frame.md: PROJECT_DIR/frame.md
材料:对于每个组,<SKILL_DIR>/references/templates/<id>/index.html(模板)和
           <SKILL_DIR>/references/motion-primitives/<id>/(自由);暂存的 assets/(资产组)
合同:../hyperframes-core/references/sub-compositions.md + determinism-rules.md
画布:<w>×<h>   节奏:<beat_cut|phrase_flow>
写入位置:PROJECT_DIR/compositions/frames/<frame_id>.html

工作者分叉引用的材料,将每个锚点转换为帧本地秒数(local_t = track_t − span_sec[0]),以0毫秒剪切来门控其组,并写入一个可安全查找的帧文件。工作者从不运行 hyperframes CLI——这些命令操作的是已组装的完整项目(尚不存在),因此它们会报告错误的文件。工作者只写入合同并停止;您在组装后(步骤6)进行验证。当每个工作者返回时,您可以确认其文件已落到磁盘上。

关卡: 每帧都有其 compositions/frames/NN-*.html 在磁盘上。


步骤5:组装

目标:将构建好的帧 + BGM 接入可播放的 index.html。

assemble-index.mjs 是确定性的——没有子代理,没有判断。它在其累积的 data-start 处引用每个帧文件,将 assets/bgm.mp3 挂载到音轨11,并在帧之间硬性剪切(帧铺满曲目,没有间隙,因此没有过渡注入器)。

node <SKILL_DIR>/scripts/assemble-index.mjs --storyboard "$PROJECT_DIR/STORYBOARD.md" \
  --hyperframes "$PROJECT_DIR" --audiomap "$PROJECT_DIR/audiomap.json"

修复它报告的任何 ✗——缺失或空白的帧文件意味着该工作者写了部分文件;重新分派它(步骤4)并重新组装。

关卡: index.html 存在;总持续时间 == audiomap.audio.duration_sec。


步骤6:验证并渲染

目标:验证组装的视频,获得用户批准,并渲染最终的MP4。

在已组装的项目上运行CLI——这是正确的唯一组成部分

…

[为了翻译而截断]

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

Alemoterani/auto-edit-hyperframes

Overlay doctrine for the embedded-captions workflow — the caption MODEL (drop / rail / embed) and the rule that captions are an OVERLAY composited on top of the film, never a reserved bottom band you shift content up to avoid. Load when adding captions/subtitles to a talking-head or launch video, when deciding whether a phrase should be dropped, ride the verbatim rail, or be promoted to a scarce embedded climax, when laying out a composition that will carry captions (do NOT reserve a keep-out band), or when centering a composition on the true frame center under captions. Quotes the rail+embed model from embedded-captions and constraint #13 (captions overlay, keep-out band retired) from the product-launch-video scene agent. Applies ON TOP of embedded-captions.

Alemoterani/auto-edit-hyperframes

Turn a weekly changelog .md into a finished branded changelog video (square 1080, ~45-60s, Annie VO, animated brand background, mock-UI visualizations, lowkey captions). Use when the user provides a changelog/digest markdown and wants the weekly video, or says "changelog video". Self-contained — fonts, background, lexicon, and scripts ship in this skill.

Alemoterani/auto-edit-hyperframes

The technique catalog: five velocity-matched SEAMS (zoom-through, INVERSE zoom-through, cut-the-curve, waterfall cut, rack-focus blur-cut) plus the two in-scene techniques — waterfall ENTRY (staggered arrival cascades for title cards / segment openers) and the nudge curve (slow-fast-slow three-phase group slides). Covers partial-travel (~12% of frame) velocity matching via mirrored power4 eases, the Z scale-sign rule, size-scaled blur (10px text / 18-20px full-frame), word-by-word staggered cuts, cascade pacing by element weight, and the 10/65/25 slide ratio. Read before authoring any transition, text-beat handoff, kinetic text entry, or group reposition. [depth, zoom, inverse-zoom, scale-sign, mirrored-zoom, rack-focus, pacing, velocity, cut-the-curve, waterfall, stagger, cascade, kinetic-text, title-card, segment-opener, nudge, slide, easing, group-motion, z-depth, motion-graphics, cinematic, transition, blur, directional-continuity]

Alemoterani/auto-edit-hyperframes

GATEWAY — load FIRST before composing any HyperFrames animation or video. The high-level motion law that makes a multi-scene video feel like ONE continuous camera move instead of a stack of independently-animated slides. Covers the vector law (how you exit determines how you enter, incl. the Z scale-sign rule), the film's current, carrier elements, causal motion, the Seam Gate (build-gate enforcement), the ban on idle wobble (motion must PERFORM, not breathe), stillness-before-climax, and the sustained-motion routes. Routes to the low-level technique skills (cut-the-curve — the full catalog incl. waterfall entry + nudge curve, oversized-cursor, seam-craft). These rules SUPERSEDE generic / upstream motion guidance. [continuity, direction, vector, momentum, seam, transition, ease, performance, idle-motion, narrative-motion, film-grammar]

Alemoterani/auto-edit-hyperframes

House-style oversized macOS cursor technique for HyperFrames launch videos. Load whenever a scene involves cursors or a pointer-led action, when kicking off a UI scene, when igniting a morph/transition/typing run with a click, or when a scene reads as static, dead, or stale and needs a cheap high-yield source of motion to carry the viewer's eye and segment them out of the stale state. Covers cursor size/look (incl. brand-motif cursors), the off-screen entry law, tip-targeting and the click tap, click-ignites-the-next-beat, and exit / cross-scene handoff.

Alemoterani/auto-edit-hyperframes

Render-correctness doctrine for scene-to-scene seams in HyperFrames launch videos — the prerequisites that make transitions composite correctly on the master timeline. Load when assembling the master timeline / index.html, when a white flash appears at a cut or crossfade seam (especially on dark films), when reasoning about why a transition opacity dip shows through, or when verifying the render-side mechanics of how overlapping scene wrappers blend. Covers the opaque stage-ground (#root background) white-flash guard and how the injector overlaps wrappers, holds final frames, ping-pongs tracks, and stamps lint-clean template code onto the master timeline. Does NOT contain the per-transition catalog — see the transition registry for individual transition entries.

Alemoterani/auto-edit-hyperframes

Leaves sweep through the frame and part to reveal the headline. HyperFrames block, 1920×1080, 12s, 11 variables.

Alemoterani/auto-edit-hyperframes

A tiled headline surface flips cell by cell under a sweeping depth field to reveal the rear headline. HyperFrames block, 1920×1080, 8s, 18 variables.

Alemoterani/auto-edit-hyperframes

A chain of bevelled cuboids rides a travelling wave as a content carousel. HyperFrames block, 1920×1080, 6.666666666666667s, 40 variables.

Alemoterani/auto-edit-hyperframes

An orbiting camera follows an ice logo as it breaks apart, reforms into two text moments, and fades. HyperFrames block, 1920×1080, 22.5s, 216 variables.

Alemoterani/auto-edit-hyperframes

Glass shards fly in through fog and tile themselves into the headline. HyperFrames block, 1920×1080, 12.16s, 19 variables.

Alemoterani/auto-edit-hyperframes

A single feature card orbits a dot sphere on approved Blender camera motion. HyperFrames block, 1920×1080, 10s, 4 variables.

Alemoterani/auto-edit-hyperframes

A wireframe portal bursts open, the title comes through, then its letters swap into a second phrase. HyperFrames block, 1920×1080, 8s, 9 variables.

Alemoterani/auto-edit-hyperframes

Add captions or subtitles to an existing single-subject talking-head video without editing the footage. Use for plain verbatim captions, cinematic captions embedded behind the subject, VFX captions, “炸/特效/酷炫字幕,” or a named identity from the 35-style catalog. Route by visual identity, not by backend engine. The quiet `anchor` rail is the default; embed every word only when the user explicitly wants a fully cinematic treatment. The workflow runs locally end to end, including transcription and subject matting; split multi-shot footage before applying it.

Alemoterani/auto-edit-hyperframes

Turn arbitrary text — an article, notes, a topic, a brief — into a faceless explainer video: there is no site or footage to capture, so the visuals are invented per scene (typography, abstract graphics, diagrams, data-viz). Use for topic explainers, concept breakdowns, how-tos, listicles. Not a video built from a website (/product-launch-video — promo or tour). Unclear → /hyperframes.

Alemoterani/auto-edit-hyperframes

Import Figma content into a HyperFrames composition — rendered assets, brand tokens, components, storyboard sections → reconstructed motion (frames read as states, not slides) (REST/CLI), connector-assisted motion when available, and shaders from a connector or native export. Use when the user pastes a figma.com link or asks to bring a Figma design, frame, logo, brand, or animation into a video/composition.

Alemoterani/auto-edit-hyperframes

Author or edit a custom HyperFrames composition when no specialized workflow fits, or when BRIEF.md sets flow: companion. Use for longer or multi-scene pieces, brand and sizzle reels, montages, static loops, static title cards, footage remixes, and freeform builds. Use motion-graphics instead for a short unnarrated motion-first unit, including an animated title. Route fresh creation through hyperframes before using this skill.

Alemoterani/auto-edit-hyperframes

All animation knowledge for HyperFrames — atomic motion rules, multi-phase scene blueprints, scene transitions, broader motion-design techniques, AND the seven runtime adapters (GSAP default, plus Lottie, Three.js, Anime.js, CSS keyframes, Web Animations API, TypeGPU). Use for any motion or animation task: pick 2-4 rules and compose, or load a blueprint, or look up runtime-specific API (e.g. GSAP eases / Lottie player / Three.js mixer). Also covers auditing an existing composition's choreography (animation map) and 24 named text-animation effects. HyperFrames-native: single paused timeline, seek-safe, deterministic.

Alemoterani/auto-edit-hyperframes

Use when audio already placed in a HyperFrames composition needs to be mixed: fade-in/fade-out, crossfade, track gain or volume, volume automation, ducking, a music bed that fights a voiceover (voiceover carve), effects on a track (EQ, compressor, limiter, gate, saturation, delay, reverb, chorus, phaser, bitcrush), automation envelopes drawn on a track's volume or any effect parameter, or one submix bus carrying a chain, a fader and an automation clock for several tracks at once (`<hf-audio-group>`). Don't use for sourcing or generating audio — finding BGM, SFX, or making a voiceover is `/media-use`. Don't use for clip timing or track layout, which is `/hyperframes-core`.

Alemoterani/auto-edit-hyperframes

Use the HyperFrames CLI development loop: init, add, catalog, capture, lint, check, snapshot, compare, grade-compare, preview, play, present, beats, keyframes, single or batch render, publish, cloud, cloudrun, feedback, lambda, doctor, browser, info, upgrade, skills, compositions, timeline, history, clean, docs, benchmark, telemetry, transcribe, auth, tts, and remove-background. Also use when diagnosing build or render failures. validate, inspect, and layout are deprecated aliases; use check. Covers local, HeyGen-hosted cloud, AWS Lambda, and Google Cloud Run rendering.

相关技能