Redesign video comparison viewer with synchronized playback
silvanus930
c300884
Replaced the two independent <video controls> elements (each with its own
play state, seek bar, and no relationship to the other) with a proper
side-by-side comparison viewer:
- Chip labels overlaid on the video itself (Reference/Compressed) instead
of plain text below, with a byte-size readout in the corner
- Both videos pinned to the same 16:9 frame via object-fit so they're
directly comparable regardless of actual resolution
- A single shared control bar: one play/pause button and one seek bar
drive both videos together, with a small drift-correction check on
every timeupdate (independent decoders on separately-encoded files can
drift a little even when started in sync)
- A loading overlay per video that clears on first decoded frame, so the
black box isn't ambiguous between "still loading" and "empty"
Also verified (in response to a reported reference/compressed mismatch)
that the actual file pairing was correct all along -- extracted frames
from both the source fil…
Fix video preview playback: browser-safe transcoded copies, not raw samples
silvanus930
0205fd4
Range-request streaming (previous commit) fixed the transport layer, but
the actual files still couldn't play -- confirmed two distinct root
causes directly on the real files, not guessed:
1. Reference clips arrive from the validator with the moov atom at the
end of the file (scanned the actual MP4 atoms: ftyp, free, then a
265MB mdat, then moov last) -- a browser has to fetch and parse the
tail of a huge file before playback can even begin.
2. Compressed outputs are frequently HEVC (confirmed via ffprobe) --
Chrome and Firefox cannot decode HEVC in <video> on most platforms
at all, codec-incompatible regardless of streaming support, and it
presents identically to (1): an endless spinner, no error.
New preview.py transcodes an on-demand, cached H.264 + faststart copy
(scaled to max 1280w, since this is a visual check not a quality
measurement -- the real score already covers that) for both video
endpoints, leaving the retained originals untouched for everything else…
Fix video preview: real range-request streaming, live sample detection
silvanus930
57f6065
Two real bugs found from a user report ("looping and don't playing", no
compressed video showing):
1. Plain FileResponse doesn't honor Range headers -- confirmed via curl,
a Range: bytes=0-1023 request came back 200 OK with the full 265MB
file instead of 206 Partial Content with just the requested bytes.
Browsers can't play (or even start playing) large video without range
support, which is exactly the "spinning, never plays" symptom. Added
a real byte-range-aware StreamingResponse.
2. has_reference_sample/has_compressed_sample were snapshotted once at
ingest time, but the compressed-sample capture is a fire-and-forget
background task in a separate process with no ordering guarantee
against the outcome-log write that ingest reads -- ingest routinely
ran before the file finished copying, permanently freezing the flag
at False even though the file showed up moments later (confirmed: the
file existed on disk the whole time). Item detail now checks the
…
- scoring.py: shared real compression-score formula (mirrors the exact
validator formula, same one used in real_validator_score_test.py) so
every part of the CMS scores consistently instead of each view
reimplementing it.
- db.py: added score column (+ migration for the pre-existing DB), an
alerts table, a calibration_runs table, sortable/filterable item
queries, score-trend and rate-distortion query helpers.
- cq_health.py: parses the live CQ tables directly from app.py's source
and cross-references them against real calibration evidence, flagging
which tiers are backed by data vs. still guesses. Caught and fixed a
real bug while building this: calibration evidence wasn't filtered by
encoder_mode, so NVENC AV1 data was silently getting attributed to the
SVT-AV1 table (different CQ/CRF curve entirely) and vice versa. Also
normalized all scores to the real vmaf_threshold rather than trusting
stored score_est, which for search-log rows is computed against an
inf…
Modernize CMS UI: real design system, favicon, better layout
silvanus930
9a642a0
Replaced the bare-bones first pass with a proper dark theme (token-based
colors, consistent spacing/radius scale), an inline SVG favicon (no
external asset), a header with a logo mark, stat cards with category
pills, and a cleaner item detail panel for the before/after video preview.
Add CMS foundation: persistent outcome logging, video sample capture, DB + browsing UI
silvanus930
b5c3309
- Compression service now writes a structured outcome record (codec, cq,
vmaf, ratio, timing, searched-vs-fallback) per completed item to
compression_outcomes.jsonl, following the same pattern as the existing
cq_search_log.jsonl. This doesn't touch the CompressResponse contract
with neurons/miner.py -- the CMS reads this log directly instead.
- _search_cq_for_max_score now returns (cq, vmaf) instead of just cq, so
the real measured VMAF for the chosen value can be logged instead of
re-measuring or guessing.
- neurons/miner.py captures a compressed-output sample alongside the
existing reference-clip capture, using the same category-aware
eviction policy (reserve=3 per codec/threshold, cap=80) -- generalized
the reference-library eviction helpers to serve both libraries, since
compressed outputs are normally deleted within seconds of upload and
would otherwise never be available to preview.
- New cms/ subsystem: SQLite-backed ingest of the outcome log, a FastAPI
s…