← Back to Pull requests

fix(media): play MP4 Opus and repair existing stream facts #1533

Closed
unknown closed this pull request without merging on Dec 03, 2026 22:33 UTC
View on GitHub
unknown unknown commented on Dec 03, 2026 20:11 UTC
Author

Motivation

MP4 videos with Opus audio are refused because the case-sensitive Opus sample entry is stored as an unknown audio codec. The device table also omits MP4 Opus. Existing imports retain those incomplete facts after an importer correction.

Description

  • Recognize standard MP4 Opus and probe its actual MP4 MIME independently of WebM; keep QuickTime/unknown tracks refused.

  • Recheck existing local MP4 facts through the shared exact-photo Retry repair action. Bound sequential work to 512 MiB / 512 root boxes / 32 MiB retained metadata / 10 seconds, stop early at moov, and revalidate custody, source and current facts before publication. Never guess a codec or drop an inventoried stream. Preserve original bytes and user metadata; no download or startup scan.

  • Record completed rechecks by parser revision and original hash. A confirmed unknown stream returns unchanged, keeps playback refused, and stops offering the same repair. Cancelled, malformed, or bounded misses cannot claim completion. Keep this provenance out of the v1 Image Trail block.

  • Show unknown codec rows and actionable stream-repair copy. Publish corrected facts even when poster decode misses. Test long sample tables and exact metadata-cap boundaries.
  • Documentation

    Updated common-video acceptance, E2E coverage mapping, synthetic fixture provenance/hashes, and a patch changeset. This corrects codec facts and the existing Chromium path within accepted ADR-0026, amended first for completed-recheck provenance; it adds no decoder, transcoder or container architecture.

    Testing

    npm run lint, npm test (2,918 unit tests, 149 DOM tests, paging lane), npm run docs:gov (130 docs, zero findings), npm run format:check, npm run check:changesets, npm run check:acceptance-coverage, npm run check:interop-acceptance, and npm run check:a11y-budget all passed locally, sequentially. The final test-setup adjustment also passed focused ESLint, root TypeScript and Prettier checks. Exact-head hosted CI run 47198379821 passed on a08e7869ca1544b9ffa403441af3a4c089da5280: all 15 checks successful, including complete suite, coverage/build/Storybook, Windows and E2E (153 passed, 7 existing skips). All eight native playback scenarios passed video/audio decode, seek and replay assertions, including both existing-record repairs. The Playwright report is retained. All four review threads have visible fixing replies and are resolved. Hosted E2E exercises real VP9/Opus and AV1/Opus samples in MP4/WebM, decoded video and audio, seek/replay, and repair of pre-fix stored MP4 facts. Small fixtures do not qualify 4K60 performance or a signed platform package.

    Manual testing

    1. With a local MP4 showing unknown audio, invoke Retry repair without reimporting. Opus should appear only when present; a truly unknown track remains refused.
    2. Play VP9/Opus and AV1/Opus MP4/WebM on the target runtime, pause/resume, seek and replay. Confirm audio and video. Judge large/4K60 performance on the actual device.
    3. Verify Original export remains byte-identical. Offloaded/locked/deleted/protected items retain existing admission; cancel/lock/switch during repair must not publish late facts.

    Closes #1532

    <!-- agent-bot-write: ghw_1d79aa6f8d003cb3 session=f601b21bf418 bot=trueline-codex-agent[bot] conversation_id=mp4-opus-playback conversation_id_source=self-reported -->

    Diff: 442 lines (+331 / -111) across 5 files Reviewer: qwts Review duration: 141m
    All Vouch review confidence checks passed
    Residual risk 0.18 = Change Risk (0.45) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.45 · 442 lines diff across 5 files
    0.45
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.365
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #1533"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 45.3% (MEDIUM) · Higher = larger blast radius
    45.3%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 17.9% · Safe to merge
    17.9%