Hi all.
Users of the "old" TV engine should read the hint about the rule configuration!
Short description:
The idea of ViewModeSwitcher was to help MediaPortal (connected to a wide screen) to handle all kind of signals (4:3, fake 16:9 (letterbox) and 16:9) without change the zoom mode via remote all the time.
Longer description:
First I want to send big thanks to the development team of MediaPortal and of course to everyone else who helps to improve this project every day. A special thanks goes to ziphnor, the author of the autocropper plugin. ViewModeSwitcher is based on his idea of implementation. I am currently in the planning phase of a HTPC came to the conclusion, that MediaPortal is the most flexible and interesting way to go.
I developed the ViewModeSwitcher plugin to create a higher WAF (Woman Acceptance Factor), because my flat screen as an Option to predefine a zoom mode for 4:3 broadcasts. That means that you can choose which zoom mode (14:9, Smartzoom, wide or just plain 4:3) is used per default if a 4:3 signal is detected. My wife (and my self as well) loved this function because we don’t like to watch television with black bars on the left and right side. Of course the flat screen itself does not see any changes from 4:3 to 16:9 if it is connected to a HTPC... So I have to build this functionality inside of MediaPortal.
Maybe someone else will find this plugin useful as well.
ViewModeSwitcher offers:
The detection of aspect ratio changes requires a codec that supports it (i.e. DScaler, PureVideo, Cyberlink PowerDVD).
The behaviour of ViewModeSwitcher is based on a ruleset, that can be defined in the configuration.
The configuration for my “4:3 PAL” rule that switches automatically to “Stretch” for example looks like this: (notice the new letterbox option!)
If you are not sure which values you have to use, you can look in the MediaPortal.log. If the logging is set at “Information” level, you should find something like this (after the playback as started).
[Info.][5]: PlaneScene: video WxH : 768x576
[Info.][5]: PlaneScene: video AR : 768:576
The Aspect Ratio is calculated by using the AR values and divide the width through the height. 768/576 = 1.3333333333333333333333333333333
This is how a normal PAL 4:3 broadcast should look like.
A 16:9 PAL broadcast may look like this:
PlaneScene: video WxH : 1024x576
PlaneScene: video AR : 1024:576
1024/576 = 1.7777777777777777777777777777778
Attention! With RC2 of MediaPortal these values are now a bit different! Now they are 4:3 or 16:9. But under the line these values lead to the same results... 4/3 = 1.3333333333333333333333333333333 and 16/9 = 1.7777777777777777777777777777778...
This is how my 16:9 PAL rule looks like:
These two rules together are doing a decent job for me. But leave HDTV untouched.
Users of the old TV engine have to do some changes to the rule mentioned above.
If you switch MediaPortal into the "Debug" log mode, you will see something like:
[Debug][ViewModeSwitcherThread]: VideoAspectRatioX 768
[Debug][ViewModeSwitcherThread]: VideoAspectRatioY 576
[Debug][ViewModeSwitcherThread]: VideoWidth 0
[Debug][ViewModeSwitcherThread]: VideoHeight 0
That means that the old TV engine does not provide the values of width and height the same way like the normal media player does (the one that the new engine uses). Because of this you have to change your rules to tolerate this by settings the values of min and max width and height to 0. You still need the original rules if the plugin should help you under myVideo.
Letterbox detection
Letterbox detection requires analysing of the content of a broadcast. With other words... the plug grapps a frame from the stream and analyses if it contains black bars in the upper and/or lower part. Of course this is a process which requires processing power (CPU) and should only be activated if your system has enough idle time left during the playback of TV streams.
If you have designed a rule with enabled letterbox detection (normally a 4:3 rule) you can configure the following options.
This version is tested under MyVideo and the MyTVPlugin (TV engine 0.3) with the lastest SVN.
It is also tested width the old TV engine. Read the hint above!
New in version 0.3:
Known problems:
The plugin can be found in the plugin repository.
Here is the link: MEDIAPORTAL - free media center - ViewModeSwitcher 0.3.1
Attached to this thread you can find a 1.1.0Alpha and up compatible version (TVE2 reference removed)
I hope you like it.
Bye
Lars
Users of the "old" TV engine should read the hint about the rule configuration!
Short description:
The idea of ViewModeSwitcher was to help MediaPortal (connected to a wide screen) to handle all kind of signals (4:3, fake 16:9 (letterbox) and 16:9) without change the zoom mode via remote all the time.
Longer description:
First I want to send big thanks to the development team of MediaPortal and of course to everyone else who helps to improve this project every day. A special thanks goes to ziphnor, the author of the autocropper plugin. ViewModeSwitcher is based on his idea of implementation. I am currently in the planning phase of a HTPC came to the conclusion, that MediaPortal is the most flexible and interesting way to go.
I developed the ViewModeSwitcher plugin to create a higher WAF (Woman Acceptance Factor), because my flat screen as an Option to predefine a zoom mode for 4:3 broadcasts. That means that you can choose which zoom mode (14:9, Smartzoom, wide or just plain 4:3) is used per default if a 4:3 signal is detected. My wife (and my self as well) loved this function because we don’t like to watch television with black bars on the left and right side. Of course the flat screen itself does not see any changes from 4:3 to 16:9 if it is connected to a HTPC... So I have to build this functionality inside of MediaPortal.
Maybe someone else will find this plugin useful as well.
ViewModeSwitcher offers:
- switching to a defined viewmode (Stretch,14:9 etc.) depending on parameters like the video aspect ratio and the video width and height. This is a feature that maybe more interesting to uses of a wide screen, like my self.
- switching automatically to the"zoom" mode if a letterbox (fake 16:9) broadcast is detected. Most useful for wide screen users as well.
- set an overscan value (crop the picture) depending on parameters like the video aspect ratio and the video width and height. That makes it possible to define an overscan for SD broadcast and records, but leave HDTV untouched.
The detection of aspect ratio changes requires a codec that supports it (i.e. DScaler, PureVideo, Cyberlink PowerDVD).
The behaviour of ViewModeSwitcher is based on a ruleset, that can be defined in the configuration.
The configuration for my “4:3 PAL” rule that switches automatically to “Stretch” for example looks like this: (notice the new letterbox option!)
If you are not sure which values you have to use, you can look in the MediaPortal.log. If the logging is set at “Information” level, you should find something like this (after the playback as started).
[Info.][5]: PlaneScene: video WxH : 768x576
[Info.][5]: PlaneScene: video AR : 768:576
The Aspect Ratio is calculated by using the AR values and divide the width through the height. 768/576 = 1.3333333333333333333333333333333
This is how a normal PAL 4:3 broadcast should look like.
A 16:9 PAL broadcast may look like this:
PlaneScene: video WxH : 1024x576
PlaneScene: video AR : 1024:576
1024/576 = 1.7777777777777777777777777777778
Attention! With RC2 of MediaPortal these values are now a bit different! Now they are 4:3 or 16:9. But under the line these values lead to the same results... 4/3 = 1.3333333333333333333333333333333 and 16/9 = 1.7777777777777777777777777777778...
This is how my 16:9 PAL rule looks like:
These two rules together are doing a decent job for me. But leave HDTV untouched.
Users of the old TV engine have to do some changes to the rule mentioned above.
If you switch MediaPortal into the "Debug" log mode, you will see something like:
[Debug][ViewModeSwitcherThread]: VideoAspectRatioX 768
[Debug][ViewModeSwitcherThread]: VideoAspectRatioY 576
[Debug][ViewModeSwitcherThread]: VideoWidth 0
[Debug][ViewModeSwitcherThread]: VideoHeight 0
That means that the old TV engine does not provide the values of width and height the same way like the normal media player does (the one that the new engine uses). Because of this you have to change your rules to tolerate this by settings the values of min and max width and height to 0. You still need the original rules if the plugin should help you under myVideo.
Letterbox detection
Letterbox detection requires analysing of the content of a broadcast. With other words... the plug grapps a frame from the stream and analyses if it contains black bars in the upper and/or lower part. Of course this is a process which requires processing power (CPU) and should only be activated if your system has enough idle time left during the playback of TV streams.
If you have designed a rule with enabled letterbox detection (normally a 4:3 rule) you can configure the following options.
- Disable letterbox detection globally: If this value is enabled letterbox detection is disabled even if it its set in a rule.
- Check interval: Sets the frequency how often the plugin is checking for letterbox broadcasts. Because the detection is CPU demanding, this value should not chosen to low.
- The zoom is changes after x ....: This value defines how often the plugin has to analyse a signal with same letterbox result. Before its is allowed to changed the zoom mode. This option makes the detection much more reliable, but increases the time that is required to detect a letterbox signal. If you want to change the mode directly after the first detection set this value to 1.
- Black level tolerance: Black is not always black. Here you can define how black the "black bars" have to be. 0 is absolutely dark, 1 is absolutely bright. the default is 0.1
- Upper and Lower box checkboxes: Allow you to choose which area of the picture is analysed by the plugin. The most reliable setting is enable both, but that requires more CPU power.
- The 8 percent values let you choose the position of the rectangles to analyse.
This version is tested under MyVideo and the MyTVPlugin (TV engine 0.3) with the lastest SVN.
It is also tested width the old TV engine. Read the hint above!
New in version 0.3:
- Some bug fixes.
- Fallback rule added (ViewModeSwitcher can now fallback to a predefined zoom mode if no rule fits)
- New option to rescan the rules after channel change. (This also resets the letterbox detection)
- Import/Export functions for the complete plugin settings. Makes it easier to exchange settings via the forum.
- MPI setup routine.
- configuration icon.
Known problems:
- No known issues at the moment
The plugin can be found in the plugin repository.
Here is the link: MEDIAPORTAL - free media center - ViewModeSwitcher 0.3.1
Attached to this thread you can find a 1.1.0Alpha and up compatible version (TVE2 reference removed)
I hope you like it.
Bye
Lars