Opened 16 years ago
Closed 15 years ago
Last modified 14 years ago
#4872 closed enhancement (fixed)
Detect if video is letterboxed and switch to corect fill mode
Reported by: | Owned by: | Janne Grunau | |
---|---|---|---|
Priority: | minor | Milestone: | 0.22 |
Component: | mythtv | Version: | head |
Severity: | medium | Keywords: | 16:9 full half automatic detect letterbox half full |
Cc: | Rob Smith | Ticket locked: | yes |
Description (last modified by )
This patch scans each frame for black bars on the top and bottom. If black bars are detected it switches to Full or Half fill mode (to the one that is most appropriate). It also switch off the fill mode if the letterbox disappears.
This is useful if you have a 16:9 display and view content that is letterboxed.
To enable this feature by default go to Setup->TV Settings->Playback->Next->Zoom and select "Auto Detect (Default Off)"
Or to just try it out you can enable it from the "Adjust Fill" menu.
Attachments (10)
Change History (33)
Changed 16 years ago by
Attachment: | detectLetterboxV5.patch added |
---|
comment:1 Changed 16 years ago by
Version: | 0.21-fixes → head |
---|
comment:2 Changed 16 years ago by
You may want to do something around your VERBOSE messages with frame->codec != ... and sourceAspect > 15 ... Those will get logged several times a second should they be true.
- Mark.
comment:3 Changed 16 years ago by
How about also moving the boolean test for isDetectLetterbox outside the routine and use it to trap the call to DetectLetterbox? so that 15 lines of initialization code and the call/return does not execute if this feature is not enabled.
comment:4 Changed 16 years ago by
Any chance this can be also used with the internal video player (mythvideo)?
comment:5 Changed 16 years ago by
I retract my statement, I was using a really screwed up video. My mistake.
Changed 16 years ago by
Attachment: | detectLetterboxV6.patch added |
---|
New version including bug fixes and use pre-buffered frames for detection (patch for 21-fixes branch)
Changed 16 years ago by
Attachment: | detectLetterboxV7.patch added |
---|
Same as v6 but all debug code is removed.
comment:6 Changed 16 years ago by
I think that version 7 of this patch is ready for inclusion into trunk.
Changed 16 years ago by
Attachment: | detectLetterboxV7_widescreen_backswitch_fix.patch added |
---|
This modified version of the v7 patch switches any zoom mode off if the source already is widescreen. This is needed for e.g. when switching from a 4:3 zoomed letterbox source to a 16:9 source (the original v7 patch would leave the 16:9 source zoomed)
comment:7 Changed 16 years ago by
Hello Guys,
I'm a little new to linux but a big fan of MythTV. I have tried to research how to apply a patch in Linux, but I can't get this patch to compile. So I have the following newbie questions:
1 In which directory do I patch this? 2 Which syntax in the PATCH command should I use?
Thanks! Wessel
System: Mythbuntu 8.04 AMD-64
AMD Athlon-64 3500, NVidia 8500 GT, nForce 4, 3GB RAM, 2x Hauppauge PVR-150
comment:8 Changed 16 years ago by
Hi,
I tested detectLetterboxV7_widescreen_backswitch_fix.patch with 0.21-fixes SVN 17453.
I have a 16:10 TFT and use DVB-T. I have the problem that the autodetection switched to full zoom mode instead of half, which hides a part of the picture.
comment:9 Changed 16 years ago by
I replaced all occurrences of kAdjustFill_Full with kAdjustFill_Half and now it works.
I never knew hat those "half" and "full" thingies stand for. From glancing at the code, it seems to be for 14:9 and 16:9 screens. Well, what about the folks with other screens, like 16:10?
It looks to me that the best solution (i.e. screen aspect ratio independent) would be a "zoom to full screen width, if the black borders on the upper and lower edge allow it"
The impact of the current implementatio is that it seems to confuse my 16:10 display with a 16:9 display, and crops the picture at the left and right border by switching to full instead of half.
comment:10 Changed 16 years ago by
Cc: | Rob Smith added |
---|---|
Description: | modified (diff) |
comment:11 Changed 15 years ago by
any status on this? It would be great if we could get this into current head so that it doesn't become stale and need to be complete re-written.
comment:12 Changed 15 years ago by
If you can reliably tell what bounding box of the input image actually has content, why would you want to select a full/half mode? Why not simply crop the black bars (wherever they are in the image), and scale the image to either fit the entire image to the monitor, or fill the entire monitor with the image?
Changed 15 years ago by
Attachment: | detectLetterboxV8.patch added |
---|
Updated V7 + widescreen backswitch fix to work with current trunk ([18991])
comment:13 Changed 15 years ago by
For all those of you wondering bout cpu usage:
<janneg> kormoc: with yadif as deinterlacing NuppelVideoPlayer::DetectLetterbox() takes 0.2 percent <janneg> without deinterlacer it's 0.8 percent <janneg> for 720x576 mpeg2 <janneg> with h264 hd it's less than 0.01 percent which I don't really understand <janneg> probably scaling since decoding is so much more expensive
comment:14 Changed 15 years ago by
Any chance at all this will land on the trunk? Without having actually tried the patch, this sounds like a great feature!
Changed 15 years ago by
Attachment: | detectLetterboxV9.patch added |
---|
Updated V8, encapsulation of the detection code and partial vdpau implementation
comment:15 Changed 15 years ago by
I can't finish working on the VDPAU support right now, so if anyone else wants to take up the torch until I can finish it?
Changed 15 years ago by
Attachment: | detectLetterboxV10.patch added |
---|
V9 minus the (nonfunctional) vdpau bits and updated to work with r20145
comment:16 Changed 15 years ago by
Any way to get this committed? I'd love to see this feature, but I only run prebuilt packages (I'm not ready to take the leap to compiling my own myth). If it could be put in 0.22 (whenever that gets released) that would be awesome!!
comment:17 Changed 15 years ago by
Big thanks for implementing this patch. It works really really cool!
I think it would be very useful to make it a bit more configurable. I think about an option to set properties for the two states: 0) Letter box not detected 1) Letter box detected
My example scenario is as follow: 0) For normal non-letter-boxed content, I would like to automaticaly change only the aspect ratio to 16:9, but turn off the zoom. 1) For letter-boxed content, the zoom should be activated (like it works now), and the aspect ratio should set to Off.
It would improve the usability if users could adapt the settings according to their needs.
comment:18 Changed 15 years ago by
This patch no longer applies against trunk without modification, mostly whitepsace. There were however a few changes that had to be made due to the code arround the patchsite in a file changed. After this the patch applied reletivly clean, there were some offset messages and even a fuzzy. However, it nolonger actually does what it says it does. Myth will compile but turning on the feature this adds does nothing. Might be related to the FFmpeg sync.
Changed 15 years ago by
Attachment: | detectLetterboxV13.patch added |
---|
comment:19 Changed 15 years ago by
Milestone: | unknown → 0.22 |
---|---|
Owner: | changed from Isaac Richards to Janne Grunau |
Status: | new → accepted |
comment:20 Changed 15 years ago by
Resolution: | → fixed |
---|---|
Status: | accepted → closed |
comment:21 Changed 15 years ago by
(In [21490]) remove unecessary include from DetectLetterbox?.cpp, fixes compilation without X
comment:22 Changed 14 years ago by
It is possible modify this patch to allow also the zoom on 16:9 content when displayed on 4:3 tv ?
comment:23 Changed 14 years ago by
Ticket locked: | set |
---|
Patch to autodetect letterbox for release-0-21-fixes rev :16402