---
name: jump-cut-ugc-ad
description: "The TikTok ad format that converts: a creator talks fast to camera, jump-cutting to a new angle every sentence, with B-roll cutaways, a split screen, whip-pan transitions, green word-by-word captions and a bold hook header. Pick your actor from a casting sheet, approve the script, get one finished ad."
---

# Jump-cut B-roll UGC Ad

Goal: ONE finished 9:16 ad in the style of the TopFunding reference (Nov 2026): a creator talks straight to camera in ONE location chosen by Claude to fit the brand, jump-cutting to a new camera angle or framing of that same place every 3–6 s, with B-roll cutaways and split screens while the voice keeps running, word-by-word green captions and a two-line hook header. No disclaimer, ever. Deliver exactly ONE final video.

**Flow (strictly in this order):**
1. Brand / product + offer.
2. ONE casting image of 10 numbered actors (5 women, 5 men, in line with the brand's audience), generated right away without asking anything → the user picks a number, or describes the actor they want instead (→ a new casting image of 10 matching that description) → Claude makes that actor's sheet (no second approval).
3. Script: Claude always writes one that sells the product or service and fits ONE 30 s Seedance take (no extend), shows it and asks for approval; the client can approve it, ask for changes, or paste their own script. No B-roll or location approval afterwards.
4. Plan + credits → one "Go?" (the only approval of the whole video).
5. Everything runs automatically in the same turn: Seedance clip 1, extends, B-rolls (Omni Flash 1.2), edit. No approval between clips. Only the final video is sent.

All generation runs through the Arcads MCP. Load schemas with ToolSearch first: `arcads_create_project`, `arcads_list_brands`, `arcads_create_brand`, `arcads_generate_image_gpt`, `arcads_generate_video_seedance_25`, `arcads_extend_video`, `arcads_generate_video_omni_flash`, `arcads_get_asset`, `arcads_get_credits`, `arcads_get_upload_url`, `arcads_transcribe`. Edit runs locally (ffmpeg + PIL) in the cloud workspace with the two locked scripts below. Download files from `downloadUrl` of `arcads_get_asset`.

## Reference anatomy (what every video reproduces)

| Element | Spec (measured on the reference, 720×1280) |
|---|---|
| Actor | One person, same outfit and hair everywhere, handheld front-camera selfie at arm's length, eye level, head and chest. Energetic, fast (~2.9 words/s) |
| Location and angles | The reference changes place every sentence; this skill keeps ONE location for the whole video (chosen by Claude, never asked) and changes the camera angle or framing at every sentence instead: each actor shot 3–6 s, hard jump cuts |
| Hook header | First sentence only: line 1 black text on yellow `#FEE400`, line 2 white text on red `#FF0000`, uppercase, top at 0.083 H |
| Captions | 2–3 words per card, uppercase, white text with black stroke on green `#00FE02` box, centred at 0.696 H, on the whole video (B-rolls included) |
| Split screen | Actor (top half, whole face always visible while she talks) over B-roll (bottom half), on a problem line, 2.5–3.5 s |
| Full B-roll | Voice continues: product on a phone (hands filling a form), result/proof screen, payoff visual (cash at an ATM), 2.5–5 s each |
| Transitions | Whip pan on every cut into or out of a B-roll or split: the new shot slides in over ~0.17 s (4 frames at 24 fps) with strong directional motion blur, then lands with a zoom punch (107 % easing to 100 % over 0.35 s). Directions: actor → B-roll and B-roll → B-roll slide left, B-roll → actor slides right, into a split slides up, out of a split slides down. Actor → actor (angle change): hard jump cut, no effect. No dissolves, no fades |
| Audio | Actor voice only |

## 1. Intake (one question per message, AskUserQuestion when there are options)

1. **Brand:** "Which brand and product, and what's the offer? (URL or a few lines)". Find it with `arcads_list_brands` or create it (`arcads_create_brand`); reuse its `productId` everywhere. Create this chat's project once (`arcads_create_project`, "[Brand] – Jump-cut UGC [actor]") and pass `projectId` to every call. If the URL is given, read the site for facts (offer, numbers, product flow) — never invent numbers.
2. **Casting (never ask for the actor type first):** generate the casting image right after the brand (section 2a), then ask in one line: "Pick a number, or describe the actor you want."
3. A number → actor sheet (section 2b). A description → one new casting image of 10 actors matching it (`_v2`), then the same one-line question.
4. **Script (always proposed by Claude, never asked first):** don't ask whether the client wants a script or has one; write it straight away: a script that sells the product or service and fits one 30 s take (section 3), from the brand's site and offer. **The client must SEE the full script before deciding:** text written between tool calls is not shown verbatim and the question dialog can hide the chat, so (1) send the full script with `SendUserMessage` (load it with ToolSearch if needed) as its numbered sentences + word count + estimated length, and (2) repeat the full script inside the AskUserQuestion `question` text itself: "Here is the script (N words, ~X s): « …full script… » Use this script?" — **Approve (Recommended)** / **Change something** (the client says what; rewrite, show it again the same way) / **Use my own script** (the client pastes it). Never ask for approval of a script the client hasn't been shown. English only (Seedance 2.5 mispronounces other languages; for non-English, say so and point to `ugc-talking-actor`). Once the script is approved or pasted, never ask to approve the B-rolls, the location or the shot list; go straight to the plan (section 6).

Never ask for the location (Claude picks it, section 4) or for product screenshots (proof B-rolls are generic unless the user already shared screenshots in the chat).

Format is always 9:16. Music: none by default (reference is voice only); offer it once at delivery.

## 2. Casting image (10 actors, user picks one) → actor sheet

**a. Casting image.** ONE `arcads_generate_image_gpt` call, `model: "gpt-image-2-6-sunburst"`, `aspectRatio: "16:9"`, `nbGenerations: 1`, title `[brand]_jumpcut_[actor]_casting_v1`. First image: 5 women (tiles 1–5, top row) and 5 men (tiles 6–10, bottom row), all in line with the brand's audience, i.e. people its buyers would see as one of them (Claude picks the age range and vibe from the brand, e.g. 35–60 small-business owners for a business-finance brand), differing in age within that range, face, ethnicity, hair, build and simple outfit. After a user description: 10 actors all matching it, differing in face, ethnicity, hair, build and outfit.

> Casting contact sheet of 10 different real American people, [first image: top row 5 women, bottom row 5 men, aged [age range], [vibe from the brand's audience] | after a description: the user's description], arranged in a grid of 2 rows of 5 equal tiles with thin white gutters. Each tile is an unretouched head-and-chest photo of one person looking straight into the lens on a plain light-grey background, each wearing one simple everyday top (all different colours). Under each photo, a white label strip with one large bold black number, 1 to 10, left to right then top to bottom. Every person clearly different in face, hair and build. Real people, not models: visible pores, fine lines, flyaway hairs, natural or no makeup, no beauty filter. Soft natural daylight, phone-photo sharpness. No other text.

Show it, then ask in one line: "Pick a number, or describe the actor you want." A description → a new casting image matching it (`_v2`, `_v3`…), same question. Never rate the actors yourself. The chosen actor's gender sets the pronouns in every prompt (she/her or he/his).

**b. Actor sheet of the chosen number (no approval).** Download the casting image, crop the chosen tile (grid of 5 columns × 2 rows; drop the white label strip at the bottom of the tile and the gutters), upload it with `arcads_get_upload_url`, then one `arcads_generate_image_gpt` (`gpt-image-2-6-sunburst`, `16:9`, `referenceImages: [crop]`, title `[brand]_jumpcut_[actor]_actorsheet_v1`) with the sheet prompt below, starting "The same person as the reference image, identical face, hair and build:" and keeping the tile's top as the outfit. Don't show it for approval: it is the reference for every video prompt. The outfit is part of the sheet because the same clothes must appear in every shot.

> Actor reference sheet of one real [age]-year-old American [woman/man], [look: hair, build, face], wearing [one simple everyday outfit, e.g. a plain black tank top], no jewellery except [optional]. Three unretouched photos side by side on a plain light-grey background, same person and same clothes in all three: 1) face close-up looking straight into the lens, 2) three-quarter view head and shoulders, 3) waist-up front view showing the outfit. A real person, not a model: visible pores, fine lines, slight under-eye shadows, flyaway hairs, natural makeup or none, no beauty filter, no retouching. Soft natural daylight, true colours, phone-photo sharpness with slight noise. No scenery, no text, no labels.

