Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: MythTV: Dev

Patch to autodetect 4:3 Zoom aspect ratio

 

 

First page Previous page 1 2 3 Next page Last page  View All MythTV dev RSS feed   Index | Next | Previous | View Threaded


mabo at mochc

Feb 27, 2008, 5:49 AM

Post #26 of 55 (6781 views)
Permalink
Re: Patch to autodetect 4:3 Zoom aspect ratio [In reply to]

On Wed, Feb 27, 2008 at 2:15 PM, aaron <memoryguy [at] gmail> wrote:
> On 2/26/08, aaron <memoryguy [at] gmail> wrote:
> >
> > Although it's not perfect. It *seems* (haven't played enough, and it's
> > time for bed...) that the case where the channel logo partially covers
> > the black bar it fails to detect that it's letterboxed.
> >
>
> Okay, I tried a couple more videos and you were right, Marten (please
> forgive my spelling, I don't know how to enter the correct "a")
>
> The detection does not get fooled by the channel logo, nor the rating
> logo (that is, the giant "PG", "G", etc) up the top left corner.
> Excellent!
>
> But it's still not detecting properly for some recordings. In my case,
> an episode of Stargate Atlantis stays in "Off" mode, but then switches
> during the commercial break when the commercials are letterboxed. And
> on an episode of The Office it keeps jumping back and forth during the
> episode.
>
> The bars on The Office look (to me) about as dark as other shows that
> don't have a problem. Stargate's boxes are a little lighter, but I
> didn't think they were *that* much lighter ... they're still darker
> than the "black0" pillarbox colour.
>
> When I get a chance I'll try digging into the code a bit more. Alas,
> my free time is often very limited. I *may* get a chance this
> weekend....
>
> But, on a positive note, when it does work correctly it's a great feature :)
>

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)

Here is a snapshot of it and explanation of how to reed it:
http://www.mochc.net/myth-dev/LetterBoxDebugg.jpg

To enable it turn it on in the Adjust Fill menu. I hope that this will
help us to get all the parameters perfect for everybody.

/Mårten
Attachments: detectLetterboxDebugg-21fixes.patch (10.4 KB)


skd5aner at gmail

Feb 27, 2008, 9:33 AM

Post #27 of 55 (6772 views)
Permalink
Re: Patch to autodetect 4:3 Zoom aspect ratio [In reply to]

On Wed, Feb 27, 2008 at 8:49 AM, Mårten Bohlin <mabo [at] mochc> wrote:
> On Wed, Feb 27, 2008 at 2:15 PM, aaron <memoryguy [at] gmail> wrote:
> > On 2/26/08, aaron <memoryguy [at] gmail> wrote:
> > >
> > > Although it's not perfect. It *seems* (haven't played enough, and it's
> > > time for bed...) that the case where the channel logo partially covers
> > > the black bar it fails to detect that it's letterboxed.
> > >
> >
> > Okay, I tried a couple more videos and you were right, Marten (please
> > forgive my spelling, I don't know how to enter the correct "a")
> >
> > The detection does not get fooled by the channel logo, nor the rating
> > logo (that is, the giant "PG", "G", etc) up the top left corner.
> > Excellent!
> >
> > But it's still not detecting properly for some recordings. In my case,
> > an episode of Stargate Atlantis stays in "Off" mode, but then switches
> > during the commercial break when the commercials are letterboxed. And
> > on an episode of The Office it keeps jumping back and forth during the
> > episode.
> >
> > The bars on The Office look (to me) about as dark as other shows that
> > don't have a problem. Stargate's boxes are a little lighter, but I
> > didn't think they were *that* much lighter ... they're still darker
> > than the "black0" pillarbox colour.
> >
> > When I get a chance I'll try digging into the code a bit more. Alas,
> > my free time is often very limited. I *may* get a chance this
> > weekend....
> >
> > But, on a positive note, when it does work correctly it's a great feature :)
> >
>
> 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)
>
> Here is a snapshot of it and explanation of how to reed it:
> http://www.mochc.net/myth-dev/LetterBoxDebugg.jpg
>
> To enable it turn it on in the Adjust Fill menu. I hope that this will
> help us to get all the parameters perfect for everybody.
>
> /Mårten
>
> _______________________________________________
> mythtv-dev mailing list
> mythtv-dev [at] mythtv
> http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev
>
>

