---
name: pop-the-balloon
description: "The viral \"Pop the Balloon\" dating show, starring your brand. A contestant confesses a real pain, balloons pop, and your product is the answer that gets the match."
---

# Balloon-pop ads

Everything below comes from real test runs. Each rule exists because breaking it produced a bad video. Follow them in order; raise a problem instead of improvising around it.

## 0. What makes the real Shorts work (keep all of it)

- **The pop is a public verdict.** One person, one visible pin stab, one loud pop. The viewer gets the reaction before the reason.
- **"Why'd you pop?"** The host asks right after a pop; the popper answers in a few blunt, funny words. The jokes come from the panel, never from the contestant.
- **Rapid Q&A, not a monologue.** Host and panel ask short questions, the contestant answers in a sentence. ~7 exchanges in 40 s.
- **Reveals one at a time**, the worst one last, after a pause. ~1 s of silence between the trigger word and the pop.
- **The last balloon standing** is the suspense; the payoff is "Is it a yes?" → "It's a yes." → "We got a match!" + cheers.
- **Set:** white floor, warm blush-pink wall panels in a thin light-wood grid, soft even light, a host in the middle with a black mic, red latex fragments on the floor after pops.
- **Edit:** zero-context hook (cold open on the most dramatic moment), word-by-word captions, cutting between speaker and listener every 2-4 s, wides only for pops, quick punch-ins on reactions, a bass boom on red flags.
- **Never** pop on looks, body, age, skin tone or gender: pops are about the situation. Never use real memes, show names, logos or watermarks (we imitate the format, never claim to be the show).

## 1. Non-negotiable rules (checklist before every generation)

1. **Model:** Seedance 2.5 (`arcads_generate_video_seedance_25`), `resolution: "1080p"`, `aspectRatio: "9:16"`, `audioEnabled: true`, `nbGenerations: 1`. 2 clips for ~45 s (≤30 s each). 720p only if the user asks for cheap drafts.
2. **References = images only.** Clip 1: the master still. Clip 2: the state still. **No reference video, no extracted frames** (user rule: not useful; it ties clip 2 to a take and caused continuity errors). Both clips are independent → generate them **in parallel**.
3. **Pins:** every panel member holds a small silver pin in the right hand from the first frame. Every pop = the popper stabs **her own** balloon with it, visibly. A balloon never bursts by itself.
4. **Pop order (default for 4 panel members):** confession → **two pops staggered 0.4-0.8 s apart, never on the same frame** → panel member C asks a question, he answers, C pops → D (last holder) asks "so what did you do?", hears the brand, **never pops**. Simultaneous pops made Seedance burst an extra balloon and broke continuity.
5. **Balloon ledger** written before generating, checked after on full-resolution frames (section 6). One mismatch = the clip fails.
6. **Props stay in every shot:** the contestant's mic, the host's mic, the last holder's balloon. Write it in the prompt's CONTINUITY block.
7. **Contestant energy is grounded, never hype.** Relaxed and a bit shy → sheepish confession → frustrated detail → quietly relieved twist → sincere CTA. He never shouts, never sells. (A hyper-excited intro was rejected.)
8. **Talk like a real person.** Contractions, "got about eleven trucks", "two hundred grand", "Uh...". No line anyone would never say out loud, no slogans, no jargon or acronyms ("MCA" was not understood).
9. **The brand is named in the twist** and does something concrete; the CTA is the brand's real next step. Legal / finance / health claims are listed for client validation.
10. **No effect on pops in the edit** (no shake, no punch-in, no extra pop sound): the user found it weird. The native pop on the burst frame is enough.
11. **Never compress twice at normal quality.** Intermediates are near-lossless, one final encode (the embedded script does this). Chained crf-17/18 encodes visibly softened a delivery.
12. One generation per clip, no test renders. Regenerate only for a failed check, and tell the user what failed.