Keep the sheet's asset id and its exact description (reused word for word in every prompt).

## 3. Script (Claude always proposes one, single 30 s take)

Every run, Claude writes a script built to sell: the brand's strongest real benefit and offer (from its site or the user), a hook that stops the scroll, concrete numbers when the brand publishes them, and a clear CTA. **It must fit ONE Seedance 2.5 take of ≤ 30 s, so no extend is needed: 70–80 spoken words max** (≤ 28.5 s of speech at 2.9 words/s + 1.5 s ending). Count the spoken words (numbers written out) before showing it; over 80 → cut, never extend. It is shown for approval; the client can always replace it with their own (a pasted script longer than 30 s still works, with Seedance extends, section 5).

Reference structure, compressed to 70–80 words: keep the beats in this order but merge or drop to fit (always keep 1, 2, 4, 6 and 8; 3, 5, 7 and 9 are optional, one short line each). First person, spoken, fast, no ad vocabulary:
1. **Hook question** (≤ 12 words) — becomes the header: "Why aren't more [audience] using [solution]?"
2. **Agitate:** "Instead, they get stuck [bad default] when all they really need is [benefit]. Because [problem] doesn't [happen on schedule]."
3. **Reframe:** "That's why [solution] makes way more sense."
4. **Offer facts** (real numbers only): "You can get [amount] in as fast as [time] and [flexibility]."
5. **Best part:** "The best part, [key benefit]."
6. **Personal proof:** "I [did it] myself through this little-known platform. I answered a few questions and then boom, [result + number + time]."
7. **Use cases:** "So now, if I need to [3–4 concrete uses], I've got [benefit] ready to go."
8. **CTA:** "Click the link below to [action] now."
9. **Kicker:** "Your future self will thank you."

