Commit Graph

8 Commits

Author SHA1 Message Date
Melbar 64e0132cc7 Upgrade CUTTER_REPORT: Frame-Locked Compare, full metadata, auto-commit+push
generate_cutter_report.py:
- Frame-Locked Compare video (trailer left / source right, single MP4) per
  beat replaces two separate side-by-side clips; rendered via accurate
  double-seek + black-fill segmented source reconstruction
- Generation timestamp now includes HH:MM:SS (Uhrzeit-Angabe)
- Per-beat segment list for multi-shot beats (TC, duration, offset, scene,
  score per segment)
- Score warning badge (yellow) if score < 0.65
- python cli.py rematch --beat N command hint in every card
- Overview table links to each beat card via #anchor
- Cleaner dark/light CSS using design tokens (--fg/--bg/--card/--bd)
- --no-clips flag (replaces --with-clips; default is now with clips)

cli.py:
- _auto_commit_push_reports(): after every report regeneration, stages the
  report output files (CUTTER_REPORT.*, output/cutter_clips/, output/report/)
  and auto-commits + pushes to origin/main so remote is always current
- Removed the legacy match_report.html call from _regenerate_cutter_report
  (CUTTER_REPORT now supersedes it)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-06 07:39:02 +02:00
Melbar 54d3f04616 Fix matching regressions, cache guard, and multi-shot algorithm for beat 15
- config.toml: revert scoreable_luma/contrast thresholds to 24/58/24 (lowering
  them let cross-fade blend frames contaminate content-validation templates,
  dropping scores below provisional_content_threshold)
- src/cv/global_scan.py: _is_dark_reference_frame now requires contrast<30 so
  genuine dark silhouette frames are not rejected as scoreable; two-path
  _is_scoreable_reference_frame separates standard vs fade-content scoring
- cli.py: _keeps_cached_match() guard prevents a weaker single-span rematch
  from overwriting a better multi-segment provisional cache entry
- cli.py: _fade_content_shots() restricted to between-island gaps only—
  pre-island black leaders were incorrectly emitted as matchable shots
- cli.py: island[0] of _match_unmatched_visual_segments() now uses no
  continuity seed so an insert cut at the start of a multi-shot beat is not
  forced toward the previous beat's scene
- scripts/generate_cutter_report.py: fix ffmpeg concat demuxer on Windows—
  use part.absolute().as_posix() so paths in the concat txt are absolute and
  not double-resolved relative to the concat file's directory

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-06 00:05:37 +02:00
Melbar 8aa6fe8323 Fix forehead_touch action group + always-fresh cutter assets
1. Action-group classifier conflated object-touches and person-touches.
   "man touches the red door with a small object" was being tagged as
   forehead_touch because "touch" was in the forehead_touch needles set.
   That made the realign pass yank Beat 16 from scene 451 (correct: man
   painting red door, IV stand) over to scene 623 (woman/man in bed) —
   a totally wrong shot at score 0.344.

   Fix: removed generic "touch*" verbs from forehead_touch's needle set.
   forehead_touch is now added in _semantic_action_groups() only when a
   touch verb is paired with an explicit body-part target (forehead,
   face, cheek, head, hand, ...) and not paired with an object target
   (door, handle, brush, tool, lock, ...).

   Effect on Beat 16 after `match --beat 16 --vision`:
   scene 623 in=5476.28 score=0.344 -> scene 451 in=3912.48 score=0.626.

2. Cutter-report stills/clips were keyed by source-video mtime, so a
   match-position change without a video change served stale frames from
   the previous match. Dropped the mtime cache; both extractors now
   render fresh every time. Slower (~minute per full regen) but correct.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-05 05:23:24 +02:00
Melbar b70d7e11be Concat multi-shot source clips and auto-regen match_report.html
1. Cutter-report source clip for multi-segment beats was using only the
   primary in/out, which equals the FIRST segment's range. Beat 10 with
   3 shots therefore showed only ~0.88 s of source instead of all 3.32 s.
   Added extract_concat_clip(): renders each segment as its own MP4 and
   concatenates them via ffmpeg's concat demuxer into one continuous
   source clip the same length as the trailer beat.

   Per-segment intermediate clips (beat_NN_source_seg00.mp4 etc.) are
   kept too so individual shots stay inspectable.

