fix: ignore PGS clear-screen segments when counting and sampling cues #3

Merged
nugget merged 1 commit from fix/pgs-clear-segments into main 2026-08-12 18:06:41 -05:00
Collaborator

Found while checking the Two Towers subtitle track: every sampled frame rendered with no subtitle visible.

A PGS stream emits two packets per displayed subtitle — the display segment carrying the bitmap, and a small clear-screen segment ending it. On Two Towers a 25-minute window held 527 packets: 263 display, 264 clear.

Two consequences:

  1. Cue counts were roughly doubled. Figures previously reported for other discs are inflated by about 2x; the full-vs-forced conclusions still hold because the inflation is uniform, but the absolute numbers were wrong.
  2. Selecting "most isolated cue" timestamps kept landing on clear segments, which display nothing — so the rendered frames were blank and the SDH check silently produced no evidence either way.

Filters to packets over 1 KB and lowers the full-vs-forced threshold to match corrected counts. Verified against Two Towers, which then rendered [SPEAKING IN ROHIRRIM] and [GROANS] and confirmed SDH.

Found while checking the Two Towers subtitle track: every sampled frame rendered with no subtitle visible. A PGS stream emits **two** packets per displayed subtitle — the display segment carrying the bitmap, and a small clear-screen segment ending it. On Two Towers a 25-minute window held 527 packets: 263 display, 264 clear. Two consequences: 1. Cue counts were roughly **doubled**. Figures previously reported for other discs are inflated by about 2x; the full-vs-forced conclusions still hold because the inflation is uniform, but the absolute numbers were wrong. 2. Selecting "most isolated cue" timestamps kept landing on clear segments, which display nothing — so the rendered frames were blank and the SDH check silently produced no evidence either way. Filters to packets over 1 KB and lowers the full-vs-forced threshold to match corrected counts. Verified against Two Towers, which then rendered `[SPEAKING IN ROHIRRIM]` and `[GROANS]` and confirmed SDH.
A PGS stream emits two packets per displayed subtitle: the display
segment carrying the bitmap, and a small clear-screen segment ending it.
Counting every packet roughly doubles the apparent cue count. Worse,
selecting timestamps without filtering lands on clear segments, which
render nothing -- every sampled frame came back with no subtitle on it.

Filter to packets over 1 KB, and adjust the full-vs-forced threshold to
suit the corrected counts.
nugget merged commit bb7a0c5688 into main 2026-08-12 18:06:41 -05:00
nugget deleted branch fix/pgs-clear-segments 2026-08-12 18:06:44 -05:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
nugget/media-import-tooling!3
No description provided.