Cool, and very useful, feature! I would recommend opening a ticket in
trac and submitting this as an enhancement. Even though it's not
quite ready for inclusion, you can at least keep track of your patches
and process in a ticket so that when it is ready it can be considered
for inclusion.
Thanks!
Matt
_______________________________________________
mythtv-dev mailing list
mythtv-dev [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev


mark.buechler at gmail

Feb 27, 2008, 2:43 PM

Post #28 of 55 (6749 views)
Permalink
Re: Patch to autodetect 4:3 Zoom aspect ratio [In reply to]

This is a lot closer for me. However, it's not 100%. There seem to be a few
occasions where once in widescreen mode, it won't correctly detect 4x3 (only
commercials so far). But then again, I don't know that this sort of thing
CAN be 100%.

- Mark.

On Wed, Feb 27, 2008 at 12:33 PM, Matt S. <skd5aner [at] gmail> wrote:

> On Wed, Feb 27, 2008 at 8:49 AM, Mårten Bohlin <mabo [at] mochc> wrote:
> > On Wed, Feb 27, 2008 at 2:15 PM, aaron <memoryguy [at] gmail> wrote:
> > > On 2/26/08, aaron <memoryguy [at] gmail> wrote:
> > > >
> > > > Although it's not perfect. It *seems* (haven't played enough, and
> it's
> > > > time for bed...) that the case where the channel logo partially
> covers
> > > > the black bar it fails to detect that it's letterboxed.
> > > >
> > >
> > > Okay, I tried a couple more videos and you were right, Marten (please
> > > forgive my spelling, I don't know how to enter the correct "a")
> > >
> > > The detection does not get fooled by the channel logo, nor the rating
> > > logo (that is, the giant "PG", "G", etc) up the top left corner.
> > > Excellent!
> > >
> > > But it's still not detecting properly for some recordings. In my
> case,
> > > an episode of Stargate Atlantis stays in "Off" mode, but then
> switches
> > > during the commercial break when the commercials are letterboxed. And
> > > on an episode of The Office it keeps jumping back and forth during
> the
> > > episode.
> > >
> > > The bars on The Office look (to me) about as dark as other shows that
> > > don't have a problem. Stargate's boxes are a little lighter, but I
> > > didn't think they were *that* much lighter ... they're still darker
> > > than the "black0" pillarbox colour.
> > >
> > > When I get a chance I'll try digging into the code a bit more. Alas,
> > > my free time is often very limited. I *may* get a chance this
> > > weekend....
> > >
> > > But, on a positive note, when it does work correctly it's a great
> feature :)
> > >
> >
> > 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)
> >
> > Here is a snapshot of it and explanation of how to reed it:
> > http://www.mochc.net/myth-dev/LetterBoxDebugg.jpg
> >
> > To enable it turn it on in the Adjust Fill menu. I hope that this will
> > help us to get all the parameters perfect for everybody.
> >
> > /Mårten
> >
> > _______________________________________________
> > mythtv-dev mailing list
> > mythtv-dev [at] mythtv
> > http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev
> >
> >
>
> Cool, and very useful, feature! I would recommend opening a ticket in
> trac and submitting this as an enhancement. Even though it's not
> quite ready for inclusion, you can at least keep track of your patches
> and process in a ticket so that when it is ready it can be considered
> for inclusion.
> Thanks!
> Matt
> _______________________________________________
> mythtv-dev mailing list
> mythtv-dev [at] mythtv
> http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev
>


mabo at mochc

Feb 28, 2008, 3:18 AM

