[mythtv] Patch to autodetect 4:3 Zoom aspect ratio

Mårten Bohlin mabo at mochc.net
Fri Feb 29 12:22:27 UTC 2008

Time for a new version of the patch.

I have rewritten moste of the code to be able to understan what I am
doing :). So hopfully it will be easier to understan now if anybody is
trying to read the code.

The major change I have done is that I check if the top and bottom
bars has a solid color instead of just a treshold. This was intended
to solve Aarons problem with Stargate Atlantis. But it turned out that
it worked could switch to the right mode much quicker in many of my
test cases. Because now it could se the diferens between black and

In this version you also has to go to the setup and selct if you would
like to run this by default!
Setup->TV Settings->Playback->Next->Zoom

I have not had the time to actually use this version of the patch, so
it is posible that its not as good as the last one. But I hope you
have some time to try it out and give me some feedback.


On Thu, Feb 28, 2008 at 3:05 PM, aaron <memoryguy at gmail.com> wrote:
> On 2/27/08, Mårten Bohlin <mabo at mochc.net> wrote:
>  >
>  > Hi! Thanks to everybody that tests this patch and are giving me feed back.
>  >
>  > I have adjusted it now so it should not be to picky about the 4:3
>  > aspect of the source video. And I have also added a cool debug mode
>  > that shows where detection is done. It also paints a black box in the
>  > top left corner that is the brightest version of black that is
>  > considered as black. (I can not see it on my screen since it looks
>  > totally black)
>  >
>  Hi,
>  I tried this patch briefly last night (I'm getting home way too late
>  these days) and I can see that my problem with Stargate Atlantis
>  definitely is that the bars aren't dark enough. They sure looked black
>  until I saw the debugging square in the corner. I hesitate to increase
>  the threshold, though, because it might be getting light enough to
>  cause it to mis-detect.
>  I also found a funny quirk. Jeopary is always full-screen (not
>  letterboxed), but this patch consistently zooms in and out during
>  Final Jeopardy. Not a big deal, just kind of funny. :)  I think it's
>  because of black areas on the Jeopardy set being within range of the
>  detection code while the camera pans around. What happens is it comes
>  back from commercial, turns on zoom while they display the question,
>  then stays zoomed while they pan around and then when it passes a
>  certain point in the pan it turns off zoom. With debug mode enabled I
>  think I confirmed my suspicions about the detection: the ceiling and
>  floor of the set are dark enough that it thinks they're part of the
>  letterboxing.
>  I'd have to guess that in order to get it really close to 100%
>  accurate you'd have to analyze the whole frame... which reminds me....
>  does the commercial detector have code to detect "aspect ratio
>  changes," including letterboxing? If that information is written to
>  the database, could it be leveraged here somehow?
>  --
>  aaron
>  "Oh oh oh. I'm incoherent with excitement. Please tell me what fascinating
>  bit of badger-sputumly inconsequential trivia you will assail me with next."
>         -- Arthur Dent
>  _______________________________________________
>  mythtv-dev mailing list
>  mythtv-dev at mythtv.org
>  http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev
-------------- next part --------------
A non-text attachment was scrubbed...
Name: detectLetterboxV4-21fixes.patch
Type: application/octet-stream
Size: 14165 bytes
Desc: not available
Url : http://mythtv.org/pipermail/mythtv-dev/attachments/20080229/cd56b814/attachment.obj 

More information about the mythtv-dev mailing list