85453da49f
regression / regression-shards (style-16-prod style-9-prod style-17-prod iframe-render-compat variables-prod mp4-h265-sdr, shard-4) (push) Has been cancelled
regression / regression-shards (style-4-prod style-11-prod style-2-prod animejs-adapter typegpu-adapter parallel-capture-regression, shard-5) (push) Has been cancelled
regression / regression-shards (style-7-prod style-8-prod style-10-prod css-spinner-render-compat webm-transparency mp4-h264-sdr webm-vp9, shard-3) (push) Has been cancelled
regression / regression-shards (sub-composition-video style-18-prod raf-ball-render-compat font-variant-numeric sub-comp-t0 sub-comp-id-selector, shard-7) (push) Has been cancelled
Windows render verification / Detect changes (push) Has been cancelled
Windows render verification / Preflight (lint + format) (push) Has been cancelled
Windows render verification / Render on windows-latest (push) Has been cancelled
Windows render verification / Tests on windows-latest (push) Has been cancelled
CI / Detect changes (push) Has been cancelled
CI / Build (push) Has been cancelled
CI / Lint (push) Has been cancelled
CI / Fallow audit (push) Has been cancelled
CI / Format (push) Has been cancelled
CI / Typecheck (push) Has been cancelled
CI / Test (push) Has been cancelled
CI / Producer: integration tests (push) Has been cancelled
CI / Producer: unit tests (push) Has been cancelled
CI / File size check (push) Has been cancelled
CI / Test: skills (push) Has been cancelled
CI / Skills: manifest in sync (push) Has been cancelled
CI / CLI: npx shim (macos-latest) (push) Has been cancelled
CI / CLI: npx shim (ubuntu-latest) (push) Has been cancelled
CI / CLI: npx shim (windows-latest) (push) Has been cancelled
CI / SDK: unit + contract + smoke (push) Has been cancelled
CI / Test: runtime contract (push) Has been cancelled
CI / Studio: load smoke (push) Has been cancelled
CI / Smoke: global install (push) Has been cancelled
CI / CLI smoke (required) (push) Has been cancelled
CI / Semantic PR title (push) Has been cancelled
Player perf / Detect changes (push) Has been cancelled
Player perf / Preflight (lint + format) (push) Has been cancelled
Player perf / player-perf (push) Has been cancelled
Player perf / Perf: drift (push) Has been cancelled
Player perf / Perf: fps (push) Has been cancelled
Player perf / Perf: parity (push) Has been cancelled
Player perf / Perf: scrub (push) Has been cancelled
Player perf / Perf: load (push) Has been cancelled
preview-regression / Detect changes (push) Has been cancelled
preview-regression / Preflight (lint + format) (push) Has been cancelled
preview-regression / Preview parity (push) Has been cancelled
preview-regression / preview-regression (push) Has been cancelled
regression / regression (push) Has been cancelled
regression / Detect changes (push) Has been cancelled
regression / Preflight (lint + format) (push) Has been cancelled
regression / regression-shards (hdr-regression style-5-prod style-3-prod mov-prores, shard-1) (push) Has been cancelled
regression / regression-shards (overlay-montage-prod style-12-prod chat missing-host-comp-id png-sequence portrait-edge-bleed, shard-6) (push) Has been cancelled
regression / regression-shards (style-13-prod style-6-prod vignelli-stacking gsap-letters-render-compat audio-mux-parity, shard-8) (push) Has been cancelled
regression / regression-shards (style-15-prod hdr-hlg-regression style-1-prod many-cuts vfr-screen-recording render-symlinked-assets, shard-2) (push) Has been cancelled
CodeQL / Analyze (actions) (push) Has been cancelled
CodeQL / Analyze (javascript-typescript) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
Docs / Validate docs (push) Has been cancelled
Sync skills to ClawHub / Publish changed skills (push) Has been cancelled
131 lines
4.2 KiB
Markdown
131 lines
4.2 KiB
Markdown
# Caption Grouping
|
|
|
|
How to turn the Whisper word-level transcript into the `groups[]` array of plan.json.
|
|
|
|
## Goal
|
|
|
|
**Each group is one visual phrase**: enters, reveals word-by-word, exits. Rule of thumb: 1 group ≈ 1 comma-to-comma clause or 1 breath of speech.
|
|
|
|
## Input
|
|
|
|
`transcript.json` from `transcribe.cjs`:
|
|
|
|
```json
|
|
{
|
|
"words": [
|
|
{ "text": "Some", "start": 0.24, "end": 0.44, "type": "word" },
|
|
{ "text": " ", "start": 0.44, "end": 0.48, "type": "spacing" },
|
|
{ "text": "memories", "start": 0.48, "end": 0.82, "type": "word" }
|
|
]
|
|
}
|
|
```
|
|
|
|
Drop `type: "spacing"` entries; you only need words.
|
|
|
|
## Break boundaries
|
|
|
|
Cut a new group at ANY of:
|
|
|
|
1. **Pause ≥ 500ms** (gap between word.end[i] and word.start[i+1]) — speaker took a breath.
|
|
2. **Sentence terminator** — word ends with `.`, `?`, `!`, or an em-dash-like pause.
|
|
3. **Strong comma** — `,` followed by pause ≥ 250ms.
|
|
4. **Discourse reset** — words like "but", "so", "and then", "you know" starting a clause often merit their own or new group.
|
|
5. **Group reaches 6 words OR 2.5 seconds** — whichever first. Long groups feel like subtitles, not embedded typography.
|
|
|
|
Hard constraints:
|
|
|
|
- Minimum 2 words per group (1-word exceptions: interjections like "Wait." or the crown line).
|
|
- Minimum 0.5s on screen. If a group is less, merge into neighbor.
|
|
- No overlapping groups — at most one visible at a time.
|
|
|
|
## Timing the group
|
|
|
|
For a group with words `w[0]..w[n-1]`:
|
|
|
|
- `in` = `w[0].start - 0.08` (enter slightly before first word)
|
|
- `out` = `min(next_group.in - 0.05, w[n-1].end + 0.6)` (linger ~0.6s after last word, but don't collide with next)
|
|
|
|
The last group extends to the video end if needed.
|
|
|
|
## Style & tone (cross-reference)
|
|
|
|
See `typography-presets.md` for how to pick `style` and `tone` per group. Work left-to-right through the groups and:
|
|
|
|
1. First group: default `intro` + `soft`.
|
|
2. Watch for emphasis signals (ALL CAPS in transcript is rare but possible; more often it's semantic — superlatives, proper nouns).
|
|
3. Escalate tone into `present` once the monologue shifts from setup to statement.
|
|
4. Reserve `crown` for at most ONE group, typically the final line.
|
|
|
|
## Editorial surgery is allowed
|
|
|
|
You do NOT have to caption every word. It's fine to:
|
|
|
|
- **Drop filler** like extra "you know"s, "um"s, "I mean"s if they bloat the visual pace.
|
|
- **Condense** a 6-word run into 4 by cutting function words, as long as the meaning and timing remain truthful.
|
|
- **Skip the whole thing** during obvious silence or non-speech (laugh, music interlude).
|
|
|
|
Editorial rule: you are writing typography to support the speech, not a court transcript. Keep meaning, trim noise.
|
|
|
|
## Example (champion)
|
|
|
|
Transcript: "You know, for me I've had this kind of upbringing, had the great foundation and, you know, I've achieved incredible things. I was dreaming of becoming number one in the world and becoming a Wimbledon champion"
|
|
|
|
Groups after editorial pass:
|
|
|
|
```json
|
|
[
|
|
{
|
|
"id": "cg-0",
|
|
"style": "intro",
|
|
"tone": "soft",
|
|
"words": ["You", "know", "for", "me"],
|
|
"in": 0.1,
|
|
"out": 1.45
|
|
},
|
|
{
|
|
"id": "cg-1",
|
|
"style": "phrase",
|
|
"tone": "soft",
|
|
"words": ["I've", "had", "this", "kind", "of", "upbringing"],
|
|
"in": 1.4,
|
|
"out": 3.35
|
|
},
|
|
{
|
|
"id": "cg-2",
|
|
"style": "phrase",
|
|
"tone": "soft",
|
|
"words": ["the", "great", "foundation"],
|
|
"in": 3.5,
|
|
"out": 5.35
|
|
},
|
|
{
|
|
"id": "cg-3",
|
|
"style": "emph",
|
|
"tone": "present",
|
|
"words": ["I've", "achieved", "incredible", "things"],
|
|
"in": 6.05,
|
|
"out": 8.3
|
|
},
|
|
{
|
|
"id": "cg-4",
|
|
"style": "dream",
|
|
"tone": "present",
|
|
"words": ["dreaming", "of", "becoming", "number", "one"],
|
|
"in": 8.5,
|
|
"out": 10.4
|
|
}
|
|
]
|
|
```
|
|
|
|
Plus the crown:
|
|
|
|
```json
|
|
{ "id": "cg-crown", "style": "crown", "words": ["Wimbledon", "Champion"], "in": 10.8, "out": 12.08 }
|
|
```
|
|
|
|
Notice "had" was dropped from cg-2 ("had the great foundation" → "the great foundation"), "I was" was dropped from cg-4, and "a" was dropped from crown — all for visual cadence.
|
|
|
|
## word.start/end inside groups
|
|
|
|
Pass through the original timestamps from the transcript. Don't retime individual words — only the group `in`/`out`. The word-level karaoke reveal inside each group uses the original w.start.
|