Rules (Claude-written or pasted):
- Two versions of the script: **spoken** (in the Seedance prompt: numbers, brand names, URLs written as said — "two million dollars", "twenty-four hours") and **display** (captions/header: "$2,000,000", "24 HOURS"). A pasted script keeps its wording; only propose the spoken spelling and punctuation cleanup in one line.
- No colons, ellipses, dashes or parentheses in the spoken version.
- Don't name competitors; claims must come from the brand's site or the user.

## 4. Edit plan (decided by the skill, shown in the plan)

Split the spoken script into **sentences**; each sentence gets a time window (words ÷ 2.9 s) and one shot type:

| Type | When | Rules |
|---|---|---|
| **ACTOR** | Hook, reframe, offer facts, best part, use cases, CTA, kicker | Each actor sentence from a NEW angle or framing of the same location (never the same angle twice in a row). Hook = first angle, with the header. CTA: she points down |
| **SPLIT** | The agitate/problem line (1 per video) | Actor top half with her whole face visible (face-tracked crop, never cut at the mouth or chin), problem B-roll bottom half (e.g. people queuing at a bank counter) |
| **BROLL** | Personal proof (product on a phone, then the result screen) and the payoff of the use-cases line (e.g. cash coming out of an ATM) | Full screen, voice continues, 2.5–5 s; 2–3 per 30 s video |

- Coverage: B-roll + split ≈ 30–40 % of the runtime. Never a B-roll on the hook's first 3 s or on the CTA/kicker.
- Seedance still generates the actor talking under every B-roll window (one continuous voice track); angle changes inside a B-roll window are hidden by it.
- **One location for the whole video, chosen by Claude (never asked), in line with the brand and the actor:** e.g. a finance/business brand → her home office or her open-plan kitchen-living room; beauty → bathroom/bedroom; food → kitchen. Describe it once with 4–6 concrete objects and one light source, and repeat that description word for word in every shot and every extend.
- **Angles (one per ACTOR sentence, 4–7 per 30 s video), all handheld selfie, never a visible phone:** pick from: standing close, eye level, centred; slightly wider, a step back, more of the room behind her; leaning on the counter/desk, slightly from below; sitting (chair, sofa arm, stool), framing a bit lower; turned 30–45° so a different wall or window is behind her; walking two steps through the room, frame bobbing; tight close-up on her face for the key line. Each angle names what is behind her in that direction (window, shelves, door, plant…) so the jump is visible. Never the same angle twice in a row.

