Communitygithub.com

audio-story-video

Use when turning a narrated audio file (MP3, WAV, M4A, audiobook, folklore, history, or podcast) into a multi-part animated HyperFrames video series with character rigs, backgrounds, and narration-synced scenes, especially when minimizing AI token usage, avoiding Studio 403 errors on Windows, or rendering long videos on a standard laptop.

audio-story-video란 무엇인가요?

audio-story-video is a Claude Code agent skill that use when turning a narrated audio file (MP3, WAV, M4A, audiobook, folklore, history, or podcast) into a multi-part animated HyperFrames video series with character rigs, backgrounds, and narration-synced scenes, especially when minimizing AI token usage, avoiding Studio 403 errors on Windows, or rendering long videos on a standard laptop.

지원 대상~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/jobjab-dev/audio-story-video/tree/HEAD

즐겨 사용하는 AI에게 물어보기

이 에이전트 스킬이 미리 로드된 새 채팅을 엽니다.

문서

Audio-to-Animated-Story Video (HyperFrames Data-Driven Pipeline)

Overview

Turn any long narrated audio file into a complete, narration-synced animated HyperFrames video series using one reusable data-driven engine + compact per-part JSON, keeping AI token usage minimal and rendering 100% offline.

Core principle: Separate reusable motion/layout code (written once from bundled templates/) from per-story art (characters.svg, backgrounds.js) and per-part story data (data/partXX.json). Never hand-write per-scene HTML, never spawn parallel episode subagents, and never burn tokens on PNG snapshot loops or inline batch rendering.

Quick Reference

PhaseArtifact ProducedToken / Runtime Rule
0. AlignAspect ratio (16:9 default), art style, subtitles (off default)Ask before drawing rigs or backgrounds
1. Audio & Textaudio/chunks/partXX.m4a + transcripts/parts_compact/partXX.txtTranscribe once; compact start-end|text local 0..300s
2. Core & Artengine/ + assets/characters.svg + scripts/Copy templates/; author only story rigs & backgrounds
3. Pilot Gatebuild/part01 live in HyperFrames StudioReal copied assets/ (no junctions); wait for user approval
4. Author JSONdata/part01.json .. data/partNN.jsonSingle session; batch-read 3–4 transcripts, batch-write 3–4 JSONs
5. Build & Checkbuild/part01/ .. build/partNN/node scripts/build-series.mjs all + Node validator (node --check)
6. Renderrenders/partXX.mp4 + renders/full_story.mp4Hand user offline render-all.ps1 (0 AI tokens)

Step-by-Step Pipeline

Step 0: Align Before Generating Assets

Before writing rigs or backgrounds, confirm three items with the user if not already stated:

  1. Aspect ratio: Default 16:9 (1920×1080, 30 fps); confirm if 9:16 is wanted instead.
  2. Visual style & genre: Period/culture, color palette, and cast list.
  3. Subtitles / title card: Default no subtitles (only an opening title card on Part 01 Scene 1).

Step 1: One-Time Audio Split & Compact Transcription

  1. Slice the master audio into ~5-minute chunks (300s) using ffmpeg into audio/chunks/part01.m4a .. partNN.m4a.
  2. Transcribe once and convert to compact part-local text files transcripts/parts_compact/partXX.txt, one line per cue with local timestamps (0 to chunk duration):
    0-4.3|Narration line one
    4.3-10.7|Narration line two
    
  3. Never re-run Whisper or re-slice audio if audio/chunks/ and transcripts/parts_compact/ already exist.

Step 2: Copy Bundled Templates & Author Story Art

Copy all 5 files from this skill's templates/ directory into the project:

  • templates/engine.js → engine/engine.js
  • templates/fx.css → engine/fx.css
  • templates/anim-helpers.js → assets/anim-helpers.js
  • templates/build-series.mjs → scripts/build-series.mjs
  • templates/render-all.ps1 → scripts/render-all.ps1

Then author ONLY the two story-specific art files:

  1. assets/characters.svg (and compiled assets/characters.js):
    • Mandatory Parent-Child Rig Hierarchy: Nest .part-head, back-hair, .part-arm-l, and .part-arm-r inside .part-torso so bowing or tilting never detaches heads, hair, or arms from the body.
    • Center every character around x=160 in viewBox="0 0 320 480" with feet at y=455.
    • Record each character's [eyeY, mouthY] in FACE_Y inside engine/engine.js so universal facial emotions align pixel-perfectly.
  2. engine/backgrounds.js:
    • Export window.KCBackgrounds = { ids, build, crowd, prop }.
    • Provide 10–16 reusable layered backgrounds ({ far, mid, near, front }).
    • Provide dense background crowds (crowd) of 6–8 depth-scaled figures pushed to the far left/right wings (x=35..360 and x=1480..1800, opacity: 0.74) so they frame scenes without overlapping foreground actors.
    • Provide reusable iconic set-piece props (rituals, thrones, altars, weapons, vehicles, bridal-bed, etc.) instead of writing bespoke per-scene HTML/SVG files.

Step 3: Pilot Preview Gate (Before Full Series)

  1. Author data/part01.json (or a 2-minute pilot) and run node scripts/build-series.mjs part01.
  2. Windows Studio Asset Rule: build-series.mjs MUST copy assets/ as a real local directory inside each build/partXX/assets/. NEVER use mklink /J junctions or mklink /D symlinks — HyperFrames Studio rejects realpaths resolving outside the project root with 403 Forbidden.
  3. Launch HyperFrames Studio preview for the user and wait for visual approval before authoring the remaining parts:
    node .agents/skills/hyperframes/scripts/plugin-cli.mjs preview build/part01 --port 3003
    
    (Or npx hyperframes preview build/part01 --port 3003 if installed globally/locally.)

