Skip to content

Commit 41d0a6d

Browse files
committed
fix(talking-head): preserve source audio
1 parent 3b081a4 commit 41d0a6d

3 files changed

Lines changed: 27 additions & 2 deletions

File tree

skills-manifest.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@
7474
"files": 2
7575
},
7676
"talking-head-recut": {
77-
"hash": "d5c51342625c9952",
78-
"files": 27
77+
"hash": "1c7d859d214f78ea",
78+
"files": 28
7979
},
8080
"website-to-video": {
8181
"hash": "e8143700c50b7469",

skills/talking-head-recut/SKILL.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -936,6 +936,15 @@ ffmpeg -y -i "$VIDEO_PATH" -c:v libx264 -crf 18 -g 30 -keyint_min 30 \
936936
data-track-index="1"
937937
></video>
938938
</div>
939+
<!-- Preserve the source program audio while the visual video stays muted. -->
940+
<audio
941+
id="source-audio"
942+
src="input-video.mp4"
943+
data-start="0"
944+
data-duration="121.2"
945+
data-track-index="10"
946+
data-volume="1"
947+
></audio>
939948

940949
<!-- Layer 2: each card-host sits at the bounds dictated by its layout. -->
941950
<!-- IMPORTANT: every card-host MUST carry BOTH "card-host" and "clip" classes. -->
@@ -1162,6 +1171,9 @@ PRODUCER_BROWSER_GPU_MODE=hardware npx hyperframes render public \
11621171
```
11631172

11641173
`hyperframes render <dir>` reads `<dir>/index.html` and produces the MP4.
1174+
The canonical composition keeps the visual `<video>` muted and mounts the same
1175+
source as the root `#source-audio` track, so the rendered MP4 preserves the
1176+
talking-head audio without a manual remux.
11651177
The flag `PRODUCER_BROWSER_GPU_MODE=hardware` (or `--browser-gpu`) is
11661178
strongly recommended on macOS — software-only Chrome rendering times out
11671179
on most laptops.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import assert from "node:assert/strict";
2+
import { readFileSync } from "node:fs";
3+
import test from "node:test";
4+
5+
const skill = readFileSync(new URL("./SKILL.md", import.meta.url), "utf8");
6+
7+
test("canonical composition preserves source audio as a root media track", () => {
8+
assert.match(skill, /<video[\s\S]*?id="bg-video"[\s\S]*?muted[\s\S]*?<\/video>/);
9+
assert.match(
10+
skill,
11+
/<\/div>\s*<!-- Preserve the source program audio[\s\S]*?<audio[\s\S]*?id="source-audio"[\s\S]*?src="input-video\.mp4"[\s\S]*?data-track-index="10"[\s\S]*?<\/audio>/,
12+
);
13+
});

0 commit comments

Comments
 (0)