Skip to content

Clip-quality release: long-video selection, joined moments, readable scores, smoother cuts - #86

Merged
JeremySNR merged 11 commits into
mainfrom
ccr-8ee21b5a-opnw6d
Nov 22, 2026
Merged

JeremySNR merged 11 commits into
mainfrom
ccr-8ee21b5a-opnw6d

Conversation

@JeremySNR

Copy link
Copy Markdown
Owner

What does this change?

A large set of changes to how clips are found, scored and cut, aimed at Opus Clip-level output:

Finding clips

  • Long transcripts (> ~20 min of speech) are analysed in overlapping 12-minute windows, 3 at a time, then one comparative rerank puts every candidate on one scale.
  • The model picks clips by numbered transcript lines instead of timestamps; code maps ids to exact sentence boundaries (seconds still accepted as a fallback for non-strict providers).
  • Rule-breaking answers (unknown line, over the length ceiling, bad joins) get one correction request instead of being dropped/trimmed.
  • Deterministic opening check: skips throwaway lead-ins; a dangling "And/But/Because…" opening steps back to the line it continues, or ranks lower with a stated reason.
  • Scores are summed from rubric parts (hook, emotion, value, flow, shareability, + visual), shown on cards and in the editor.
  • Length is a target with a ceiling: up to 25% over the chosen length a clip is kept whole and ranked a few points lower; past that it is repaired/trimmed.
  • Join separate moments (beta, opt-in): clips may join 2–3 moments. Nearby joins come from the windowed pass; distant ones from a cached outline of the video (map per window + one reduce) and one proposal request. Every joined clip must pass a seamless + faithful review or it is dropped.
  • ChatGPT sign-in (10 requests/day) keeps its previous request count: no windows, repairs, rerank or outline.

Cutting and export

  • Silent gaps with on-screen motion or non-speech sound are kept by pause removal (shown on the timeline, removable).
  • 15 ms fades at every internal cut; durations unchanged.
  • Joined clips: per-stretch framing analysis, export opens the source once per moment, loudness measured on what plays.
  • Timeline folds long cuts; cut edges are draggable.
  • Hover-to-play on clip cards; big-word caption styles drop commas/full stops.
  • B-roll and post captions use only the words a clip plays.

Speed

  • Hosted transcription sends up to 3 chunks at once (first chunk primes the rest); local/LAN Whisper stays sequential.
  • Hosted analysis requests get their own queue of 4.

Why?

Clip quality on long videos degraded (one request for a whole transcript), scores were opaque and clustered, timestamps from the model landed off-sentence, and there was no way to build a clip from two moments.

Release notes

See ## [Unreleased] in CHANGELOG.md (Added / Improved / Fixed / Costs and limits / Validation).

How did you test it?

  • npm test — 106 files, 927 tests pass
  • npm run typecheck
  • npm run lint
  • Checked the change in the running app (Xvfb + Playwright): joined-clip card label, hover preview across the join, folded timeline, dragging a join edge + undo, real export of a joined clip (22.0 s, −14 LUFS, frames either side of the join from the right source times)
  • Offline scripts: test-pipeline, test-quality, test-wholevideo, test-captionsize; scripts/smoke-test.sh
  • Live model (gpt-5.4-mini): scripts/test-e2e.ts passes; six runs on a synthetic 52-minute podcast (results in docs/joined-moments.md)

Anything to watch out for?

  • Preview and export still share the planning code: protected (active) gaps go through clipKeptSegments; caption punctuation through captionWordText; cut fades are export-only audio and do not change durations.
  • Active-gap thresholds were tuned on synthetic footage and should be checked on real recordings.
  • The model overshoots length badly when joining; a sentence-trimming fallback does the final fit and the join review still gates the result.
  • Default Open on the hook is now on for API routes.

Generated by Claude Code

Clip selection
- Analyse transcripts past ~20 minutes of speech in overlapping windows
  (overlap longer than the longest clip) and keep the best across all of
  them, instead of one request holding the whole transcript.
- Score each rubric part separately and sum in code; record the parts on
  the clip.
- Review endings and openings in batches of eight.
- ChatGPT sign-in keeps one request per stage (daily request cap).
- "Open on the hook" defaults on for API connections.

Speed
- Transcribe up to three chunks at once on hosted APIs; local Whisper and
  LAN/loopback servers stay sequential.
- Hosted analysis requests get their own queue of four.

Interface
- Score breakdown on clip cards and in the editor; fresh runs are no
  longer labelled "Legacy score".
- Hover a clip card to play that moment muted.
- Big-word caption styles drop commas and full stops in preview and export.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RqojQVDwNbEqwSkac23iuJ
…retch framing analysis

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RqojQVDwNbEqwSkac23iuJ
- Export opens the source once per distant moment instead of decoding the
  footage between, and measures loudness on the audio that plays.
- The editor timeline folds the middle of a long cut into a marker, and any
  cut's edges can be dragged.
- Joined clips are labelled on cards and in the editor; hover preview plays
  only their moments.
- B-roll and post captions use only the words a clip plays.
- Setup option, docs/joined-moments.md, release notes, demo fixture.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RqojQVDwNbEqwSkac23iuJ
…ings and rerank across windows

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RqojQVDwNbEqwSkac23iuJ
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RqojQVDwNbEqwSkac23iuJ
- Step a clip that opens on "And"/"But" back to the line it continues,
  only onto a line of six words or more.
- Over-length corrections say how long each part runs and what to keep,
  and aim for the middle of the length band rather than just under the cap.
- Long-range joins: show each line's length, show fewer lines per moment,
  one correction request, then trim whole sentences as a last resort
  (the result still goes through the join and ending reviews).
- Sharper outline matching: a promised story matches where it is
  delivered, not the first later mention of the topic.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RqojQVDwNbEqwSkac23iuJ
A clip may run up to a quarter past the chosen length (never past three
minutes). Such a clip is kept whole instead of being cut back before its
payoff, loses a few ranking points from structure, and says why. Past the
ceiling it is repaired or trimmed as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RqojQVDwNbEqwSkac23iuJ
- A failed window no longer fails the whole analysis; the other parts are
  used and the run fails only if every part failed. A failed review batch
  stops further batches from being sent.
- The opening check runs after the opening review, so it judges each
  clip's final opening (no stale "opens on And" penalty).
- Visual discovery and visual-payoff repair keep to the length target;
  only transcript clips get the overrun allowance and its penalty.
- A penalty a part cannot absorb comes off the other parts.
- Hosted transcription primes later chunks with the opening of the first.
- Private IPv6, 0.0.0.0 and .internal/.lan hosts count as local Whisper.
- Docs and release notes give the true request counts for joining.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RqojQVDwNbEqwSkac23iuJ
- Every kept piece starts and ends on the source's frame grid, so each
  piece's picture and sound are the same length (no per-cut A/V wander).
  Inputs are found by piece midpoint so alignment can't misroute footage.
- A single stretch well inside the trim gets its own seek: cut footage at
  the start or end is neither decoded nor measured for loudness.
- Editorial assessments are not invalidated by pauses kept for activity.
- No cut-edge drag handle on top of the trim handle.
- Filmstrips work for file paths containing "|".
- Export progress for joined clips no longer stalls at 95%.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RqojQVDwNbEqwSkac23iuJ
@JeremySNR
JeremySNR merged commit b7de712 into main Nov 22, 2026
5 checks passed
@JeremySNR JeremySNR mentioned this pull request Nov 22, 2026
3 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants