[mythtv] automatic 14:9 or 4:3 zoom based on black bars detection?

Petr Stehlik pstehlik at sophics.cz
Sun Jun 25 17:47:41 UTC 2006


Daniel Kristjansson píše v Ne 25. 06. 2006 v 11:41 -0400:
> > Now I'd like to automate the switching between the zoom modes. First, if
> > the source is in 4:3 format then I'd like to enable the 14:9 Zoom by
> > default. Could someone please suggest a place in the source code to
> > check for the input format and to enable/disable the zoom?
> There isn't a place for this. There are three distinct reasons
> why people use the aspect ratio overrides.
>  1/ For coping with material that misreports the aspect ratio;
>     or does not report it at all and uses non-square pixels.
>     This would never be a 14:9 aspect ratio BTW, as we are 
>     refering to the aspect ration of the transmission including
>     the black bars.
>  2/ For zooming into material simply as you do ( and I do ).
>     "Proper Zoom"
>  3/ For filling the screen with video when the aspect ratio
>     of the source material does not fit the display aspect ratio.
>     This results in either lost portions of the image, or the
>     improper aspect ratio; but this is the desired result.
>     "Improper Zoom"

right.

> So before you do any auto-zoom work or add 14:9 zoom you would
> want to separate out the proper zoom portion (#2) of the "aspect
> ratio overrides" into a new setting.

OK

So 1/ would be 

- keep original aspect ratio
- set aspect ratio to 4:3
- set aspect ratio to 16:9

2/ would be

- no zoom
- partial zoom (currently named 14:9)
- max zoom (currently named "4:3 Zoom" or "16:9 Zoom")

3/ would be

- keep original
- fill the screen ignoring the original aspect ratio

- I could think of "fill the screen vertically while keeping the aspect
ratio" and "fill the screen horizontally" but that's basically what the
"4:3 zoom is trying to achieve", I think, so it could be part of the
proper zooming.

Anyway, what I'd like to do now is to hack Myth to detect that if I
switch to a new channel that is 4:3 then I want the 14:9 Zoom to get
preset. So if you could suggest a place in the replay routine that is
run after source change (or better yet after source aspect ratio change)
I'd try to put the preset there.

BTW: a note to current 'change aspect ratio' setting in MythTV: Myth
detects all changes in aspect ratio both when changing channels and
in-channel changes perfectly but as soon as I select say "4:3 Zoom" then
this zoom is preset even when I switch to another channel that is 16:9,
for example. I think it shouldn't be this way - when I go to channel
with different AR the zoom should go back to default, I think.

BTW2: related to previous: there is no option in the MythTV menu
(play.cpp I think) to go back to "automatic aspect ratio changes" or
basically to "no aspect ratio override".

> > Is it possible (and cheap) to detect the black bars?
> Depends on where you are. In the image preview or the commercial
> detector it is easy. You have an image to work with of a frame,
> unlike in the frontend when you wouldn't always have access to
> this.

so it would have to be preprocessed like the commercial detection. Hmm.
Maybe in the almost-real-time mode it would be fine. But since I don't
use the commflagging yet I am not going to work on this.

Petr




More information about the mythtv-dev mailing list