Repository navigation
Add dynamic letterbox crop detection - #1579
Conversation
|
@mattsigal This follows up on the dynamic re-scan idea discussed on #1524. It adds configurable re-cropping and includes the fullscreen/windowed zoom and subtitle-placement fixes needed to make crop mode usable. Interested in your thoughts, especially on the crop/zoom interaction. |
|
More specifically on subtitles: on desktop libmpv, native bottom-aligned subtitles can still use the original uncropped frame coordinates. After the lower letterbox bar is removed, that can place them outside the retained picture. This PR remaps the subtitle position into the accepted crop rectangle while crop mode is active, then restores the exact previous position when it is cleared. |
✅ Build SuccessfulAll platform builds and tests passed. You can download the test artifacts below. Tests ✅ 4008 passed, analyzer clean
|
|
Optimized the scan so it no longer restarts hardware decode. The every-second check downloads a few frames with After the crop is applied, the picture fills the source-sized frame. Fit was painting the removed bars back into that frame, which made a 16:9 screen look unchanged. The debug scan logs are gone. |
A short hwdownload runs cropdetect on VAAPI, Vulkan, D3D11, VideoToolbox, and nvdec, then leaves the decoder alone. Copy-back is only the fallback, and a wider display keeps the cropped picture in fit instead of covering it again.
A wider crop now sets panscan so the bars are not painted back into the source-sized frame, and the player no longer prints the letterbox scan trace.
f446fc9 to
e5ed717
Compare
A centred picture with bars on every side is now cropped, confirmed over later reads in one-shot mode so a title card is not. Known ratios read the crop's own shape, seeks account for playback speed, Media3 keeps scanning through long pauses and retries a scan whose captures all failed, mpv serializes crop apply and clear, stops caching panscan and hands it to the Android TV surface, one-shot frame sampling waits out a pending crop, and the zoom mode is honoured when nothing is cropped. Unreachable screenshot-window code and unused constants are gone. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…op so the cropped picture fits any window and only covers in fullscreen, pace Media3 rescans by capture time, scope the libswscale error filter to a frame sample, and drop the format-only reflows and the panscan workaround
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configuration
⛔ Files ignored due to path filters (59)
📒 Files selected for processing (22)
Comment |
Pull Request
Summary
Adds configurable dynamic re-cropping to the encoded-black-bar cropper introduced in #1524. This includes the presentation and subtitle fixes required for crop mode to work correctly across fullscreen and windowed playback.
Related Issues
Type of Change
Changes Made
Platform
Testing
Test Steps
Screenshots (if applicable)
Not applicable; this changes playback behavior without adding a new UI surface.
Checklist