B-roll prompts (Omni Flash 1.2, `arcads_generate_video_omni_flash`: more consistent B-rolls than MiniMax H3, chosen by the user Nov 2026), always end with: "Realistic handheld iPhone footage, natural light, slight shake, documentary UGC look, no one looking at the camera, faces not in close-up. No music, no voices." plus "no text, no logos" on problem/payoff B-rolls only (never on phone-screen B-rolls). Hands and people from behind only (no second face to compare with the actor).
- **Problem / payoff B-roll:** text-to-video, e.g. "People waiting in line at a bank teller counter, seen from behind…", "A hand taking a stack of hundred-dollar bills from an ATM slot, close-up…".
- **Product / proof B-roll (on a phone):** text-to-video too, straight in `arcads_generate_video_omni_flash`: never generate a start-frame image or reference image first. The screen must show real, legible UI text (a blank generic screen looks fake; Top Fundings test, Nov 2026). Write the screen out in full in the prompt:
  - The phone screen fills most of the frame, sharp and in focus.
  - A brand-coloured top bar with the brand name in quotes (e.g. a blue top bar reading "Top Fundings" in white).
  - Every on-screen word in quotes, short (1–4 words per element): a form question + 4 answer buttons, or a results headline + 3–4 card badges and a button label.
  - One clear action: her thumb taps a named button, the screen reacts (button turns blue with a check, slides to the next question, list scrolls).
  - End with "All on-screen text crisp, correctly spelled and perfectly legible."
  - No figures, rates, amounts or real partner names on screen unless the brand publishes them (the green captions carry the figures).
  - **Payoff / "boom" result screen:** the approval moment must open the clip: "From the very first frame, a huge bright green circle with a bold white check mark pops in at the centre of the screen with a bounce, the bold headline "You're matched!" (or the brand's equivalent) under it, a small burst of green confetti", held ~2 s, then the results list slides up. Never bury the check mark as a small icon above a list.
  - Form example: "…a blue top bar reading "Top Fundings" in white, a progress bar, the bold question "What do you need funding for?" and four large rounded white answer buttons with blue outlines reading "Equipment", "Payroll", "Inventory" and "Expansion". Her thumb taps "Equipment", the button turns solid blue with a white check mark, then the screen slides to the next question "How soon do you need it?"".
- Settings: `resolution: "720p"` (same sharpness as the actor; Omni has no 480p, and 360p is its draft tier, too soft next to the actor), `aspectRatio: "9:16"` (full B-roll) or `"16:9"` (split bottom half, cropped to the half in the edit; Omni has no 1:1), `duration` = the B-roll's window + 1 s, rounded up, min 3 (Omni takes 3–15 s; trimmed in the edit), no `startFrame`, no `referenceImages`, `nbGenerations: 1`, titles `[brand]_jumpcut_broll_[n]_[subject]_v1`. B-rolls need no audio: never prompt for sound (Omni has no audio switch, so its track is simply dropped in the edit).

## 5. Actor video (Seedance 2.5)