Post #29 of 55 (6745 views)
Permalink
Re: Patch to autodetect 4:3 Zoom aspect ratio [In reply to]

On Wed, Feb 27, 2008 at 11:43 PM, Mark Buechler <mark.buechler [at] gmail> wrote:
> This is a lot closer for me. However, it's not 100%. There seem to be a few
> occasions where once in widescreen mode, it won't correctly detect 4x3 (only
> commercials so far). But then again, I don't know that this sort of thing
> CAN be 100%.
>
> - Mark.

I am glad to hear that it starting to get useful. And I agree that it
will never be 100% corect, but we can try to get it as good as we can.

If the problem is to switch back to pillarboxed mode I could remove
some constraints. Today it only do that if it detects a image in both
the top and bottom bars. I guess it will be ok to do the switch if a
image is detected in one of them.

Mårten
_______________________________________________
mythtv-dev mailing list
mythtv-dev [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev


mark.buechler at gmail

Feb 28, 2008, 3:40 AM

Post #30 of 55 (6744 views)
Permalink
Re: Patch to autodetect 4:3 Zoom aspect ratio [In reply to]

Hi.

On Thu, Feb 28, 2008 at 6:18 AM, Mårten Bohlin <mabo [at] mochc> wrote:

> On Wed, Feb 27, 2008 at 11:43 PM, Mark Buechler <mark.buechler [at] gmail>
> wrote:
> > This is a lot closer for me. However, it's not 100%. There seem to be a
> few
> > occasions where once in widescreen mode, it won't correctly detect 4x3
> (only
> > commercials so far). But then again, I don't know that this sort of
> thing
> > CAN be 100%.
> >
> > - Mark.
>
> I am glad to hear that it starting to get useful. And I agree that it
> will never be 100% corect, but we can try to get it as good as we can.
>
> If the problem is to switch back to pillarboxed mode I could remove
> some constraints. Today it only do that if it detects a image in both
> the top and bottom bars. I guess it will be ok to do the switch if a
> image is detected in one of them.
>

I think that would probably work.


>
> Mårten
> _______________________________________________
> mythtv-dev mailing list
> mythtv-dev [at] mythtv
> http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev
>


Thanks, Mark.


memoryguy at gmail

Feb 28, 2008, 6:05 AM

Post #31 of 55 (6734 views)
Permalink
Re: Patch to autodetect 4:3 Zoom aspect ratio [In reply to]

On 2/27/08, Mårten Bohlin <mabo [at] mochc> 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
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev


stuart at tase

Feb 28, 2008, 6:06 AM

Post #32 of 55 (6736 views)
Permalink
Re: Patch to autodetect 4:3 Zoom aspect ratio [In reply to]

On Wednesday 27 February 2008 13:49:29 Mårten Bohlin wrote:
> 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)
>
> Here is a snapshot of it and explanation of how to reed it:
> http://www.mochc.net/myth-dev/LetterBoxDebugg.jpg
>
> To enable it turn it on in the Adjust Fill menu. I hope that this will
> help us to get all the parameters perfect for everybody.

http://miffteevee.co.uk/imagebin/letterbox_debug.jpg

