Repository navigation
Add encoded letterbox crop for desktop and Android - #1524
Conversation
Detect encoded black bars with cropdetect, then fill the frame, instead of treating cover-zoom as auto crop. Co-authored-by: Cursor <cursoragent@cursor.com>
Media3 detects encoded bars via PixelCopy and zooms into the crop rect. Hide Crop black bars on phone, iOS, macOS, web, and tvOS. Drop the Fill rename so Auto Crop stays cover-zoom, not bar detection. Co-authored-by: Cursor <cursoragent@cursor.com>
The Media3 PixelCopy path is not TV-only. Drop the duplicate plugin junit/gradle.properties and keep Auto Crop labels/descriptions unchanged. Co-authored-by: Cursor <cursoragent@cursor.com>
…les. Co-authored-by: Cursor <cursoragent@cursor.com>
7b492f6 to
80dcf24
Compare
|
Hope you don't mind me popping in to ask a few questions @selmant -- I just don't have a file at the ready to test this with and was curious.
|
|
|
Question, though not for me, because I'm on macOS/iOS/tvOS: does this also cover vertical black bars? Example – a screengrab from a movie's internal production copy (16:9 video) with black bars all around: Does this also detect and crop the vertical bars left & right? (For me on macOS, I'll have to reencode the file with ffmpeg incl. cropping anyway, but maybe it works on Linux/Windows.) |
|
@JayBrown Good question. It didn't cover that before: bars on all four sides were ignored. I've added support for it in the new PR, #1579 (#1579), so a picture with black bars all around (like your screengrab) now gets cropped on Android, Linux and Windows. Unfortunately I don't have an Apple device, so there's no macOS/iOS/tvOS support for now. |

Summary
Adds a Crop black bars playback toggle that detects encoded letterbox/pillarbox and crops it, then fills the screen. This is a separate setting from zoom Auto Crop on purpose.
#1523 is why: Auto Crop is cover-zoom (
BoxFit.cover/ aspect-fill). It scales the whole coded frame to fill the window and clips overflow. It does not find or remove black bars baked into a 16:9 file. Putting real bar-detection into that zoom control would make the existing confusion worse, so this ships as its own toggle next to zoom until that naming is sorted. If #1523 lands (rename Auto Crop so zoom is clearly fill/cover, not a crop), this can move into zoom settings.Related Issues
Type of Change
Changes Made
cropdetectthenvf cropgetBitmapfallback), then layout zoom into the crop rect (SurfaceView + tunneling cannot use Media3 Crop effects)LetterboxCropperinplayback_core; Aether / HTML / tvOS are explicit stubsPlatform
No devices on hand for iOS / macOS / tvOS / web. The cropper interface is there so those platforms can follow this path.
Testing
Test Steps
Tested on Linux (libmpv) and Android TV emulator (Media3). Phone uses the same Media3 path; iOS/macOS/tvOS/web untested.
Checklist
Made with Cursor