- **Duration:** count the spoken words per sentence, ÷ 2.9 = seconds (Seedance's real pace: 164 words took ~54.5 s in the Top Fundings test, Nov 2026; the human reference talks faster, ~3.7 words/s, so the Seedance version runs longer); clip duration = speech + 1.5 s, rounded up. Clip 1 = as many whole sentences as fit in ≤ 30 s; the rest = Seedance extends of 4–30 s each, cut at sentence ends (a 45 s script = clip 1 ~28 s + one extend ~18 s).
- Settings: `arcads_generate_video_seedance_25`, `resolution: "720p"` (the reference is 720p; 1080p costs ~2.5×), `aspectRatio: "9:16"`, `audioEnabled: true`, `nbGenerations: 1`, `referenceImages: [actor sheet]`, title `[brand]_jumpcut_[actor]_clip1_v1`.
- Extends: `arcads_extend_video`, `model: "seedance_25"`, `videoPath` = latest video, same `referenceImages`, `resolution: "720p"`, `audioEnabled: true`, title `_ext1_v1`. The result is the whole video so far, already stitched.

Prompt template (clip 1; the extend uses the same location sentence and its own shots timed from 0, opening "Hard jump cut to a new angle, same place."):

```
Authentic vertical UGC selfie video filmed on an iPhone front camera, a creator recording one message in [location with 4-6 concrete objects and its light] and editing it with hard jump cuts between different angles of that same room. The person from the reference sheet, same face, same hair, same [outfit] in every shot: [actor description]. Every shot is filmed from her own selfie point of view at arm's length, natural handheld sway from her arm and body. The only hand that ever enters the frame is her empty free hand. She talks fast and energetically straight to the lens, like a friend sharing a tip, natural American accent.
- 0-[t1]s, [angle 1: position, framing, what is behind her]: [emotion, small gesture] "[spoken sentence]"
- Hard jump cut, same room. [t1]-[t2]s, [angle 2 …]: … "[sentence]"
- …
- Hard jump cut, same room. [tn]-[duration]s, [last angle]: she points down at the end. "[CTA sentence]"
She says only these lines, word for word, nothing else. Same voice, same room, same light in every shot. Audio: only her voice recorded by the phone mic, light room tone, no music. Realistic skin texture, front-camera softness, small auto-exposure shifts between angles.
```

Phone wording (from `ugc-talking-actor`): "phone" and "camera" only in the first sentence and "phone mic"; never a propped, mounted or visible phone, never a mirror; no props in her hands (the proof phone lives in the B-roll). No scripted eye movements, no laughs, no named landmarks.

## 6. Plan, credits and runs

**Plan message** (one message, then "Go?"): sentence table (# · spoken text · words · seconds · shot type · angle or B-roll subject), the chosen location in one line, clip split (clip 1 / extends with durations), B-roll list, header lines and credits:

| Item | Rate (Arcads, Nov 2026) |
|---|---|
| Actor sheets (GPT Image 2.6 Sunburst) | 0 within the daily image allowance |
| Seedance 2.5, 720p, audio | ~42 credits/s (1080p is ~104/s) |
| Seedance 2.5 extend, 720p | ~56 credits per new second (26 s new on a 29 s source = 1,452) |
| Omni Flash 1.2, 720p | ~16 credits/s (Top Fundings, Nov 2026: 4 s = 60, 5 s = 80, 6 s = 100) |
| Transcribe, edit | 0 observed |

Reference run (Top Fundings, Nov 2026, 55 s, 4 B-rolls): 2,987 credits (clip 1 1,218 + extend 1,452 + B-rolls 317). Show the current balance (`arcads_get_credits`). Never launch a paid generation the user hasn't seen the cost of. The plan (with the chosen location and angles) is information with one "Go?": not a B-roll or location approval step. A Claude-written script = one 30 s clip (~1,260 credits) + 2–3 Omni B-rolls of ~4 s (~65 each): ~1,450 credits per video, no extend.

**After "Go?", run everything in the same turn without stopping and without any approval between clips:** clip 1, and in parallel every B-roll (all text-to-video, no start frames); each extend as soon as the previous video is ready; then the edit. Never use a scheduled task to wait. Never show intermediate clips. Never regenerate on your own: a failed generation → stop, state the retry cost, ask.

## 7. Edit (cloud workspace, locked scripts)

1. Download the final actor video (last extend, or clip 1) and every B-roll.
2. **Word timings:** `arcads_transcribe` (`srt`) on the actor video, used ONLY to place captions, the header and B-roll windows — never to judge, check or rate the take. Caption text always comes from the **display script**, not the transcript.
3. Build `plan.json`:
   - `header`: hook question split into 2 balanced lines, from 0 to the end of the hook sentence.
   - `captions`: display script, one entry per srt cue, each cue split into the fewest EVEN cards of 2–3 words (≤ 18 characters; a 4-word cue = 2 + 2, never 3 + 1, never a lone "on", "as" or "I"), the cue's time shared by character count; each card runs to the next card's start (or +0.2 s before a pause > 0.5 s); numbers in digits with symbols.
   - `segments`: SPLIT/BROLL windows from the first word of their sentence to the first word of the next sentence sorted and non-overlapping; two back-to-back B-rolls share the exact same boundary time; each B-roll clip at least its window + 0.2 s long (no crop setting: the split crop comes from face detection).
   - `face_xml`: path to `face.xml`.
4. Write the two scripts below to the workspace and run `python3 -I assemble.py plan.json`. Output `/mnt/user-data/outputs/[brand]_jumpcut_[actor]_final_v1.mp4`.
5. Technical check only (ffprobe: duration = actor video, video + audio streams present). Then send it.

**overlay.py** (locked — renders the header and caption PNGs):

```python
import sys, json, subprocess
from PIL import Image, ImageDraw, ImageFont
# usage: python3 -I overlay.py kind W out.png "TEXT" ["TEXT2"]   kind: caption | header
kind, W, out = sys.argv[1], int(sys.argv[2]), sys.argv[3]; texts = sys.argv[4:]
s = W / 720
def font(style, px):
    fp = subprocess.check_output(["fc-match", "-f", "%{file}", f"Inter:style={style}"]).decode()
    return ImageFont.truetype(fp, round(px * s))
def box(text, f, fill, fg, stroke, padx, pady):
    b = f.getbbox(text, stroke_width=stroke)
    w, h = b[2] - b[0] + 2 * padx, b[3] - b[1] + 2 * pady
    im = Image.new("RGBA", (w, h), fill); d = ImageDraw.Draw(im)
    d.text((padx - b[0], pady - b[1]), text, font=f, fill=fg, stroke_width=stroke, stroke_fill="black")
    return im
if kind == "caption":      # white text, black stroke, on #00FE02 box; 1 or 2 lines
    f = font("ExtraBold", 46); rows = [box(t.upper(), f, (0, 254, 2, 255), "white", max(2, round(3 * s)), round(8 * s), round(9 * s)) for t in texts]
elif kind == "header":     # line 1 black on #FEE400, line 2 white on #FF0000
    f = font("ExtraBold", 31)
    rows = [box(texts[0].upper(), f, (254, 228, 0, 255), "black", 0, round(8 * s), round(8 * s))]
    if len(texts) > 1: rows.append(box(texts[1].upper(), f, (255, 0, 0, 255), "white", 0, round(8 * s), round(8 * s)))
gap = round((6 if kind == "header" else 0) * s)
w = max(r.width for r in rows); h = sum(r.height for r in rows) + gap * (len(rows) - 1)
img = Image.new("RGBA", (w, h), (0, 0, 0, 0)); y = 0
for r in rows:
    img.paste(r, ((w - r.width) // 2, y)); y += r.height + gap
img.save(out); print(json.dumps({"file": out, "w": w, "h": h}))
```

**assemble.py** (locked — B-rolls, splits, whip transitions and overlays on the untouched actor audio; tested Nov 2026 on the Top Fundings run). Transitions are built in: the talking head and the segments are cut into pieces joined with `xfade` slides (each piece starts XD early, so every cut lands exactly on its sentence boundary and stays in sync with the untouched voice), `avgblur` adds directional motion blur during each whip and a zoom punch lands each new shot (XD = whip length, BLUR = blur kernel, PZ/PD = punch size and duration). Never add dissolves, fades or other effects. Splits find the face with OpenCV and always show it whole, forehead to chin: a native full-width crop centred on the face when it fits the top half, otherwise the face region fitted in the half over a blurred fill. It needs `face.xml` (OpenCV's `haarcascade_frontalface_default.xml`, not shipped with the installed cv2): `pip download opencv-python-headless==4.10.0.84 --no-deps -d ocv`, then extract `cv2/data/haarcascade_frontalface_default.xml` from the wheel (zipfile) to `face.xml`.

```python
import json, subprocess, sys, os
# usage: python3 -I assemble.py plan.json
# plan = {"actor": "actor.mp4", "out": "final.mp4", "overlay_py": "overlay.py", "work": "dir",
#   "header": {"start": 0, "end": 3.2, "lines": ["line 1", "line 2"]},
#   "face_xml": "face.xml",  # OpenCV haarcascade_frontalface_default.xml
#   "segments": [{"type": "broll"|"split", "start": s, "end": e, "file": "b.mp4"}],
#   "captions": [{"start": s, "end": e, "lines": ["2-3 words"]}]}
p = json.load(open(sys.argv[1])); D = p["work"]; os.makedirs(D, exist_ok=True)
def probe(f):
    o = json.loads(subprocess.check_output(["ffprobe", "-v", "error", "-select_streams", "v:0", "-show_entries",
        "stream=width,height,r_frame_rate:format=duration", "-of", "json", f]))
    s = o["streams"][0]; n, d = s["r_frame_rate"].split("/")
    return s["width"], s["height"], float(n) / float(d), float(o["format"]["duration"])
W, H, FPS, DUR = probe(p["actor"]); W -= W % 2; H -= H % 2
snap = lambda t: round(t * FPS) / FPS
def png(kind, lines, name):
    r = json.loads(subprocess.check_output(["python3", "-I", p["overlay_py"], kind, str(W), f"{D}/{name}.png", *lines]))
    return r
def split_region(s, e):
    """Rows [y0, y1] holding the whole face (forehead to chin) during the window, from haar detection."""
    import cv2
    c = cv2.CascadeClassifier(p["face_xml"]); v = cv2.VideoCapture(p["actor"]); tops, bots = [], []
    for k in range(8):
        v.set(cv2.CAP_PROP_POS_MSEC, (s + (e - s) * (k + 0.5) / 8) * 1000); ok, f = v.read()
        if not ok: continue
        f = cv2.resize(f, (W, H)); fs = c.detectMultiScale(cv2.cvtColor(f, cv2.COLOR_BGR2GRAY), 1.1, 6, minSize=(W // 6, W // 6))
        if len(fs):
            x, y, w, h = max(fs, key=lambda b: b[2] * b[3]); tops.append(y - 0.45 * h); bots.append(y + h + 0.35 * h)
    if not tops: return int(0.1 * H), int(0.1 * H) + H // 2
    y0, y1 = max(0, int(min(tops))), min(H, int(max(bots)))
    return y0, y1 + (y1 - y0) % 2
# --- transitions: whip pan (~0.17 s slide with motion blur) + zoom punch landing on the new shot ---
XD = max(4 / FPS if FPS < 30 else 0.2, 0.16)  # whip length
BLUR = max(8, W // 18)                        # motion-blur kernel during the whip
PZ, PD = 0.07, 0.35                           # landing punch: +7 % easing out over 0.35 s
NORM = f"fps={FPS},scale={W}:{H}:force_original_aspect_ratio=increase,crop={W}:{H},setsar=1,format=yuv420p,settb=AVTB"
# pieces: talking head between segments, and the segments themselves (segments sorted, non-overlapping)
pieces, t = [], 0.0
for g in p["segments"]:
    s, e = snap(g["start"]), snap(g["end"])
    if s - t > 0.05: pieces.append({"type": "actor", "start": t, "end": s})
    pieces.append(dict(g, start=s, end=e)); t = e
if DUR - t > 0.05: pieces.append({"type": "actor", "start": t, "end": DUR})
def direction(a, b):  # whip direction for a cut from piece type a to piece type b
    if b == "split": return "slideup", "v"
    if a == "split": return "slidedown", "v"
    if b == "actor": return "slideright", "h"
    return "slideleft", "h"
inputs = ["-i", p["actor"]]; fl = []; idx = 1
for k, pc in enumerate(pieces):
    lead = XD if k else 0.0                   # each piece after the first starts XD early to feed the whip
    a, b = pc["start"] - lead, pc["end"]; L = b - a
    if pc["type"] == "actor":
        fl.append(f"[0:v]trim={a:.4f}:{b:.4f},setpts=PTS-STARTPTS,{NORM}[p{k}]")
    elif pc["type"] == "broll":
        inputs += ["-i", pc["file"]]; i = idx; idx += 1
        fl.append(f"[{i}:v]trim=0:{L + 0.05:.4f},setpts=PTS-STARTPTS,{NORM},tpad=stop_mode=clone:stop_duration=1,trim=0:{L:.4f}[p{k}]")
    else:  # split: actor top half with the whole face, b-roll bottom half
        inputs += ["-i", pc["file"]]; i = idx; idx += 1
        hh = H // 2; hh -= hh % 2; y0, y1 = split_region(pc["start"], pc["end"])
        top = f"[0:v]trim={a:.4f}:{b:.4f},setpts=PTS-STARTPTS,fps={FPS},scale={W}:{H},setsar=1"
        if y1 - y0 <= hh:  # face fits: native full-width crop centred on the face
            ay = int(min(max((y0 + y1) / 2 - hh / 2, 0), H - hh)); fl.append(f"{top},crop={W}:{hh}:0:{ay}[t{k}]")
        else:  # face too tall: fit the face region in the half, blurred fill on the sides
            ch = y1 - y0; fw = int(W * hh / ch) // 2 * 2
            fl.append(f"{top},crop={W}:{ch}:0:{y0},split[fa{k}][fb{k}]")
            fl.append(f"[fa{k}]scale={W}:{hh}:force_original_aspect_ratio=increase,crop={W}:{hh},boxblur=20[bg{k}]")
            fl.append(f"[fb{k}]scale={fw}:{hh}[fg{k}]"); fl.append(f"[bg{k}][fg{k}]overlay=(W-w)/2:0[t{k}]")
        fl.append(f"[{i}:v]trim=0:{L + 0.05:.4f},setpts=PTS-STARTPTS,fps={FPS},scale={W}:{hh}:force_original_aspect_ratio=increase,crop={W}:{hh},setsar=1,tpad=stop_mode=clone:stop_duration=1,trim=0:{L:.4f}[bb{k}]")
        fl.append(f"[t{k}][bb{k}]vstack,setsar=1,format=yuv420p,settb=AVTB[p{k}]")
cur = "p0"; blurs, lands = [], []
for k in range(1, len(pieces)):
    tr, axis = direction(pieces[k - 1]["type"], pieces[k]["type"]); off = pieces[k]["start"] - XD
    fl.append(f"[{cur}][p{k}]xfade=transition={tr}:duration={XD:.4f}:offset={off:.4f}[x{k}]"); cur = f"x{k}"
    blurs.append((off, pieces[k]["start"], axis)); lands.append(pieces[k]["start"])
# directional motion blur during each whip, then a zoom punch as the new shot lands
for n, (s, e, axis) in enumerate(blurs):
    sx, sy = (BLUR, 1) if axis == "h" else (1, BLUR)
    fl.append(f"[{cur}]avgblur=sizeX={sx}:sizeY={sy}:enable='between(t,{s:.4f},{e:.4f})'[bl{n}]"); cur = f"bl{n}"
z = "+".join(f"if(between(t,{t0:.4f},{t0 + PD:.4f}),{PZ}*pow(1-(t-{t0:.4f})/{PD},2),0)" for t0 in lands) or "0"
fl.append(f"[{cur}]scale=w='trunc(iw*(1+{z})/2)*2':h='trunc(ih*(1+{z})/2)*2':eval=frame,crop={W}:{H}:(iw-{W})/2:(ih-{H})/2,setsar=1[zp]"); cur = "zp"
ov = []
if p.get("header"):
    h = p["header"]; ov.append((png("header", h["lines"], "header"), h["start"], h["end"], "0.083*H"))
for n, c in enumerate(p["captions"]):
    ov.append((png("caption", c["lines"], f"cap{n}"), c["start"], c["end"], "0.696*H-h/2"))
for n, (r, s, e, y) in enumerate(ov):
    inputs += ["-i", r["file"]]; i = idx; idx += 1
    fl.append(f"[{cur}][{i}:v]overlay=(W-w)/2:{y}:enable='between(t,{snap(s):.4f},{snap(e):.4f})'[o{n}]"); cur = f"o{n}"
cmd = ["ffmpeg", "-nostdin", "-y", *inputs, "-filter_complex", ";".join(fl), "-map", f"[{cur}]", "-map", "0:a",
       "-c:v", "libx264", "-preset", "medium", "-crf", "18", "-pix_fmt", "yuv420p", "-r", str(FPS),
       "-c:a", "copy", "-t", f"{DUR:.3f}", "-movflags", "+faststart", p["out"]]
r = subprocess.run(cmd, capture_output=True, text=True)
print("ok" if r.returncode == 0 else r.stderr[-2000:])
```

## 8. Deliver

One final video (sent with SendUserFile, plus the Arcads links). One line: duration, angles, B-rolls, resolution, actual credits (sum of `creditsCharged`) vs estimate. Offer once: music + SFX (via `add-music-to-video`, original voice untouched; a whoosh on each whip pan), hook variants (new header + first sentence), other actors. On reported issues: give the likely cause and fix, state the cost, regenerate only after a yes.

## Rules

- Flow: brand → casting image of 10 numbered actors, 5 women and 5 men in line with the brand's audience, generated without asking (user picks a number, or describes the actor → new casting image) → actor sheet (no approval) → Claude's selling 30 s script, shown in full and approved (or the client's own) → plan + credits → one "Go?" → everything automatic, no approval between clips → one final video.
- Always propose a selling script that fits one 30 s take (70–80 spoken words, no extend) and get it approved (or replaced by the client's own): always send the full script with SendUserMessage AND inside the approval question; never ask to approve an unseen script. Never add or ask about a disclaimer. Never ask for the location, product screenshots, or approval of the B-rolls, actor sheet or clip 1.
- English only; Seedance 2.5 with the actor sheet as reference for the actor, 720p, extends beyond 30 s. Omni Flash 1.2 at 720p, text-to-video only, for every B-roll; never generate start-frame images for B-rolls.
- One location for the whole video, chosen by Claude to fit the brand; a new angle or framing at every actor sentence, hard jump cuts, same outfit and light everywhere; never a visible filming phone, never props in her hands.
- Spoken script for the prompt, display script for captions; the user's wording is never changed beyond spoken spelling.
- Split screen always shows the actor's whole face while she talks (face-tracked crop).
- Transitions in and out of every B-roll and split: whip pan (~0.17 s slide with directional motion blur) + zoom punch on landing, never basic dissolves; jump cuts between talking-head angles stay hard cuts.
- Header on the hook, green captions on the whole video, one split screen, 2–3 full B-rolls, 30–40 % coverage, never on the hook's first 3 s or the CTA.
- Actor audio untouched; B-rolls generated without audio where the model allows it, and their audio never used; no music unless asked.
- Transcription only for timing; never analyze, rate or QC a generated clip; never regenerate without a yes.
- Credits shown before any paid generation; actual credits at delivery.
