Skip to content

NAT-545: Inspect Android media samples (2 of 2) - #168

Merged
eugene-mux merged 3 commits into
feature/nat-534-hevc-standard-ingestfrom
em/nat-545-sample-inspection
Oct 16, 2026
Merged

eugene-mux merged 3 commits into
feature/nat-534-hevc-standard-ingestfrom
em/nat-545-sample-inspection

Conversation

@eugene-mux

@eugene-mux eugene-mux commented Oct 6, 2026 •

Copy link
Copy Markdown

Description

Inspect compressed AVC/HEVC video samples for Standard Input planning. Complete scans supply cadence, bitrate and GOP evidence; incomplete scans retain metadata and leave sample facts unknown.

Changes

  • Use MediaExtractor to measure frame rate, presentation timestamps, video-average and per-GOP bitrate/bytes, and keyframe intervals separately from metadata inspection.
  • Inspect sync-sample NALs for IDR/open-GOP evidence. Ignore non-VCL signaling while keeping malformed headers and unsupported syntax unknown.
  • Classify video edit lists by track ID without applying their timeline. ISO parsing is limited to edit/timeline work; Part 1 reads platform metadata directly. Malformed lists preserve track metadata; zero-duration edits remain unknown and Matroska reports no ISO edits.
  • Document valid B-frame timestamp reordering and report capped legacy sample reads as LimitExceeded.
  • Bound scans to 4 MiB per sample, 250,000 samples, 1 GiB read and 5 seconds of cooperative elapsed time. Limited or interrupted scans discard all partial sample facts; without another known violation, the planner can retain the original file.
  • Leave effective duration and A/V offset unknown for the future changes. Trimmed preroll retains unknown bitrate and final-GOP interval when the endpoint is unproven.

Validation

  • 124 tests pass in each debug/release variant on JDK 17.
  • SDK and sample release builds, lint-vital, whitespace checks and CI pass.
  • All 23 external API 36 emulator cases match expected outcomes: 19 complete scans, three unsupported inputs and one malformed-container rejection.
  • The legacy read branch matches on API 36; actual API 23 runtime validation remains pending.
  • Large 1–3 GB 4K measurements on physical mid-range hardware remain pending. The current caps can leave large-file bitrate/GOP violations unknown; emulator timings do not establish device performance.

Note

Medium Risk
New binary parsing and MediaExtractor loops affect upload standardization evidence; behavior is defensive (unknown/partial discard) but incorrect GOP or edit classification could change planner decisions.

Overview
Adds compressed-sample inspection for Android standard-input planning: MediaSampleInspector walks single-track AVC/HEVC via MediaExtractor, derives cadence, timestamps, average/per-GOP bitrate and keyframe spacing, and inspects sync-sample NALs for IDR vs open-GOP structure. Scans are capped (sample size, count, bytes read, elapsed time); partial, encrypted, or interrupted runs return status without publishing sample-derived facts.

ISO edit-list classification is new in IsoContainerMetadataReader: it reads moov/trak identity and classifies elst as none/simple/complex by track ID for video edits only—no timeline application. Matroska is treated as no ISO edits; malformed edit lists leave editList unknown while preserving other track metadata.

TimestampFacts renames isMonotonic to presentationOrderMatchesDecodeOrder and documents that B-frame reordering is expected, not invalid PTS.

Reviewed by Cursor Bugbot for commit b037dcc. Bugbot is set up for automated code reviews on this repo. Configure here.

@eugene-mux eugene-mux changed the title NAT-545 Part 2: Inspect bounded compressed video samples NAT-545: Inspect Android media samples (2 of 2) Oct 6, 2026
@eugene-mux
eugene-mux marked this pull request as ready for review October 6, 2026 17:57
@eugene-mux
eugene-mux requested a review from a team as a code owner October 6, 2026 17:57
@eugene-mux
eugene-mux requested a review from daytime-em October 6, 2026 17:57
@eugene-mux
eugene-mux added this pull request to stack #166 October 6, 2026 17:57
@eugene-mux
eugene-mux force-pushed the em/nat-545-sample-inspection branch 2 times, most recently from 82e26df to 29f8f40 Compare October 16, 2026 18:09

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 29f8f40. Configure here.

@eugene-mux
eugene-mux force-pushed the em/nat-545-sample-inspection branch from 29f8f40 to c9f486a Compare October 16, 2026 18:35
Base automatically changed from em/nat-545-metadata-inspection to feature/nat-534-hevc-standard-ingest October 16, 2026 19:57
@eugene-mux
eugene-mux force-pushed the em/nat-545-sample-inspection branch from c9f486a to b037dcc Compare October 16, 2026 19:58
@eugene-mux
eugene-mux merged commit 12f4349 into feature/nat-534-hevc-standard-ingest Oct 16, 2026
1 of 2 checks passed
@github-actions github-actions Bot mentioned this pull request Nov 4, 2026
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