Use the ViewModeSwitcher plugin to auto detect and remove black bars in videos without cropping subtitles.
Many TV broadcasts are still in 4: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 16: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.
How does it work?
- It uses the video aspect ratio and size information to automatically change the[ Zoom Mode|2_TV_Zoom] to a mode you select.
- It does this by comparing the video information with a set of rules (which can be changed by the user).
- If the aspect ratio and the video size match one of the rules, it then changes the current Zoom mode to the one in the rule.
- It can (optionally) also search the video content for Black Bars at the sides or top and bottom of the picture. This can be enabled on a per-rule basis (so you can enable it for SD but not HD content, for example).
- The Black Bar detection can either be continuous (every second) or triggered once when play is started (or after a TV channel change).
- If it finds black bars, it will try and remove (crop) them without removing too much of the actual picture content.
- There are special rules (which have negative 'AR From' and 'AR To' settings) which allow you to choose a Zoom Mode for Letter Boxed and_Pillar Boxed_ video. These special rules are only used if Black Bar detection is enabled.
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
Video Aspect Ratio (AR)
AR From, AR To: ViewModeSwitcher checks if the video aspect ratio is between the From and To values.
Video Width and Height
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.
Initial BB detect
Init BB Det: Enables a single-shot Black Bar detection just after start of play and after every channel change for TV.
Continuous BB detect
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.
Maximise BB cropping
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.
Show message when rule is applied
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.
Use fallback rule if no match found
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).
Black Bar (BB) detection options
Disabling black bar detection means that only the video's aspect ratio will be used to determine the zoom mode to activate.
Backup and Restore Settings
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.
Enable verbose logging
Used when extra logging is needed for troubleshooting. ViewModeSwitcher logs are saved in
Disable for non-TV
Select this option if you only wish to use ViewModeSwitcher for live TV and TV recordings.
Disable BB detect for non-TV
Select this option if you only wish to use Black Bar detection when playing live TV and TV recordings.
Black Bar (BB) detection options
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
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).
Controlling ViewModeSwitcher in MediaPortal
There are two actionskey which can be mapped to a remote control or keyboard key:
Request new single-shot black bar detection
Toggle detection mode: off/auto - mapped toby default
This page has no comments.