This format generally works best with the 'Full' fill.
--
Stuart Morgan
_______________________________________________
mythtv-dev mailing list
mythtv-dev [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev


cpinkham at bc2va

Feb 28, 2008, 9:33 AM

Post #33 of 55 (6727 views)
Permalink
Re: Patch to autodetect 4:3 Zoom aspect ratio [In reply to]

* On Thu Feb 28, 2008 at 09:05:08AM -0500, aaron wrote:
> 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?

Yes, the flagger detects both physical aspect changes in the recording as
well as letter/pillarboxing. It would be fairly easy for someone to modify
it to write out this data to the recordedmarkup table so that information
could be used later during playback.

--
Chris
_______________________________________________
mythtv-dev mailing list
mythtv-dev [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev


luitjens at cs

Feb 28, 2008, 9:59 AM

Post #34 of 55 (6721 views)
Permalink
Re: Patch to autodetect 4:3 Zoom aspect ratio [In reply to]

What is the edge detection algorithm you are using? Moving to a more
sophisticated algorithm could prevent false detections.

Justin


Mark Buechler wrote:
> Hi.
>
> On Thu, Feb 28, 2008 at 6:18 AM, Mårten Bohlin <mabo [at] mochc
> <mailto:mabo [at] mochc>> wrote:
>
> On Wed, Feb 27, 2008 at 11:43 PM, Mark Buechler
> <mark.buechler [at] gmail <mailto:mark.buechler [at] gmail>> wrote:
> > This is a lot closer for me. However, it's not 100%. There seem
> to be a few
> > occasions where once in widescreen mode, it won't correctly
> detect 4x3 (only
> > commercials so far). But then again, I don't know that this sort
> of thing
> > CAN be 100%.
> >
> > - Mark.
>
> I am glad to hear that it starting to get useful. And I agree that it
> will never be 100% corect, but we can try to get it as good as we can.
>
> If the problem is to switch back to pillarboxed mode I could remove
> some constraints. Today it only do that if it detects a image in both
> the top and bottom bars. I guess it will be ok to do the switch if a
> image is detected in one of them.
>
>
> I think that would probably work.
>
>
>
> Mårten
> _______________________________________________
> mythtv-dev mailing list
> mythtv-dev [at] mythtv <mailto:mythtv-dev [at] mythtv>
> http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev
>
>
>
> Thanks, Mark.
> ------------------------------------------------------------------------
>
> _______________________________________________
> mythtv-dev mailing list
> mythtv-dev [at] mythtv
> http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev
>

_______________________________________________
mythtv-dev mailing list
mythtv-dev [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev


memoryguy at gmail

Feb 28, 2008, 12:09 PM

Post #35 of 55 (6717 views)
Permalink
Re: Patch to autodetect 4:3 Zoom aspect ratio [In reply to]

On 2/28/08, Chris Pinkham <cpinkham [at] bc2va> wrote:
>
> Yes, the flagger detects both physical aspect changes in the recording as
> well as letter/pillarboxing. It would be fairly easy for someone to modify
> it to write out this data to the recordedmarkup table so that information
> could be used later during playback.
>

I'd love to tackle this, but I've no doubt that by the time I actually
get enough time to dedicate to it an infinite number of monkeys could
come up with a patch too. :)

--
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
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev


cpinkham at bc2va

Feb 28, 2008, 7:56 PM

Post #36 of 55 (6712 views)
Permalink
Re: Patch to autodetect 4:3 Zoom aspect ratio [In reply to]

* On Thu Feb 28, 2008 at 10:59:54AM -0700, Justin wrote:
> What is the edge detection algorithm you are using? Moving to a more
> sophisticated algorithm could prevent false detections.

I haven't looked at his code, but what more is required other than "all lines
above this are black, the next is not" and vice versa for the bottom bar.
That's what I did in the commercial flagging code does to detect the letter
and pillar boxes. In order to make things faster, the commercial flagger
doesn't check every pixel, but enough to be accurate. A screen of thin
vertical lines might make it past the detection, but that's a fringe case.

--
Chris
_______________________________________________
mythtv-dev mailing list
mythtv-dev [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev


luitjens at cs

Feb 28, 2008, 9:54 PM

Post #37 of 55 (6720 views)
Permalink
Re: Patch to autodetect 4:3 Zoom aspect ratio [In reply to]

This would likely work as long as you know where the cut offs should
be. If not what happens if the screen has a few black lines at the
bottom because it is a dark part of the scene? One thing that would
help prevent this would be to look over a couple frames and not a single
frame. Or what if the TV icon goes over into the black bars?

Justin


Chris Pinkham wrote:
> * On Thu Feb 28, 2008 at 10:59:54AM -0700, Justin wrote:
>
>> What is the edge detection algorithm you are using? Moving to a more
>> sophisticated algorithm could prevent false detections.
>>
>
> I haven't looked at his code, but what more is required other than "all lines
> above this are black, the next is not" and vice versa for the bottom bar.
> That's what I did in the commercial flagging code does to detect the letter
> and pillar boxes. In order to make things faster, the commercial flagger
> doesn't check every pixel, but enough to be accurate. A screen of thin
> vertical lines might make it past the detection, but that's a fringe case.
>
> --
> Chris
> _______________________________________________
> mythtv-dev mailing list
> mythtv-dev [at] mythtv
> http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev
>

_______________________________________________
mythtv-dev mailing list
mythtv-dev [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev


cpinkham at bc2va

Feb 28, 2008, 10:36 PM

Post #38 of 55 (6696 views)
Permalink
Re: Patch to autodetect 4:3 Zoom aspect ratio [In reply to]

* On Thu Feb 28, 2008 at 10:54:13PM -0700, Justin wrote:
> This would likely work as long as you know where the cut offs should
> be. If not what happens if the screen has a few black lines at the
> bottom because it is a dark part of the scene? One thing that would
> help prevent this would be to look over a couple frames and not a single
> frame. Or what if the TV icon goes over into the black bars?

The cut offs can be calculated based on the various aspect ratios that
you might find. The commercial flagger doesn't need to know about
the different aspects, it just detects differences between full, pillar,
and letter (boxed).

The commercial flagger also ignores the area where the logo was found if it
finds one.

--
Chris
_______________________________________________
mythtv-dev mailing list
mythtv-dev [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev


mabo at mochc

Feb 29, 2008, 4:22 AM

Post #39 of 55 (6699 views)
Permalink
Re: Patch to autodetect 4:3 Zoom aspect ratio [In reply to]

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
black.

**********************************************************************************
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.

Mårten

On Thu, Feb 28, 2008 at 3:05 PM, aaron <memoryguy [at] gmail> wrote:
> On 2/27/08, Mårten Bohlin <mabo [at] mochc> 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
> http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev
>
Attachments: detectLetterboxV4-21fixes.patch (13.8 KB)


mabo at mochc

Feb 29, 2008, 4:34 AM

Post #40 of 55 (6702 views)
Permalink
Re: Patch to autodetect 4:3 Zoom aspect ratio [In reply to]

>
> http://miffteevee.co.uk/imagebin/letterbox_debug.jpg
>
> This format generally works best with the 'Full' fill.
> --
> Stuart Morgan


I understand you but I do not agree. Since I will only see half of my
subtitle. But to make everybody happy I have made it possible to
adjust where the detection lines should be in the latest version of my
patch (detectLetterboxV4-21fixes.patch). But it is not possible to
change this from the settings screen yet. So either add
"DetectLetterboxLimit" to your settings table or on the command line.

mythfrontend -O DetectLeterboxLimit=40

This should be set to something between 0 and 100 and it is the
percentage of the part of the image that will be "hidden" that has to
be black when it switch to Full fill. The default is 70.

If anybody has a good suggestion on what to call this parameter, let me know.

Mårten
_______________________________________________
mythtv-dev mailing list
mythtv-dev [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev


mabo at mochc

Feb 29, 2008, 4:58 AM

Post #41 of 55 (6707 views)
Permalink
Re: Patch to autodetect 4:3 Zoom aspect ratio [In reply to]

To answer the original question my detection is verry naive. The first
implementation just checked two lines on the screen (The vertical
lines you can see on the debug output
http://www.mochc.net/myth-dev/LetterBoxDebugg.jpg). And then it checks
that the detected image is on a horizontal line. And this has to occur
in three consecutive frames. If a pixel is "black" or not was only a
threshold on the Y component in the YVU.

The latest version of the patch checks that the brightness(Y) do not
change to much instead of just using a threshold.

So yes there is a lot of things that could be done to make it at least
theoretically better.

But I think what would make the biggest differens was if you could
look one minute in to the future, but since I would like my algorithm
to work in Live TV.

Mårten

On Fri, Feb 29, 2008 at 6:54 AM, Justin <luitjens [at] cs> wrote:
> This would likely work as long as you know where the cut offs should
> be. If not what happens if the screen has a few black lines at the
> bottom because it is a dark part of the scene? One thing that would
> help prevent this would be to look over a couple frames and not a single
> frame. Or what if the TV icon goes over into the black bars?
>
> Justin
>
>
>
>
> Chris Pinkham wrote:
> > * On Thu Feb 28, 2008 at 10:59:54AM -0700, Justin wrote:
> >
> >> What is the edge detection algorithm you are using? Moving to a more
> >> sophisticated algorithm could prevent false detections.
> >>
> >
> > I haven't looked at his code, but what more is required other than "all lines
> > above this are black, the next is not" and vice versa for the bottom bar.
> > That's what I did in the commercial flagging code does to detect the letter
> > and pillar boxes. In order to make things faster, the commercial flagger
> > doesn't check every pixel, but enough to be accurate. A screen of thin
> > vertical lines might make it past the detection, but that's a fringe case.
> >
> > --
> > Chris
> > _______________________________________________
> > mythtv-dev mailing list
> > mythtv-dev [at] mythtv
> > http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev
> >
>
> _______________________________________________
> mythtv-dev mailing list
> mythtv-dev [at] mythtv
> http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev
>
_______________________________________________
mythtv-dev mailing list
mythtv-dev [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev


mabo at mochc

Feb 29, 2008, 5:00 AM

Post #42 of 55 (6704 views)
Permalink
Re: Patch to autodetect 4:3 Zoom aspect ratio [In reply to]

I agree that this woud be a better solution for recorings. But I will
not look in to it myself (atleast not for the moment).

Mårten

On Thu, Feb 28, 2008 at 9:09 PM, aaron <memoryguy [at] gmail> wrote:
> On 2/28/08, Chris Pinkham <cpinkham [at] bc2va> wrote:
> >
> > Yes, the flagger detects both physical aspect changes in the recording as
> > well as letter/pillarboxing. It would be fairly easy for someone to modify
> > it to write out this data to the recordedmarkup table so that information
> > could be used later during playback.
> >
>
> I'd love to tackle this, but I've no doubt that by the time I actually
> get enough time to dedicate to it an infinite number of monkeys could
> come up with a patch too. :)
>
>
> --
> 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
> http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev
>
_______________________________________________
mythtv-dev mailing list
mythtv-dev [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev


mabo at mochc

Feb 29, 2008, 5:04 AM

Post #43 of 55 (6703 views)
Permalink
Re: Patch to autodetect 4:3 Zoom aspect ratio [In reply to]

On Wed, Feb 27, 2008 at 6:33 PM, Matt S. <skd5aner [at] gmail> wrote:

> Cool, and very useful, feature! I would recommend opening a ticket in
> trac and submitting this as an enhancement. Even though it's not
> quite ready for inclusion, you can at least keep track of your patches
> and process in a ticket so that when it is ready it can be considered
> for inclusion.
> Thanks!
> Matt
>

OK. I will await the feedback from my latest patch and then open a ticket.

Mårten
_______________________________________________
mythtv-dev mailing list
mythtv-dev [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev


stuart at tase

Feb 29, 2008, 5:24 AM

Post #44 of 55 (6698 views)
Permalink
Re: Patch to autodetect 4:3 Zoom aspect ratio [In reply to]

On Friday 29 February 2008 12:34:54 Mårten Bohlin wrote:
> > http://miffteevee.co.uk/imagebin/letterbox_debug.jpg
> >
> > This format generally works best with the 'Full' fill.
> > --
> > Stuart Morgan
>
> I understand you but I do not agree. Since I will only see half of my
> subtitle.

I can live with that format at half fill, even though it will still be
pillarboxed. The problem right now is that it's not even switching to half
fill. I'll take a look at the code though.

> But to make everybody happy I have made it possible to
> adjust where the detection lines should be in the latest version of my
> patch (detectLetterboxV4-21fixes.patch). But it is not possible to
> change this from the settings screen yet. So either add
> "DetectLetterboxLimit" to your settings table or on the command line.

I don't think we need a setting for this, it should be possible to pick good
values and build in some flexibility so that it works for 95% of cases. We
just need plenty of examples to build up these rules.

--
Stuart Morgan
_______________________________________________
mythtv-dev mailing list
mythtv-dev [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev


stuart at tase

Feb 29, 2008, 6:08 AM

Post #45 of 55 (6696 views)
Permalink
Re: Patch to autodetect 4:3 Zoom aspect ratio [In reply to]

On Friday 29 February 2008 13:24:34 Stuart Morgan wrote:
> I can live with that format at half fill, even though it will still be
> pillarboxed. The problem right now is that it's not even switching to half
> fill. I'll take a look at the code though.

Ok, I'd change it so that instead of forcing either half or full fill, we
chose the fill type based on the percentage.

0-15 = Off, 15-70 = Half Fill, 70+ = Full Fill

I've picked the figures at random and they will probably need adjusting.

I'm not sure what the "AutoDetect (Default Half)" is for? Probably wouldn't be
needed if the above scheme is used?
--
Stuart Morgan
_______________________________________________
mythtv-dev mailing list
mythtv-dev [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev


mabo at mochc

Feb 29, 2008, 6:34 AM

Post #46 of 55 (6712 views)
Permalink
Re: Patch to autodetect 4:3 Zoom aspect ratio [In reply to]

On Fri, Feb 29, 2008 at 3:08 PM, Stuart Morgan <stuart [at] tase> wrote:
> On Friday 29 February 2008 13:24:34 Stuart Morgan wrote:
> > I can live with that format at half fill, even though it will still be
> > pillarboxed. The problem right now is that it's not even switching to half
> > fill. I'll take a look at the code though.
>
> Ok, I'd change it so that instead of forcing either half or full fill, we
> chose the fill type based on the percentage.
>
> 0-15 = Off, 15-70 = Half Fill, 70+ = Full Fill
>
> I've picked the figures at random and they will probably need adjusting.
>
> I'm not sure what the "AutoDetect (Default Half)" is for? Probably wouldn't be
> needed if the above scheme is used?
>
The "AutoDetect (Default Half)" is there because in the beginning of
this thread Petr wished to be able to view 4:3 content at half fill
and 16:9 content in
full. So on his request I made it configurable.

Mårten
_______________________________________________
mythtv-dev mailing list
mythtv-dev [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev


skd5aner at gmail

Feb 29, 2008, 10:37 AM

Post #47 of 55 (6680 views)
Permalink
Re: Patch to autodetect 4:3 Zoom aspect ratio [In reply to]

On Thu, Feb 28, 2008 at 10:56 PM, Chris Pinkham <cpinkham [at] bc2va> wrote:
> * On Thu Feb 28, 2008 at 10:59:54AM -0700, Justin wrote:
> > What is the edge detection algorithm you are using? Moving to a more
> > sophisticated algorithm could prevent false detections.
>
> I haven't looked at his code, but what more is required other than "all lines
> above this are black, the next is not" and vice versa for the bottom bar.
> That's what I did in the commercial flagging code does to detect the letter
> and pillar boxes. In order to make things faster, the commercial flagger
> doesn't check every pixel, but enough to be accurate. A screen of thin
> vertical lines might make it past the detection, but that's a fringe case.
>
> --
> Chris


Chris - good thoughts, but wouldn't this be a problem for LiveTV?
Also, sometimes you want to watch commericals (i.e., superbowl) and
some are filmed in letterbox and some in 4x3. In both those cases,
wouldn't the autodetection have to be dynamic enough to basically do
real-time analysis? The commerical detection code doesn't do anything
besides find commercials, so it definitely could work for that short
period of time.

Another use case I've found from time to time is that content within a
16x9 program will sometimes deliver 4x3 content randomly. I think
Extreme Home Makeover does that, along with several documentary type
shows.

Thanks!
Matt
_______________________________________________
mythtv-dev mailing list
mythtv-dev [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev


brad+mydev at templetons

Mar 3, 2008, 10:02 AM

Post #48 of 55 (6582 views)
Permalink
Re: Patch to autodetect 4:3 Zoom aspect ratio [In reply to]

> Chris - good thoughts, but wouldn't this be a problem for LiveTV?
> Also, sometimes you want to watch commericals (i.e., superbowl) and
> some are filmed in letterbox and some in 4x3. In both those cases,
> wouldn't the autodetection have to be dynamic enough to basically do
> real-time analysis? The commerical detection code doesn't do anything
> besides find commercials, so it definitely could work for that short
> period of time.
>
> Another use case I've found from time to time is that content within a
> 16x9 program will sometimes deliver 4x3 content randomly. I think
> Extreme Home Makeover does that, along with several documentary type
> shows.
>

Yes, there is a lot of variation. Of course you will regularly
see 4:3 commercials in widescreen content, and you even see 16:9
(letterbox) commercials mapped into 4:3, and then re-mapped to 16:9
to give both the letterbox (top/bottom bars) and pillarbox (side bars.)

Now I personally don't use zoom much on SDTV letterbox because it
exposes the pixels and other inadequacies of SDTV too much.

However, there is another useful application of pillarbox/letterbox
detection. That would be to have the OSD aware of this detection,
and have it move the OSD information into the black bars, so that
they do not cover the program. Likewise the captioning engine.
Indeed, in that situation you could also code a "full time" OSD
for use in this situation. (Right now the OSD engines are done
into the video window so they can't easily go into the myth
generated pillarbox of SDTV, or at least that was the case last time
I looked.)
_______________________________________________
mythtv-dev mailing list
mythtv-dev [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev


memoryguy at gmail

Mar 3, 2008, 10:36 AM

Post #49 of 55 (6561 views)
Permalink
Re: Patch to autodetect 4:3 Zoom aspect ratio [In reply to]

On 2/29/08, Mårten Bohlin <mabo [at] mochc> wrote:
> Time for a new version of the patch.
>
> 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
> black.
>

This version works quite well. Thanks for this feature :) I had
actually been thinking about it mere days before you originally posted
it.

It still has some interesting behaviours on some shows, but I
definitely find it good enough.

And it is able to correctly zoom on the Stargate Atlantis recording
that it had problems with before.

If I ever get some free time I'd still like to try to see if I can
hook it into the letterbox detection from the commflagger, but it's
definitely going to be a while before I can get to it...

--
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
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev


mark.buechler at gmail

Mar 4, 2008, 10:27 AM

Post #50 of 55 (6558 views)
Permalink
Re: Patch to autodetect 4:3 Zoom aspect ratio [In reply to]

Hi

On Mon, Mar 3, 2008 at 1:36 PM, aaron <memoryguy [at] gmail> wrote:

> On 2/29/08, Mårten Bohlin <mabo [at] mochc> wrote:
> > Time for a new version of the patch.
> >
> > 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
> > black.
> >
>
> This version works quite well. Thanks for this feature :) I had
> actually been thinking about it mere days before you originally posted
> it.
>
> It still has some interesting behaviours on some shows, but I
> definitely find it good enough.
>
> And it is able to correctly zoom on the Stargate Atlantis recording
> that it had problems with before.
>
> If I ever get some free time I'd still like to try to see if I can
> hook it into the letterbox detection from the commflagger, but it's
> definitely going to be a while before I can get to it...
>
> --
> 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
> http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev
>

I've been testing this for the past few days and have to say, for me, it
works extremely well. I haven't found an occasion where black borders were
not correctly identified. I did have to set the limit from 70 to 60,
however.

- Mark.

First page Previous page 1 2 3 Next page Last page  View All MythTV dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.