Repository navigation
Add configurable blackbar scans for subtitles - #1626
Open
dustinreed-info wants to merge 2 commits into
Open
dustinreed-info wants to merge 2 commits into
dustinreed-info wants to merge 2 commits into
Conversation
dustinreed-info
force-pushed
the
subtitle-blackbar-scanlines
branch
from
October 8, 2026 20:50
caa7163 to
21ecc0a
Compare
Subtitles are usually drawn inside the bottom bar, so the bar height is now measured at the top across the full width and assumed at the bottom, which is only sampled near its corners (10% and 90%). This removes the scan position settings. While a crop is known, a frame too dark to measure no longer counts towards an unknown border, so dark scenes keep the crop instead of exposing captions in the bar.
Author
|
@awawa-dev when you have a moment, could you approve the CI run for this PR? Happy to change anything in the approach if you'd prefer it done differently. |
Owner
|
Done. I've had an idea for a new black border detector for a while now, as the current solutions in HyperHDR are quite brutally simple and limited, but first Ininite Engine took my all resources and after that unfortunately my free time is getting more and more scarce. But I'm planing it as an alternative solution and current blackbar detector will remain as a fallback option for a long time. |
Author
|
Thanks for approving the run, all checks pass. Since the current detector is staying as a fallback, would you be open to merging this in the meantime? |
This branch has not been deployed
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.
Summary
Add an optional Subtitles blackbar mode for letterboxed video. Subtitles are usually drawn inside the bottom bar, so the bar height is measured at the top across the full width and assumed at the bottom; the bottom is only sampled near its corners (10% and 90%), outside centered captions, so video with a smaller bottom bar is not over-cropped. The smaller of both bounds the existing symmetric crop. There are no extra settings.
While a crop is known, a frame too dark to measure (all samples black) no longer counts towards an unknown border, so dark scenes keep the crop instead of exposing captions in the bar after
unknownFrameCntframes. This only applies to the new mode. Existing modes and the default selection are unchanged.Related to #821. This handles subtitles in black bars; captions drawn inside the active picture are still sampled by the LEDs.
Design notes (questions from #821)
What kind of change does this PR introduce?
Does this PR introduce a breaking change?
The PR fulfills these requirements:
Validation
Detector regression tests (synthetic frames reproducing #821: wide two-line captions, asymmetric bars, aspect changes, threshold boundaries, black frames, tiny images, known limits) pass. On an LG C1, a v22 backport with equivalent sampling and the dark-frame crop hold runs with WLED output; with borderFrameCnt 15 / unknownFrameCnt 600, captions in the bar of a letterboxed trailer no longer lit the bottom LEDs.
Draft pending wider playback testing.