Repository navigation
Blu-ray sup: bridge gaps shorter than half a frame - #15934
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
BluRaySupPicturesaid the grid "already closes every gap shorter than half a frame", which isn't true in that case.Fix (
ExportHandlerBluRaySup). Two conditions: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
ExportHandlerBluRaySupOverlapTests. Two of them fail on main.Subtitle.srtwith 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