Skip to content

Blu-ray sup: bridge gaps shorter than half a frame - #15934

Merged
niksedk merged 1 commit into
mainfrom
claude/bluray-sup-bridge-subframe-gaps
Oct 11, 2026
Merged

niksedk merged 1 commit into
mainfrom
claude/bluray-sup-bridge-subframe-gaps

Conversation

@niksedk

@niksedk niksedk commented Oct 11, 2026

Copy link
Copy Markdown
Member

Follow-up to #15933.

The typewriter effect left 1 ms gaps between its steps. That plugin is fixed in SubtitleEdit/plugins#316 (v1.3), but the export should not blank a frame for any near-zero gap.

Problem. On the frame grid a gap shorter than half a frame usually vanishes. When it straddles the middle of a frame, the end rounds down and the next start rounds up, so one frame shows nothing. The text flickers, and with "Full frame image" the video shows through. The comment in BluRaySupPicture said the grid "already closes every gap shorter than half a frame", which isn't true in that case.

Fix (ExportHandlerBluRaySup). Two conditions:

  • the next subtitle starts less than half a frame after the pending ones end
  • the end and the next start would land on different frames

When both hold, the pending subtitles that end last stay up until the next one starts. Their display sets are rebuilt with the new end. Gaps of half a frame or more are left alone, and so are gaps that already round onto the same frame, so most exports write the same bytes as before.

Verified

  • 3 new tests in ExportHandlerBluRaySupOverlapTests. Two of them fail on main.
  • All 1199 libuilogic tests pass.
  • Converted the reporter's 206-step Subtitle.srt with seconv to bluraysup at 1920x1080, 23.976 fps: main leaves 4 empty frames (around 55.35 s, 57.27 s, 58.22 s and 60.14 s), this branch leaves 0.

🤖 Generated with Claude Code

The typewriter effect left 1 ms between its steps (issue #15933). On the
frame grid such a gap usually vanishes, but when it straddles the middle
of a frame the end rounds down and the next start rounds up, so one frame
shows nothing: the text flickers, and with a full frame image the video
shows through. On the reporter's 206-step sample at 23.976 fps this left
4 empty frames.

When the next subtitle starts less than half a frame after the pending
ones end, and they would land on different frames, the pending
subtitles that end last now stay up until the next one starts. Their
display sets are written again with the new end.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@niksedk
niksedk merged commit 375a0c4 into main Oct 11, 2026
1 check passed
@niksedk
niksedk deleted the claude/bluray-sup-bridge-subframe-gaps branch October 11, 2026 16:24
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.

1 participant