Step 4: Single-Session Data-Driven JSON Authoring

Author data/part01.json .. data/partNN.json directly in the main session in parallel batches of 3–4 files (read 3–4 partXX.txt files in parallel → write 3–4 data/partXX.json files in parallel).

Scene JSON Contract (data/partXX.json):

{
  "dur": 300,
  "scenes": [
    {
      "start": 0,
      "end": 14.5,
      "bg": "village-day",
      "char": ["char-hero", "char-heroine", "char-rival"],
      "pose": ["talk", "idle-breathing", "enter-right"],
      "enterAt": [0, 0, 5.2],
      "mood": ["happy", "love", "angry"],
      "crowd": "villagers",
      "prop": "offering-tray",
      "staging": "courtship",
      "fx": ["fade-in", "petals", "vignette"],
      "cam": "zoom-in"
    }
  ]
}

Required Scene Authoring Rules:

  • Granularity: Aim for 14–24 crisp scenes per 5-minute part (~8–20s each). Split a new scene whenever the location or character group changes — never cram two unrelated locations into one scene.
  • Unlimited Cast: Never artificially cap characters at 2 or 4. Include every named character present in the narration; engine.js automatically spaces 1–7 characters in a wide row and 8+ characters into a 2-row depth layout.
  • Exact enterAt Sync: Whenever a character is mentioned mid-scene, set enterAt[k] to the exact relative seconds (cueTime - scene.start). anim-helpers.js hides late entrants with gsap.set(..., { opacity: 0 }) outside the timeline so they never flash visible at t=0.
  • Contextual Emotions (No Constant Mouth-Flapping): Use mood (calm, happy, love, sad, angry, shock, smirk, stern) for eyebrows, mouth shape, blush, teardrops, or sweat drops. Do NOT add continuous talking mouth-flap loops.
  • Delicate / Iconic Scenes: Use reusable staging + prop combinations:
    • Courtship: "staging": "courtship" + warm glow prop (brings pair closer [760, 1160], tender lean-in, love mood).
    • Intimate / bridal chamber (tasteful, YouTube-safe): "staging": "intimate" + "prop": "bridal-bed" (pair moves into embrace, silk bed curtains sweep closed, oil lamp dims).
    • Rituals / trials / battles: use dedicated animated set-piece props (.prop-flame, .prop-wisp, .prop-spark, etc.).
  • Walk & Tween Safety: Clamp walk travel distance by cast size (engine.js enforces maxD) so characters never collide; start kneel-bow after reveal finishes (t0 + 0.75s) when enterAt > 0.

Step 5: Deterministic Build & Fast Zero-Chrome Verification

Run the builder and a single fast Node verification pass:

node scripts/build-series.mjs all

Verify programmatically (takes <2 seconds, 0 Chrome instances, 0 vision tokens):

  1. node --check passes on every build/partXX/{data,engine,backgrounds}.js.
  2. Zero timestamp gaps (|scene[i].start - scene[i-1].end| <= 0.05) and final end === dur.
  3. Every char, bg, crowd, prop, pose, fx, cam, mood ID is valid and enterAt.length === char.length.
  4. Every build/partXX/assets/audio/partXX.m4a exists.

Step 6: 0-Token Offline Sequential Rendering

NEVER render all parts inline inside the AI conversation. Give the user the offline script command:

powershell -ExecutionPolicy Bypass -File scripts\render-all.ps1 -StartPart 1 -EndPart 9 -Concat

render-all.ps1 auto-detects FFmpeg & HyperFrames CLI, renders one part at a time with --low-memory-mode --quality looks (safe for 16 GB RAM laptops), skips already-rendered MP4s for instant resume, writes a UTF-8 without BOM concat.txt, and concatenates via ffmpeg -f concat -safe 0 -i concat.txt -c copy.

Strict Prohibitions & Red Flags

Temptation / RationalizationWhy It FailsRequired Rule
"Spawn 4–10 parallel subagents to finish episodes faster"Burns 5–10x tokens, hits 429 RESOURCE_EXHAUSTED, causes inconsistent styleAuthor all data/partXX.json in the main session in parallel file-write batches
"Write custom HTML/SVG per scene for higher quality"Explodes token count and breaks maintainabilityKeep 1 shared engine.js + reusable prop/staging set-pieces + compact JSON
"Run hyperframes check --snapshots & inspect 3–4 PNGs per scene"Spawns 599 Chrome samples per part and burns 100k+ vision tokensUse node --check + Node JSON validator + user Studio preview on Part 01
"Use mklink /J junctions to share assets/ on Windows"HyperFrames Studio returns 403 Forbidden for paths resolving outside project rootAlways copy real assets/ directory per build/partXX/
"Add rhythmic mouth-flapping lip-sync during talk"Looks distracting and robotic over narrationUse static contextual facial mood + subtle head/hand gestures only
"Render all parts sequentially inside this agent session"Burns tokens polling/waiting and risks shell timeouts or OOMDeliver scripts/render-all.ps1 with --low-memory-mode for 0-token offline rendering
"Cap characters at 2–4 so layout is simpler"Drops named characters mentioned in narration, breaking story accuracySupport unlimited char with automatic wide-row (5–7) and 2-row (8+) layout

관련 스킬