Fork MediaPortal on GitHub

Auto3D plugin for MediaPortal 1.2 - 1.9 (GUI & TV/Beamer)

Discussion in 'MediaPortal 1 Plugins' started by Marcus Venturi, February 18, 2013.

  1. Marcus Venturi
    • Super User

    Marcus Venturi

    System Specs
    [​IMG]

    There is also a german thread: http://forum.team-mediaportal.com/threads/auto3d-plugin-für-mediaportal-1-2-1-6-gui-tv-beamer.123788/#post-1052172

    Short Description:

    If you start a 3D movie this plugin will recognize it and switch the MediaPortal GUI into a 3D capable mode. Additionally your TV is - if supported - automatically switched into 3D mode. At the end of the movie TV and GUI are automatically switched back to 2D mode. No more fumbling with additional remotes, that's the goal of this plugin.

    The primary features of this plugin:
    1. At the start of a 3D Video, the MediaPortal GUI is switched into a special 3D-Mode. All menus and screens remain readable. No more not seeing the progress indicator while doing fast forward in a 3D Video. This works independent from any skin hacks with every existing MediaPortal skin.
    2. If you are an owner of a supported TV or Beamer, Auto3D will also switch your TV or Beamer into the 3D mode without any user interaction. If the film stops, the TV is switched back to 2D mode. Support for Philips, Samsung, Sony, Panasonic, LG TVs and Epson Beamers is integrated, but not testet with all models.
    3. Convert a 3D movie on the fly into 2D mode. This enables you to watch a 3D movie on a 2D TV. It is also possible to set this a default.
    4. MediaPortal is not able to show 3D wide screen movies with Top and Bottom format correct. The plugin fixes this problem and many more.
    5. Subtitles are converted into 3D while you are watching a movie. You don't need any 3D subtitle generators anymore. The depth (=distance from screen) of the subtitles is adjustable.
    6. EventGhost is supported. Every mode switch between the various 2D and 3D formats will generate an Event in EventGhost.
    7. It is possible to view 3D reverse movies, where left/right or top/bottom image are in reverse order, even if your TV doesn't support that. Just switch to 3D reverse mode and Auto3D reverses the Images for your TV.
    8. ViewmodeSwitcher correction for 3D movies. Stretching 3D movies with ViewModeSwitcher is now possible. The image halfs will always fit together.

    An example of the progress indicator that now 3D safe (Side by Side):
    [​IMG]

    The same movie in Top and Bottom. Progress indicator is correct:
    [​IMG]

    Event the mini display shows the 3D movie correct (Side by Side):
    [​IMG]

    The 3D effect in the mini windows is really funny :)

    The GUI details

    The MediaPortal GUI by default is not 3D capable. As soon as you look a 3D movie the complete GUI gets destroyed by your TV and looks very strange.

    This happens because in 3D mode the TV expects two images he can somehow combine to a 3D image. If you play such a movie fullscreen your're safe. But as soon as parts of the MediaPortal GUI get visible - in most cases you notice this when changing volume or doing fast forward or something like that - you will see a very strange effect. This is because MediaPortal does not provide 2 images.

    So I altered some of the display code in the MediaPortal core to be able to provide the 2 necessary images for the 3D mode. This works for all available 3D modes and can be switched on the fly.

    Originally the plugin was only intended to automatically switch a TV into 3D mode when starting a 3D movie, but now the plugin can also switch the GUI.

    As soon as the Plugin recognizes that the core is capable of providing a 3D aware GUI, it switches the GUI into 3D mode when a 3D movie is started and back into 2D mode if the movie is stopped.

    The TV details

    Many TVs need to be switched manually into 3D mode. Sometimes BluRay players are able to switch the TV over a HDMI-CEC (=consumer electronics control) command, but this won’t work with a PC, as no graphic controller does support that.

    Beyond any solutions with HDMI CEC adaptors working over USB there are 2 simple approaches supported by this plugin:
    • Control API of the TV
    • Control over USB-IR controller via EventGhost
    Many recent Smart TVs provide an API to access the TV remote. As I’m an owner of a Philips 55PFL7606K/02 (a model from 2011) in the first step I decided to provide a solution for this one. But the plugin is able to support other TVs and Beamers as well.

    The following TVs / Beamers are supported at the moment:
    • Philips (jointSpace / DiVine)
    • Samsung (Series 6 and above)
    • Sony Bravia
    • Panasonic VIErA
    • LG 2011 and 2012/13
    • Epson Beamers (EH-TW8000/TW8000W, PL Home Cinema 5010/5010, EH-TW9000/TW9000W/PL Pro Cinema 6010)
    The 3D details

    Most 3D movies are either in Side by Side (SBS) or Top and Bottom (TAB) format. Both formats also exist in a reverse order (SBSR and TABR).

    To find out, if a movie has 2D or 3D format I use these methods:
    • Manual selection via Menu
    • Parsing of the movie title for 3D or more. This approach is the fastest one
    • Video analysis if the movie. This approach analyzes a few pictures of the movie in real time and uses a special algorithm to find out if a movie is 2D, 3D SBS or 3D TAB.
    The plugin has its own setup. As soon as the plugin is installed, go to the MediaPortal Configuration and start it:

    [​IMG]

    This is how the setup dialog looks like:
    Auto3DSetup1.png

    If you haven’t a supported TV, please select “No device”.
    In this case only switching the MediaPortal GUI into 3D mode will work. Switching TV has to be done manually.


    If your TV is supported then select it and fill in the necessary Information:

    Auto3DSetup2.png


    3D Detection

    upload_2014-4-17_21-42-19.png

    MediaPortal Input Type

    Select if TV (experimental) and/or Video should be supported.

    3D Detection Methods
    Always show 3D selection Menu in MediaPortal
    The mode selection is always done via the menu. Only supported formats are listed. Supported means that a command sequence is defined for that format (will be explained later).

    If name contains only “3D” …
    Always switches into the preselected 3D mode. Makes sense if somebody has only SBS or only TAB movies.

    If name contains …
    Switches into the mode that is exactly contained in the movie title. It is possible to enter comma-separated values in quotation marks, e.g. "3DSBS", "3D SBS" etc.

    Video Analysis for Side by Side / Video Analysis for Top and Bottom …
    Makes a video analysis of the current movie and switches then into the corresponding format. This works best if you have no reverse coded material.

    Show selection menu if key „CTRL+D“ is pressed
    Opens the selection menu anytime to switch into the desired mode. This makes sense if you watch a 2D movie and the TV supports 2D/3D conversion. Via the menu you can then select the 2D/3D conversion mode to view the video in pseudo 3D. The hotkey can be changed to any desired value. Just click into the field and enter the desired combination. Instead of the Keyboard it is also possible to use a MCE 2005 remote.

    3D Subtitles

    upload_2014-4-17_21-43-22.png

    3D Subtitles

    Turns 3D subtitle generation on/off. When using movies with integrated 3D subtitles this should be turned off.

    3D Subtitle depth
    With this settings the distance of the subtitles can be adjustet. The default value is 0, i.e. the subtitles are direct on the Screen. The higher the values get, the more the subtitles pop out of the screen.

    Options

    upload_2014-4-17_21-43-59.png


    Send Events to EventGhost

    In this case every format change will be propagated to the running EventGhost instance. You could perhaps use a USB-IR controller to switch a TV that has no API into 3D mode with IR commands.

    Prevent switching back to 3D Mode
    This avoids switching back to 2D mode. The System will be in permanent 3D mode. A user was asking for this as he didn't want to switch his beamer always back.

    Convert every 3D movie to 2D
    For users of a 2D only TV/beamer this makes life easier, as it is not always necessary to switch manually into 2D mode after a 3D movie has started.


    Info
    Version information about the loaded plugin / sub-plugins.

    TV Configuration
    If you press the “Config…” button the following dialog will appear:
    [​IMG]

    It’s possible to define the sequences to switch the TV into the desired 3D mode. Once a remote button on the right side is pressed, the command appears in the list and is sent in parallel to the TV.

    Commands can be deleted and moved upwards and downwards. A complete sequence can be tested with the button containing a green flash.

    To save a sequence under a different name just change the name in the “Device Name” box.

    Command Timmings:
    This allows to modify the timings, if for some reasons your TV takes longer to open a menu:
    [​IMG]


    If a sequence has to be saved the user is asked for confirmation when leaving the dialog with the close button.

    Hints for creating a sequence:
    The safest way to create a sequence is to never make any assumptions in which mode a TV could be. The plugin will never know what the TV is currently doing. As an example I take the sequence in the screenshot above.

    The 2x Back at the start of the sequence are sent to be sure that no menu is open. If a menu is already open the sequence would lead to unpredictable results.

    If the TV is in a second menu level sending only one Back command will end up in the main menu. The second Back command will ensure that all menus are closed.

    Now I send the Adjust command which opens the following menu:
    [​IMG]

    And now we have 3 possibilities. Depending on what was selected before the cursor could either be in the left, center or right position.
    As I want to go to the 3D menu I send 2x CursorLeft command. If the cursor is already on the left position, this command will do no harm, as the TV will then ignore.


    If you have TV with a rollover at the end of lists, then you can't use this method. In that case you must ensure that no other device then your MediaPortal PC does switch 2D/3D modes. As soon soon as you change 3D modes manually or another device switches modes, the sequences might result in unpredictable results.

    Now as the cursor is on the 3D menu I will send the OK command which will open the 3D menu
    [​IMG]

    As the sequence should switch back to the 2D mode the former said is true. The cursor could be on any of the 3 positions. Therefore I send 2x CursorUp to be sure on the topmost position. Then I send the OK command and the 2D mode is active. Finally I send a Back command to close the menu.

    3D Top and Bottom correction

    A wide screen 3D TAB movie looks in MediaPortal this way:
    [​IMG]

    As you can see the black bars above and below will bring your TV into trouble.
    This makes correct 3D impossible for the TV.


    As soon as the plugin switches into the 3D TAB mode it looks this way:

    [​IMG]
    This is something a 3D TV can handle :)


    3D to 2D conversion via MediaPortal

    It is now possible to convert a 3D Movie to 2D. With CTRL+D menu activated in settings it is possible to switch on 3D to 2D conversion for both SBS and TAB.

    At this point I explicitely want to thank @mrbonsen and @dishwasher for testing the first versions and for many valuable suggestions and hints to improve this plugin...

    3D reverse mode via MediaPortal

    Playing a 3D movie in reverse mode is now possible, event if the TV doesn't support that. Just switch the images in the Auto3D menu. (3D Reverse Mode / 3D Normal Mode).


    And credit goes to:
    @mrbonsen (Samsung TV testing)
    @Tuomaa (Sony TV testing and code)
    @blackmack (Philips TV DeVine testing)
    @este22 (Epson Beamer testing)
    @dishwasher (Philips TV jointSpace / DeVine testing)
    @radical (Panasonic TV testing)
    @wouter1971 (LG TV 2011 testing)

    Installation of the Plugin

    a) For MediaPortal 1.2, 1.3, 1.4 and 1.5:

    Extract the .zip file and copy the following files into the MediaPortal installation Directory

    - Configuration.exe
    - Core.dll
    - MediaPortal.exe

    Mediaportal should be installed in C:\Program Files (x86)\Team MediaPortal\MediaPortal.

    ATTENTION: Do not forget to backup the original files! In case of trouble you should be able replace them with the original ones.

    Install the Auto3D.mpe1 plugin.

    b) For MediaPortal 1.6:

    Just install the Auto3D.mpe1 plugin.

    Finally you can go the the MediaPortal configuration and select the TV/Beamer you have. For some TV there already exist sequences that might fit, but in some cases you have to define your own sequences for switching from / to the various 3D formats.

    c) For MediaPortal post - 1.6:

    This version contains bugfixes for MediaPortal 1.6 that I found after the release.

    - ViewModeSwitcher corrections for 3D TAB movies (previous corrections had a bug)
    - Fixed support for Panasonic TV (was broken in first 1.6 plugin because of my own UPnP support which had a bug)
    - Fixed memory leak in Auto3D which caused low frame rates and frame drops after some time and MediaPortal hung when trying to exit

    Install the plugin and replace the 2 files Core.dll and MediaPortal.exe with the on in the ZIP file.

    Mediaportal should be installed in C:\Program Files (x86)\Team MediaPortal\MediaPortal.

    ATTENTION: Do not forget to backup the original files! In case of trouble you should be able replace them with the original ones.

    d) For MediaPortal 1.7 pre:

    Install the plugin and replace the Core.dll and MediaPortal.exe

    ATTENTION: Do not forget to backup the original files! In case of trouble you should be able replace them with the original ones.

    e) For MediaPortal 1.7 - 1.9:


    Just install the Auto3D.mpe1 plugin.

    The plugin source code is in the following GitHub repository:
    https://github.com/UnlimitedStack/Auto3D

    Attached Files:

    Last edited: October 9, 2014
    • Like Like x 30
    • Thank You! Thank You! x 3
  2. azzuro
    • Team MediaPortal

    azzuro

    System Specs
    Thank you for your plugin;
    your plugin can't use CEC-remote plugin ?
    Can you post your patch file for Core change ? because few users, need have custom Core ( atmolight, ... )
  3. tourettes
    • Team MediaPortal

    tourettes

    Also please post the source code for the modified parts to comply GPL.
    • Like Like x 1
  4. Marcus Venturi
    • Super User

    Marcus Venturi Thread Starter

    System Specs
    I already had started to implement support the PulseEight CEC. I have already one here, but first of all I have to stabilize the current approach. Maybe in the near future I will have time for the CEC.

    I will post a patch file for the changes in 1.2.3 / 1.3.0RC and the source code as soon as I did some cleanup of the code.
    Last edited: February 18, 2013
    • Like Like x 4
  5. azzuro
    • Team MediaPortal

    azzuro

    System Specs
    Yes, i have read this on german forum (but without understand all words lol)
    seems better as tcp-ip configuration ...
  6. Marcus Venturi
    • Super User

    Marcus Venturi Thread Starter

    System Specs
    @azzuro / @tourettes

    I added the changes to the Core in the "Auto3D Changes.zip". It contains the modified source files as well as the unified diff patches.

    The code is quite simple. This is the result of 3 failed approaches with ViewPorts / Scaling and other stuff. Finally - believe it or not - the simplest solution worked :)
    Last edited: February 18, 2013
    • Like Like x 4
  7. azzuro
    • Team MediaPortal

    azzuro

    System Specs
    Wahoo, you delete many lines compared to what you add ... :confused:
    PS : join it on your 1st post please (y)
    also if you have url for plugin source, you can indicate it ..
    Last edited: February 18, 2013
  8. Edalex
    • Premium Supporter

    Edalex

    System Specs
    OMG Philips tvs have json api I've dreamed about and my philips tv is not capable for this :cry:
  9. sunfire7

    sunfire7

    System Specs
    I can't believe what I just read, it is a dream come true! Can't wait to test it! I'll post my results later :)

    Micropolis did a remote for samsung TVs via network, maybe he can help you out with the implementation of samsung, and of course I can help you test it with my tv

    Thank you thank you thank you
  10. Marcus Venturi
    • Super User

    Marcus Venturi Thread Starter

    System Specs
    @Edalex: You could try an IR transmitter controlled over EventGhost. My plugin is able to send events to EventGhost. With an external IR transmitter you could then send the necessary codes to your TV.

    @sunfire7: The Samsung support is already build in and recognizes a Samsung TV in the network. But my first tester had the following problem:
    When the "3D" code for the Samsung TV is sent, the menu for selecting the correct 3D mode appears on the TV with SBS preselected.
    Now I when send the command for the "OK" key, the TV does not react on it, the window remains on the screen.
    Mabye you could check this out with your TV? The TV simulator of the Samsung SDK always recognizes both commands without problem.
    Last edited: February 19, 2013
    • Like Like x 1

Share This Page

Users Viewing Thread (Users: 0, Guests: 0)

Running the latest version?

V1.8.0 FINAL - released July 2014 
Releasenews | Download
Changelog
 | Requirements
HTPC
Team-MediaPortal
 
About
Contact |  Press
Partners