## 2. Step 0 — lock 3 things with the user (one message)

If the user has no idea for one of them, propose 3 short, concrete options and let them pick.

1. **The contestant** = the customer persona with the pain: name, age, job + one size fact ("trucking company, about eleven trucks"), look, one strong outfit colour, voice.
2. **The lineup**: 4 women (or men if the audience is women), each named by one outfit colour (coral, zebra print, green, cobalt…), their order left to right, who pops when, who is the last holder. Plus the host (woman, brown satin dress, black mic by default).
3. **The script**, on the structure in section 3.

**B2B mapping (default when the brand sells to businesses):** contestant = the business owner / decision maker; reveals = business red flags in plain numbers; the last holder keeping her balloon = the market saying yes.

Work folder: `BalloonPop/<Brand>_<slug>/` with a `plan.md` (template in Appendix A). Every asset ID, cost and review verdict goes there.

## 3. Script (~40-45 s, 2 clips)

### Structure
| Clip | Beat | Content |
|---|---|---|
| 1 (~25 s) | Intro | Host: "Alright, introduce yourself." → name, age, job + size, said casually |
| | Red flag | Host: "Okay, business owner! So what's the red flag?" → the pain in plain words, sheepish |
| | Pops 1-2 | 1 s silence → A stabs → 0.5 s later B stabs |
| | Verdict | Host: "Why'd you pop?" → B: one funny blunt line |
| | Round 2 | C asks a follow-up that makes it worse → he answers (the pain's daily consequence) → C reacts ("Every DAY?") → stabs → "...Nope." |
| 2 (~20 s) | Twist | D: "Okay, but... are you still stuck in it?" → he names the brand and what it did, plainly, then the result |
| | Match | D: warm one-liner, lowers her balloon (kept) → Host: "Is it a yes?" → D: "It's a yes." → Host: "We got a MATCH!" + cheers |
| | CTA | Contestant alone, chest-up, to camera, calm: "[the pain, as a question]... take [Brand]'s [real offer]." |

### Writing rules
- ~3 spoken words per second; count 1.5 s for each pop beat. One shot per line, each 1-5 s.
- Each line makes sense on its own; sentences ≤10 words; say results, never mechanisms ("found me options", not "it was written as a purchase of future sales"); max 2-3 simple numbers.
- **Story in one sentence** above the script, and a **stranger test**: from the dialogue alone, a stranger can say what his problem is, who helped, what to do.
- **Brand logic check (write the ✅ lines in plan.md):** the pain is one the brand solves · the reveals escalate · the twist names the brand and what it did · the last holder's question leads into the brand · the CTA is the real offer · no guarantee, superlative or invented result.
- Delivery notes per line (emotion + stressed word in CAPS).

### Reference script (example, approved)
Clip 1: Host "Alright, introduce yourself." · Dave "I'm Dave, thirty-two. I run a trucking company... got about eleven trucks." · Host "Okay, business owner! So what's the red flag?" · Dave "Uh... I'm about two hundred grand in debt." · *coral stabs, zebra stabs 0.5 s later* · Host "Why'd you pop?" · Zebra "I got my own debt. I'm not taking yours." · Green "Debt to who, a bank?" · Dave "Worse. A lender that pulls money out of my account... every single day." · Green "Every DAY?" *stabs* "...Nope."
Clip 2: Cobalt "Okay, but... are you still stuck in it?" · Dave "Nah. I called Brand X. Their lawyers looked at my contract and found me options. Trucks are still running." · Cobalt "Okay... a man with a plan." · Host "Is it a yes?" · Cobalt "It's a yes." · Host "We got a MATCH!" · Dave (to camera) "If a lender's pulling from your account every day... take Brand X's free quiz."

### Balloon ledger (● intact, ○ empty)
| Clip / shot | A (coral) | B (zebra) | C (green) | D (cobalt) | Event |
|---|---|---|---|---|---|
| 1 / before pops | ● | ● | ● | ● | — |
| 1 / pops 1-2 | ○ | ○ | ● | ● | A stabs ~1 s after the trigger word, B 0.5 s later |
| 1 / round 2 end | ○ | ○ | ○ | ● | C stabs after "Every DAY?" |
| 2 / all | ○ | ○ | ○ | ● | none; D keeps hers in every shot |

Show the script, the ledger and the checks; get a yes before any generation.

## 4. Stills (GPT Image, ~free)

**Cast still** — `arcads_generate_image_gpt`, `model: "gpt-image-2"`, `aspectRatio: "9:16"`, 1 image:
```
Vertical photo of a dating-show studio set: white floor, warm blush-pink wall panels in a thin light-wood grid,
soft even studio lighting, camera at chest height, full-body wide shot. In the centre background a host, [look],
in a brown satin midi dress, holds a black handheld microphone. On the left, four women stand in a loose line, each
holding one round red latex balloon at her stomach with both hands: [A look + outfit], [B], [C], [D]. On the right,
facing them in three-quarter profile, [contestant: age, hair, beard, outfit, shoes], holding a black handheld
microphone near his mouth. Ordinary real-looking people of average build, natural skin texture, not models.
Empty white floor. No text, no logos, no watermark.
```
Approve with the user.

**Master still (pins)** — edit of the cast still: `model: "gpt-image-2-6-flare"`, `referenceImages: [cast still]`:
"Same photo, same people, same faces, same outfits, same set, same framing and light. Change only this: each of the four women now holds her round red balloon at her stomach with both hands, and has a small silver pin pinched between the thumb and index finger of her right hand, the pin point turned toward her balloon, clearly visible. Make the balloons a bit bigger, like normal party balloons. Everything else stays exactly the same."

**State still for clip 2** — edit of the master: "Same photo, same people, same faces, same outfits, same framing and light. Change only this: [A], [B] and [C] no longer have balloons: their hands are empty and relaxed in front of them, each still pinching her small silver pin. Small torn red latex balloon fragments lie on the white floor in front of their shoes. [D] still holds her round red balloon at her stomach with her pin. Everything else unchanged."

`arcads_view_frame` each still and check every hand against the ledger before using it. Never give clip 2 the original cast still (wide shots revert to it and popped balloons come back).

## 5. Clips (Seedance 2.5, 1080p, both at once)

Clip 1: `referenceImages: [master still]`, `duration` = script length (25 s for the reference script). Clip 2: `referenceImages: [state still]`, 20 s. Same Audio description for the contestant in both prompts, word for word (that is what keeps his voice).

**Clip 1 prompt (tested, passed every check):**
```
9:16. 25 seconds. Reality dating-show footage, multi-camera edit with hard cuts, each shot on a locked tripod, no
camera moves inside a shot. Set: white floor, warm blush-pink wall panels in a thin light-wood grid, soft even studio
light. @Image1 shows the cast and the starting state. Keep every person and every outfit identical.
Cast: the host, [look], brown satin midi dress, black handheld mic; four women in a line, left to right, each holding
one round red balloon at her stomach with both hands and a small silver pin between the thumb and index of her right
hand: [A], [B], [C], [D]; [contestant], black handheld mic.
STATE AT START: all four women hold an intact red balloon and a pin.
IMPORTANT: in this whole clip exactly THREE balloons pop, one at a time: A's, then B's, then C's. [D] NEVER pops her
balloon: she keeps her pin hand still and holds her round red balloon intact in every shot, to the last frame.
[contestant] holds his black microphone in every shot.

SHOT 1 [0:00-0:02] Medium shot on the host. She says, warm and easy: "<line>"
SHOT 2 [0:02-0:07] Medium shot on <contestant>, relaxed, a bit shy, small smile, calm normal voice: "<intro>"
SHOT 3 [0:07-0:09] Medium shot on the host, playful: "<red-flag question>"
SHOT 4 [0:09-0:12] Medium shot on <contestant>, sheepish half-laugh, rubs the back of his neck, quieter: "<confession>"
SHOT 5 [0:12-0:15] Wide shot on the four women. One second of silence after "<last word>".
[0:13.0] [A] (far left) jabs the pin in her right hand into her own balloon, one quick stab; it bursts the moment the
pin touches it, red fragments fall.
[0:13.6] A beat later, [B] (second from left) does the same: one quick stab, her balloon bursts.
They lower their empty hands. [C] and [D] keep their pin hands still; their two balloons stay round and intact.
SHOT 6 [0:15-0:16] Medium shot on the host, quick: "Why'd you pop?"
SHOT 7 [0:16-0:18] Medium shot on [B], empty hands, deadpan and sassy: "<verdict>"
SHOT 8 [0:18-0:19] Medium shot on [C], still holding her balloon and pin, curious: "<follow-up question>"
SHOT 9 [0:19-0:22] Medium shot on <contestant>, frustrated and tired, shaking his head slightly: "<answer>"
SHOT 10 [0:22-0:25] Medium shot on [C]. First she says, eyes wide, shocked: "<reaction>" Then, one second later, she
jabs her pin into her own balloon, one quick stab, it bursts the moment the pin touches it, red fragments fall. Then,
flat: "...Nope." She lowers her empty hand. At the right edge of the frame [D] still holds her intact red balloon.

Audio: <contestant> = American man in his early thirties, warm mid-low voice, natural, calm, grounded, a regular guy,
a bit shy, dry humour, never loud, never excited, never salesy; small changes in tone: relaxed, then sheepish, then
frustrated. Host = warm, playful American woman. [B] = deadpan, sassy. [C] = curious, then shocked. Studio room tone,
a small audience "ooh" after the pops. Balloon pops: exactly three separate pops: one at 0:13.0 ([A]), one at 0:13.6
([B]), one after "<reaction>" ([C]), each exactly when a pin touches a balloon, nowhere else. No music.
Full dialogue in order: <every line with its speaker>
```

**Clip 2 prompt:**
```
9:16. 20 seconds. Reality dating-show footage, multi-camera edit with hard cuts, each shot on a locked tripod, no
camera moves inside a shot. Only medium shots of one person and a chest-up shot; never a wide shot of the line of
women. Set: <same>. @Image1 shows the cast and the current state. Keep every person, outfit and prop identical.
Cast: <host>; [D] holding her round red balloon with a small silver pin in her right hand; [C], empty hands; <contestant>.
CONTINUITY FOR THE WHOLE CLIP:
- <contestant> holds his black handheld microphone in his right hand, near his chest, in EVERY shot he appears in.
- [D] holds her round red balloon in EVERY shot she appears in; always visible (her shots are framed from mid-thigh
  up). It never pops, never disappears.
- Only one balloon exists. Any other woman at the edge of a frame has empty hands. No balloon pops in this clip.

SHOT 1 [0:00-0:02] Medium shot (mid-thigh up) on [D], balloon at her stomach, curious, leaning in: "<question>"
SHOT 2 [0:02-0:08] Medium shot on <contestant>, holding his mic, quietly relieved, small proud smile: "<brand twist>"
SHOT 3 [0:08-0:10] Medium shot (mid-thigh up) on [D], warm smile: "<one-liner>" She lowers her balloon to her side,
holding it loosely; it stays round, intact and visible.
SHOT 4 [0:10-0:11] Medium shot on the host, delighted, asking: "Is it a yes?"
SHOT 5 [0:11-0:12] Medium shot (mid-thigh up) on [D], balloon still in her hand, nod and smile: "It's a yes."
SHOT 6 [0:12-0:13] Medium shot on the host, loud, arm up: "We got a MATCH!" Audience cheers and claps.
SHOT 7 [0:13-0:20] Chest-up shot of <contestant> alone, holding his mic, against the pink panels, nobody else in
frame, straight into the lens, sincere, calm: "<CTA>" Then he holds eye contact with a small smile and nod, breathing,
until the last frame.
Audio: <contestant: same sentence as clip 1>; quietly relieved on the twist, sincere on the last line. "<Brand>" said
as one word, smoothly. [D] = warm, curious, then a simple confident answer. Host = playful, loud only on "We got a
MATCH!". Studio room tone, cheering and clapping after "MATCH". No music.
Full dialogue in order: <every line with its speaker>
```
Give every line its own shot (two lines in one shot made a panel member echo the host). Leave ~1.5 s after the last CTA word.

Cost and time (2026-11-09): 1080p ≈ 104 credits/s (25 s = 2,600, 20 s = 2,080), ~8-10 min each, both in parallel. 720p ≈ 42 credits/s.

## 6. Review (you, on frames; Gemini only for audio)

1. **Pop count first.** For each pop, `arcads_view_frame` (full resolution, never a contact-sheet cell) on the wide frame ~0.5 s after the burst and after the second burst: name every woman's hands (balloon / empty). A contact-sheet cell once hid a third burst.
2. **Ledger per shot:** `arcads_view_contact_sheet` (count 20-25), then full-res `arcads_view_frame` on any frame where a hand, a balloon or a mic is small or at the edge. Check props too: contestant's mic in every shot, host's mic, the last holder's balloon.
3. **Audio:** `arcads_analyze_media` per clip with the full expected dialogue: every line word for word (no echo, no missing line), number of pops and whose, no pop in clip 2, calm contestant, "quiz"/last word fully said, no freeze. If Gemini reports more pops or balloons than planned, the clip fails until a full-res frame proves otherwise. Gemini also invents things (music, fragments from empty hands): confirm every visual claim on frames.
4. **Pop sync:** download the clip and find the pop peaks in the audio (5 ms envelope, peaks between the stab frames); each burst frame must match its peak.
5. Verdict in plan.md. Regenerate only for: a wrong or extra pop, a balloon or prop that appears/disappears, a missing or changed line, a hype or flat read, a face change. Tell the user what failed and the cost before regenerating. The user may accept a take with a known flaw: note it.

## 7. Edit (embedded script, Appendix B)

1. Download the clips to `BalloonPop/<...>/clips/`. `arcads_transcribe(format: "srt")` on each clip; save as `clip1.srt` / `clip2.srt` and correct the text by hand (brand spelling, "All right" → "Alright", numbers as you want them shown). Keep the timings.
2. Write `edit.json` (format in the script header). Default edit (the one the user liked):
   - segments: clip 1 from 0.2 s to its end, clip 2 from 0 to ~0.7 s after the last CTA word; cut out any echo or dead line by splitting a clip into two segments (hide the cut with a punch-in).
   - `flashforward`: from ~0.25 s before the first pop to ~0.7 s after the second → cold open.
   - `hook_text`: the confession as a question, caps, ≤6 words ("HE'S $200K IN DEBT?!").
   - `captions: "lime"` (one word at a time, Impact caps, lime #A4FF3D, black stroke, centre).
   - `punchins` (×1.12, instant): the confession, the funniest verdict, the last holder's one-liner, "We got a match!".
   - `stings`: `boom` just after the confession's last word and before the round-2 pop, `ding` on the brand's result word ("options").
   - Nothing on the pops.
3. `python3 popedit.py edit.json` → `final.mp4` at clip resolution, ~9 Mb/s at 1080p.
4. Contact sheet of the final; upload it (`arcads_get_upload_url` → `curl -T` → `arcads_register_video`, title `<brand>_balloonpop_final_<res>_v<n>`), `SendUserFile` it, record the ID in plan.md.

## 8. FLUX 3 Max variant (only if the user asks for Flux)

Flux has no reference images and no voice reference. One start frame per clip, each an edit of the master still showing the exact ledger state (and an end frame with the post-pop state for clips with a pop); 5 clips of 6-12 s, all in parallel, ~41 credits/s at 720p. Give each clip 1-2 s more than its speech (it cut last words), write "Only these exact words are spoken". The contestant's voice changes between clips; the user preferred Flux's native voices over a speech-to-speech swap. Same review and edit rules.

## Appendix A — plan.md template

```
# Balloon-pop ad — <Brand> (<length>, <model>, <res>)
Brand / offer / CTA: … · Arcads brand id: … · project id: …
Story in one sentence: …
## Contestant · ## Lineup (A/B/C/D by colour, who pops when) · ## Host
## Balloon ledger (table)
## Script (clip / shot / time / speaker / line / delivery)
## Checks: brand logic ✅×6 · stranger test · claims to validate
## Assets: cast still · master still · state still · clip 1 · clip 2 · final (IDs, credits)
## Review log: per clip, ledger per shot, pops (frame + audio peak), lines, verdict
```

## Appendix B — popedit.py (write it to the work folder and run it)

```python
#!/usr/bin/env python3
"""Balloon-pop ad edit: join clip segments, cold open, hook text, lime word captions, reaction punch-ins, stings.

python3 popedit.py edit.json      (all paths relative to edit.json)

{
  "size": [1080, 1920],
  "out": "final.mp4",
  "segments": [
    {"file": "clips/clip1.mp4", "in": 0.2, "out": 25.08, "srt": "clips/clip1.srt"},
    {"file": "clips/clip2.mp4", "in": 0.0, "out": 19.4,  "srt": "clips/clip2.srt"}
  ],
  "flashforward": {"seg": 0, "in": 12.75, "out": 14.2},
  "hook_text": "HE'S $200K IN DEBT?!",
  "punchins": [{"seg": 0, "in": 9.7, "out": 12.0, "scale": 1.12}],
  "stings": [{"seg": 0, "t": 11.9, "sfx": "boom"}, {"seg": 1, "t": 6.5, "sfx": "ding"}],
  "captions": "lime"
}
All times are in the SOURCE clip of the given segment. SRT = arcads_transcribe(format "srt"), text corrected by hand.
SFX: boom, ding, whoosh, pop are synthesised; any other name needs sfx/<name>.wav next to edit.json.
No effect is ever added on balloon pops (user rule).
"""
import json, os, re, subprocess, sys, tempfile

def ffmpeg_bin():
    if os.environ.get("FFMPEG"):
        return os.environ["FFMPEG"]
    try:
        import imageio_ffmpeg
        return imageio_ffmpeg.get_ffmpeg_exe()
    except Exception:
        return "ffmpeg"

FF = ffmpeg_bin()
SYNTH = {
    "pop": "anoisesrc=d=0.14:c=white:a=1,highpass=f=900,afade=t=out:st=0.01:d=0.13,volume=3.5",
    "boom": "aevalsrc='0.9*sin(2*PI*(70-40*t)*t)*exp(-2.5*t)':d=1.4",
    "ding": "aevalsrc='0.5*sin(2*PI*1760*t)*exp(-4*t)+0.25*sin(2*PI*2640*t)*exp(-5*t)':d=1.0",
    "whoosh": "anoisesrc=d=0.45:c=pink:a=0.8,bandpass=f=1800:width_type=o:w=2,afade=t=in:d=0.3,afade=t=out:st=0.3:d=0.15",
}

def run(cmd):
    r = subprocess.run(cmd, capture_output=True, text=True)
    if r.returncode:
        sys.exit(r.stderr[-3000:])

def srt_cues(path):
    def sec(x):
        h, m, s = x.strip().replace(",", ".").split(":")
        return int(h) * 3600 + int(m) * 60 + float(s)
    cues = []
    for block in re.split(r"\n\s*\n", open(path).read().strip()):
        lines = [l for l in block.splitlines() if l.strip()]
        k = next((i for i, l in enumerate(lines) if "-->" in l), None)
        if k is not None:
            a, b = lines[k].split("-->")
            cues.append((sec(a), sec(b), " ".join(lines[k + 1:])))
    return cues

def words_from_cues(cues):
    out = []
    for a, b, text in cues:
        ws = text.split(); total = sum(len(w) + 1 for w in ws) or 1; t = a
        for w in ws:
            d = (b - a) * (len(w) + 1) / total
            out.append((t, t + d, w)); t += d
    return out

def ass_time(t):
    t = max(t, 0)
    return "%d:%02d:%05.2f" % (t // 3600, (t % 3600) // 60, t % 60)

def main():
    cfg_path = os.path.abspath(sys.argv[1]); base = os.path.dirname(cfg_path)
    P = lambda p: p if os.path.isabs(p) else os.path.join(base, p)
    cfg = json.load(open(cfg_path))
    W, H = cfg.get("size", [1080, 1920])
    tmp = tempfile.mkdtemp()
    segs = cfg["segments"]

    # 1. cut each segment (near-lossless), collect captions, compute segment offsets
    offsets, parts, words, t0 = [], [], [], 0.0
    for i, s in enumerate(segs):
        a, b = s["in"], s["out"]
        part = os.path.join(tmp, f"seg{i}.mp4")
        run([FF, "-y", "-ss", str(a), "-to", str(b), "-i", P(s["file"]),
             "-vf", f"scale={W}:{H}:flags=lanczos,fps=24", "-af", "aformat=sample_rates=48000:channel_layouts=stereo",
             "-c:v", "libx264", "-crf", "8", "-preset", "slow", "-pix_fmt", "yuv420p", "-c:a", "aac", "-b:a", "256k", part])
        if s.get("srt"):
            for ws, we, w in words_from_cues(srt_cues(P(s["srt"]))):
                if we > a and ws < b:
                    words.append((max(ws, a) - a + t0, min(we, b) - a + t0, w))
        offsets.append((a, t0)); parts.append(part); t0 += b - a
    T = lambda seg, t: offsets[seg][1] + t - offsets[seg][0]

    # 2. join; cold open = a window of the body placed first
    lst = os.path.join(tmp, "list.txt")
    open(lst, "w").write("".join(f"file '{p}'\n" for p in parts))
    body = os.path.join(tmp, "body.mp4")
    run([FF, "-y", "-f", "concat", "-safe", "0", "-i", lst, "-c", "copy", body])
    ff = cfg.get("flashforward")
    work, shift = body, 0.0
    if ff:
        fa, fb = T(ff["seg"], ff["in"]), T(ff["seg"], ff["out"]); shift = fb - fa
        work = os.path.join(tmp, "work.mp4")
        fc = (f"[0:v]trim={fa}:{fb},setpts=PTS-STARTPTS[v0];[0:a]atrim={fa}:{fb},asetpts=PTS-STARTPTS[a0];"
              f"[0:v]setpts=PTS-STARTPTS[v1];[0:a]asetpts=PTS-STARTPTS[a1];[v0][a0][v1][a1]concat=n=2:v=1:a=1[v][a]")
        run([FF, "-y", "-i", body, "-filter_complex", fc, "-map", "[v]", "-map", "[a]",
             "-c:v", "libx264", "-crf", "8", "-preset", "slow", "-c:a", "aac", "-b:a", "256k", work])
    total = t0 + shift

    # 3. captions + hook (ASS at 720x1280, libass scales to the video)
    ev = []
    if cfg.get("captions", "lime") == "lime":
        for i, (s, e, w) in enumerate(words):
            if i + 1 < len(words) and words[i + 1][0] - e < 0.4:
                e = words[i + 1][0]
            txt = w.upper().strip(",.!?\"")
            ev.append(f"Dialogue: 1,{ass_time(s + shift)},{ass_time(e + shift)},Lime,,0,0,0,,{{\\fscx115\\fscy115\\t(0,80,\\fscx100\\fscy100)}}{txt}")
    if cfg.get("hook_text"):
        hook = "".join(c for c in cfg["hook_text"] if ord(c) < 0x2000).strip()
        ev.append(f"Dialogue: 2,{ass_time(0)},{ass_time(3.0)},Hook,,0,0,0,,{hook}")
    ass = os.path.join(tmp, "caps.ass")
    open(ass, "w").write("""[Script Info]
ScriptType: v4.00+
PlayResX: 720
PlayResY: 1280

[V4+ Styles]
Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, Encoding
Style: Lime,Impact,86,&H003DFFA4,&H00FFFFFF,&H00000000,&H64000000,0,0,0,0,100,100,1,0,1,6,2,5,40,40,0,1
Style: Hook,Arial Black,40,&H00000000,&H00FFFFFF,&H00FFFFFF,&H00FFFFFF,0,0,0,0,100,100,0,0,3,14,0,8,60,60,110,1

[Events]
Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text
""" + "\n".join(ev) + "\n")

    # 4. punch-ins (instant zoom), white flash on the cold-open cut
    z = "1"
    for p in cfg.get("punchins", []):
        s, e = T(p["seg"], p["in"]) + shift, T(p["seg"], p["out"]) + shift
        z = f"if(between(t,{s:.3f},{e:.3f}),{p.get('scale', 1.12)},{z})"
    vf = f"scale=w='trunc({W}*{z}/2)*2':h='trunc({H}*{z}/2)*2':eval=frame:flags=lanczos,crop={W}:{H}"
    if ff:
        vf += f",drawbox=x=0:y=0:w={W}:h={H}:color=white@0.85:t=fill:enable='between(t,{shift - 0.06:.3f},{shift + 0.08:.3f})'"
    vf += f",ass='{ass}'"

    # 5. stings
    stings = [(T(s["seg"], s["t"]) + shift, s["sfx"]) for s in cfg.get("stings", [])]
    if ff:
        stings.append((max(shift - 0.25, 0), "whoosh"))
    inputs, labels, fc, n = ["-i", work], [], [f"[0:v]{vf}[v]"], 1
    for t, name in stings:
        f = os.path.join(base, "sfx", name + ".wav")
        if os.path.exists(f):
            inputs += ["-i", f]
        elif name in SYNTH:
            inputs += ["-f", "lavfi", "-i", SYNTH[name]]
        else:
            print(f"skip sfx '{name}': add {f}"); continue
        d = int(t * 1000)
        fc.append(f"[{n}:a]aformat=sample_rates=48000:channel_layouts=stereo,adelay={d}|{d}[s{n}]")
        labels.append(f"[s{n}]"); n += 1
    fc.append("[0:a]aformat=sample_rates=48000:channel_layouts=stereo[a0]")
    fc.append(f"[a0]{''.join(labels)}amix=inputs={len(labels) + 1}:normalize=0:duration=first,alimiter=limit=0.95[a]")
    out = P(cfg["out"])
    run([FF, "-y", *inputs, "-filter_complex", ";".join(fc), "-map", "[v]", "-map", "[a]", "-t", f"{total:.3f}",
         "-c:v", "libx264", "-crf", "14", "-preset", "slow", "-tune", "film", "-pix_fmt", "yuv420p",
         "-c:a", "aac", "-b:a", "192k", "-movflags", "+faststart", out])
    print("wrote", out, f"({total:.1f}s)")

if __name__ == "__main__":
    main()
```
Needs ffmpeg with libass (the `imageio-ffmpeg` binary has it: `python3 -m pip install --user imageio-ffmpeg`), and the Impact / Arial Black fonts (macOS has both).
