Use the ViewModeSwitcher plugin to auto detect and remove black bars in videos without cropping subtitles.
Many TV broadcasts are still in 3 aspect ratio, and quite frequently wide screen movies are broadcast letter boxed, meaning that 50% or more of each video frame is taken up by black bars. If this is viewed on a 9 (wide screen) display in MediaPortal's Normal zoom mode, you will see additional black bars right and left of the video, even though the actual video content fits (or nearly fits) your display.
Zoom mode solves this issue if you are lucky, but if subtitles are shown in the black bars, they will be cropped. The ViewModeSwitcher plugin attempts to solve this by auto-detecting the black bars and removing as much of them as possible without cropping subtitles.
If watching a 4:3 video on a 16:9 display, we normally get black borders on the sides:

ViewModeSwitcher can automatically change to a configurable mode. For example if Zoom view mode is used you eliminate the black bars however parts of the image may be removed:

ViewModeSwitcher is a process plugin. That means it does not have any user interface within MediaPortal. It works behind the scenes.
First, select Plugins in MediaPortal Configuration then select the ViewModeSwitcher plugin.

Use the Enable/Disable toggle button to enable or disable the plugin (or double click the icon).
Use the Config button to open ViewModeSwitcher's configuration window.
On the top part of the configuration window is the rules grid. When playing a video, MediaPortal will process the rules from top to bottom and set a Zoom Mode once a match is found.
The default settings are optimized for 16:9 widescreen displays with auto black bar detection for SD content enabled (and letterbox/pillarbox detection), but disables it for HD content since it can cause stuttering on low performance systems.
The last two rules (4:3 inside 16:9 and 16:9 inside 4:3) with negative AR From and AR To values are only used when pillarbox (left/right bars) or letterbox (top/bottom bars) are detected. These allow you to select a view mode for these situations e.g. NonLinearStretch for 4:3 inside 16:9, or Zoom14to9 for 16:9 inside 4:3.
To create a new rule, press Add New Rule. The new rule will be placed at the bottom of the list and contains some default values which can be modified by selecting the rule and clicking Modify Selected.
Below is an example of the rule 4:3 SD
AR From, AR To: ViewModeSwitcher checks if the video aspect ratio is between the From and To values.
Width From, Width To: ViewModeSwitcher checks if the video width is between the From and To values.
Height From, Height To: ViewModeSwitcher checks if the video height is between the From and To values.
ZoomMode: Which ZoomMode to use for this rule.
Overscan: How many pixels to crop from the edges of the picture as a minimum.
Init BB Det: Enables a single-shot Black Bar detection just after start of play and after every channel change for TV.
Cont BB Det: If this option is checked, then Black Bar detection will be performed every second. If unchecked, then Black Bar detection will only be performed once after start-of-play or a TV channel change.
MaxCrop: Maximize the Black Bar cropping, i.e. allow it to crop up to 12% from the good picture to enable more black bar to be removed.
When this option is selected, a dialog will be displayed during video playback in MediaPortal.

In this case the zoom mode was changed to Zoom14to9 since the video matched the rule 4:3 SD. Aspect Ratio 1,33333333333333 is another way of writing 4:3.
If ticked - when no rule matches the video aspect ratio and frame size, the Fallback ZoomMode and Fallback overscan settings are used (and Black Bar detection is disabled).
Disabling black bar detection means that only the video's aspect ratio will be used to determine the zoom mode to activate.
Click Load Defaults to restore all ViewModeSwitcher's settings to its default values. Export and Import Settings can be used to save all settings, for example, before reinstalling MediaPortal or when moving to another computer.
Select the checkbox Show Advanced Settings to see all available options.
Used when extra logging is needed for troubleshooting. ViewModeSwitcher logs are saved in
MediaPortal.log |
.
Select this option if you only wish to use ViewModeSwitcher for live TV and TV recordings.
Select this option if you only wish to use Black Bar detection when playing live TV and TV recordings.
Detection interval (0.25s units) This value controls how often ViewModeSwitcher should check for black bars (when continuous black bar detection is enabled). Default is
4 |
meaning once per second. Processing - MaxCrop limit (%) If 'Maximise BB cropping' is enabled, this value is the limit for how much 'good' picture can be cropped in order to maximise the black cropping. Default is 12%. Processing - Symmetry check limit (%) To minimise false black bar detections, it compares the width of the left/right and height of the top/bottom detected black bars. If left = right and top = bottom within the 'Symmetry check limit' percentage allowance, the detection is 'good'. Default is 10% Search limits (% of frame size) - Left/right height (%)
Search limits (% of frame size) - Top/bottom width (%) To avoid logos etc. affecting the black bar detection, the detection scanning area covers only the 'Search Limit' percentage height (for the left/right bar detection) and 'Search Limit' percentage width (for the top/bottom bar detection) of the video frame size i.e. the corners are ignored. Defaults are 40%. Black level thresholds - For single pixels Black bar detection works by analysing horizontal picture lines/vertical picture columns near the edges of the picture, checking if any pixel in a line/column is above this threshold. If true then that line/column is regarded as 'good' picture (not black). Default is 32 (range is 4 - 255). Black level thresholds - For 25% of pixels Black bar detection works by analysing horizontal picture lines/vertical picture columns near the edges of the picture, checking if 25% of the pixels in a line/column are above this threshold. If true then that line/column is regarded as 'good' picture (not black). Default is 16 (range is 4 - 255).
There are two actionskey which can be mapped to a remote control or keyboard key:
ACTION_AUTOCROP |
ACTION_TOGGLE_AUTOCROP |
by defaultIssue #: |
|
|---|---|
Issue Component: |
Plugins |
Type of Change: |
Rework |
Related Wiki page(s): |
Configuration Tools > MediaPortal Configuration > Plugins > ViewModeSwitcher |
Author: |
Owlsroost |
Date added: |
Fri, 12 Jul 2013 |