feat(chroma): opt-in auto key, and alert clips key like any other clip

TASK 64 slice F — the two things left after the feature worked by hand.

- App Settings → **Video clips → Auto Green/Blue Screen** (off by default). When on, a
  high-confidence detected screen is keyed as soon as the clip is added; the panel says
  "Removed automatically" so an automatic change is never silent. Medium confidence still
  asks, low says nothing — a wrong automatic key eats the picture.
- **A clip is a clip:** the alert box's own replacement clip keys through the same settings
  block (one alert box per layout, so its settings are the ones the next alert uses), and
  choosing an alert clip runs the same detector. The Green/Blue Screen panel now appears for
  a video layer *or* an alert box with a custom clip (`Source.ShowsChromaKey`).
- Spill ships as the creator-facing **Fringe** switch; nothing further to tune behind it.

Test: `ChromaKeyApplyTests` gains the auto-apply case (no click, still explicit in the panel)
and an alert-clip case (its pipe asks ffmpeg for colorkey+despill with the blue screen type).

Docs: TASK 64 complete in TASKS.md, known limits recorded in the task file, HANDOFF rewritten.
verify.sh: 546 passed, 0 failed, 0 warnings.
This commit is contained in:
2026-11-05 08:20:33 -08:00
parent ea24405ba2
commit 7bb1207fb2
12 changed files with 192 additions and 19 deletions
+10 -1
View File
@@ -48,7 +48,7 @@ lighting to blame. The reversal is recorded there.
| C | ✅ Pure `Services/VideoFilterChain.cs`: options → `-vf` string (`scale → colorkey → despill → format=bgra`) | exact string assertions (encoder `FfmpegArgs` style) |
| D | ✅ Detect on add: one `-frames:v 1` probe (mirror `IFrameRateProbe`) → suggestion in the panel; no rendering change | add a green-screen file → suggestion appears with its colour |
| E | ✅ Apply: session key `path|key-settings`, filter chain in the pipe, level/mute untouched | keyed layer over art shows the art through keyed pixels **and** the preview bitmap carries alpha |
| F | ☐ **Remaining:** "Auto Green/Blue Screen" opt-in in App Settings (high confidence only), alert clips wired to the same settings block, spill quality pass | slider reaches the chain and the restart preserves loop state |
| F | ✅ "Auto Green/Blue Screen" opt-in (App Settings; high confidence only, and the panel says it was automatic), alert clips keyed through the same settings block, spill shipped as the **Fringe** switch | slider reaches the chain and the restart preserves loop state |
## 3. Landmines for whoever builds this
@@ -61,3 +61,12 @@ lighting to blame. The reversal is recorded there.
- **Detection is a second reader of the file** — one frame, async, never on the UI thread; a failed
probe means "no suggestion", never a broken layer.
- **Letterboxing** (black bars) breaks naive border sampling — detect and exclude them first.
## 4. Known limits (honest)
- The offer is made **when a clip is added or changed** — not at every launch. The settings persist,
so a keyed layer comes back keyed; it just does not re-offer the probe.
- Auto-apply fires only at high confidence. Medium confidence always asks, low says nothing.
- The key is the layer's, but the decode is shared per **path + look**: two layers on one file with
different Amount/Softness values are two decoders (and therefore two audio streams, muted upstream
unless enabled) — rare, and the alternative is silently sharing the wrong picture.