2. _regenerate_cutter_report now also regenerates the legacy
   output/report/match_report.html via src.pipeline.reporter.generate_report.
   Both reports stay in sync after every match command.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-05 04:40:01 +02:00
Melbar 2a3840e528 Fix cutter-report clip duration: render full beat / match length
Bug: the report rendered every preview clip at most 3 s, so any beat longer
than 3 s (e.g. beat 02 at 8.56 s) only got a fragment in the cutter report
and looked wrong. The hard 3 s cap was an early prototype constant that
silently truncated normal-length beats.

Trailer clip is now the full beat duration so the cutter sees the entire
reference beat. Source clip is the full matched duration (may be shorter
than the beat when the match drops before the beat ends — that's correct,
the cutter needs to see exactly the matched span).

A 30 s safety cap stays as a guard against runaway durations but it should
never trip on a normal trailer beat.

All existing clips were dropped and re-rendered so the report on disk
matches the new logic.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-04 22:31:40 +02:00
Melbar a405df0ddb Embed cutter-report stills inline + add HTML report with video previews
Two issues fixed:

1. Source frame rate was wrong. The script trusted ffprobe, which on this
   re-wrapped proxy reports 25 fps. The real number for the EDL/FCPXML and
   for what the cutter sees in the NLE comes from config.toml's
   edl_frame_rate (here 23.976). Source fps now reads that value first;
   ffprobe is only a fallback. Trailer fps still probes ffprobe (correct
   for the trailer file) with optional config override.

2. Stills in CUTTER_REPORT.md showed as broken links because output/ is
   gitignored, so the git server can't serve them. Stills are now embedded
   as base64 data URIs directly in the markdown. The file is therefore
   self-contained and renders in any markdown viewer including the git
   server's web preview.

3. New CUTTER_REPORT.html alongside the markdown: same data, proper card
   layout, side-by-side trailer/source columns per beat, base64-embedded
   stills, and (with --with-clips) base64-embedded 3 s MP4 video previews
   so the cutter can sight-check phase agreement directly in a browser.
   The auto-regen on each match writes both files; --with-clips is opt-in
   from the CLI for slower full renders.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-04 13:33:07 +02:00
Melbar 5a6ae2175c Slim README, move algorithm prose to docs, add stills + per-fps TC to cutter report
README: 550 -> 308 lines. The dense algorithm prose was moved verbatim to
docs/ALGORITHM.md and replaced in the README with a compact "Wenn ein Match
falsch wirkt" troubleshooting table and a link. The cutter-facing intro
points at the new in-report stills instead of the old HTML report.

Cutter report:
- Per-side frame rates: trailer timecodes use the trailer file's fps
  (typically 25), source timecodes use the source file's fps. ffprobe is
  used to detect each side; falls back to edl_frame_rate if unavailable.
- Side-by-side trailer/source preview stills extracted via ffmpeg, taken
  ~30% into the beat / match window. Stored under output/cutter_stills/
  (gitignored). Re-rendered only when the underlying video is newer than
  the cached jpg.
- Compact table at the top, detailed per-beat sections below with the
  stills inline so the cutter can sight-check phase agreement directly.
- New --no-stills flag for fast text-only regeneration.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-04 13:24:19 +02:00
Melbar 97a8f9e305 Add cutter report and auto-regen on each match
- New CUTTER_REPORT.md: per-beat hand-off table for the video editor doing
  the manual recut. Per beat: trailer SMPTE in/out, source SMPTE in/out,
  scene id, score, status (OK / ? / MAN.), and a one-line phase
  description from the cached vision text.
- New scripts/generate_cutter_report.py: pure renderer that reads the
  current cache (match_results.json + trailer_beats.json + optional
  vision_descriptions.json) and writes CUTTER_REPORT.md. No side effects on
  the cache.
- cli.py: after every successful match the cutter report is regenerated
  automatically (best-effort; failures are logged and do not abort).
- README.md: new top-section "Fuer den Cutter" describing exactly what the
  editor needs (which two files to look at, how the status flag works,
  the recommended NLE workflow). The technical algorithm description
  follows below.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-04 13:09:16 +02:00