UPnP / DLNA Media Server for MediaPortal 2 (2 Viewers)

McGoober

Retired Team Member
  • Premium Supporter
  • August 13, 2006
    122
    105
    Cambridge, UK
    United Kingdom United Kingdom
    I've been building a plugin for MediaPortal 2 Server to allow UPNP/DLNA devices to access media from the media library.

    Background: A while ago I used to use windows mediacenter. No matter how hard I tried it just wouldn't stay stable. So I went out and bought an Internet telly with DLNA to replace it. Now I needed a DLNA media server to serve all my digital content. I tried Serviio but that did a terrible job. So I set out on a quest to find some open software that I could modify for my own purposes. MediaPortal 2 was perfect since it already had a UPnP implementation.

    I'm going to share my development progress on this thread. Comments are of course welcome at anytime.

    After a few months of initial development, I managed to get my MediaPortal 2 Server plugin to serve up an MP3 to my iPhone (MediaConnect App). The MP3 was the main theme to Skyrim (a great game by the way). Later I was getting some of my photo library displayed.
    However there is still a long way to go, so stay tuned.

    Edits by morpheus_xx:

    The development continued and we created new test snapshots of this plugin!

    2014-11-26:
    Edits by MrTechno:

    Latest version of the code - https://github.com/MediaPortal/MediaPortal-2/tree/FEAT_DLNA_v2

    2015-03-08:
     
    Last edited by a moderator:

    McGoober

    Retired Team Member
  • Premium Supporter
  • August 13, 2006
    122
    105
    Cambridge, UK
    United Kingdom United Kingdom
    Re: Plugin: UPnP / DLNA Media Server

    Had another coding session tonight. Found a rather bad performance issue when browsing so I probably need to repost the plugin. I also ran the UPnP developer tools device validator which found a load of problems. However there is good news, I may have found the problem with the ResourceAccessModule. It's to do with mime types. After a quick hacky change I got a mp4 video to play on my iPhone woot!
     

    McGoober

    Retired Team Member
  • Premium Supporter
  • August 13, 2006
    122
    105
    Cambridge, UK
    United Kingdom United Kingdom
    Re: Plugin: UPnP / DLNA Media Server

    I've uploaded a new version of the plugin (v1.01). Let me know how things are going with it, I love to hear a story me... Good or Bad ;)
     

    bighick

    Portal Pro
    July 6, 2009
    72
    8
    United States of America United States of America
    Re: Plugin: UPnP / DLNA Media Server

    Will this also transcode? IE: let my ps3 play MKV's?
     

    McGoober

    Retired Team Member
  • Premium Supporter
  • August 13, 2006
    122
    105
    Cambridge, UK
    United Kingdom United Kingdom
    Re: Plugin: UPnP / DLNA Media Server

    Hey bighick, Yes that is the eventual idea. But right now, no. At the moment the Plugin will let UPnP controllers browse the contents of your shares from the media library and will serve up the file content but not transcode it. My goal as described above is to get it to work with my Sony Bravia telly which will have similar media restrictions to your PS3 (i.e requires transcoding) . So stay tuned :)
     

    McGoober

    Retired Team Member
  • Premium Supporter
  • August 13, 2006
    122
    105
    Cambridge, UK
    United Kingdom United Kingdom
    Re: Plugin: UPnP / DLNA Media Server

    I've been doing some debugging on my TV to figure out why it won't accept any URL's from mediaportal. It seems like it's all down to some DLNA specifics, but without the spec it's really hard.... However, last night I have managed to find them. Woot!. After a quick scan I came to the conclusion that I was going to need (I kinda knew this anyway) to have my own HTTP resource access code. This means taking some of the ResourceAccessModule code and modifying it with my own with changes specific for DLNA. Mine also differs in that it will be taking a media item guid rather than a resource path, which means I can resolve the request to a database item and get the extra metadata DLNA is going to need. Last night it was starting to work (thanks to the mediaportal guys for making plugins hook almost anything) and I was able to serve up an MP3 (Skyrim again) to my phone. My next challenge is to remotely interrupt my wife's TV watching of an evening with full Skyrim rendition :) oh the joy of UPnP pranking.
     

    MJGraf

    Retired Team Member
  • Premium Supporter
  • January 13, 2006
    2,475
    1,385
    Country flag
    Re: Plugin: UPnP / DLNA Media Server

    Hi McGoober,

    first of all, I wanted to say thank you so much for taking this challenge! DLNA is a killer feature, that will make MP2 even more THE media app!

    What I discovered with a very short test is first of all that the binaries in the first post do not work anymore with the current dev-branch. The reason is that the name "PictureAspect" was changed to "ItemAspect. It has to be changed twice in the code. After that, the source code above compiles against the current dev-branch - only showing some warnings.

    Unfortunately, I don't have much time atm to really test this plugin in detail, but I will definitely come back with a full bug report with logs. Nevertheless some first observations:
    I used my iPad with the mediaConnect app.
    MP2-Server is shown as DLNA device.
    I can browse my shares, but it seems as if the directory name of the share is displayed instead of the share name (the directory in my case is "Tagged", while the name I gave this share is "Music". However, "Tagged" is displayed in mediaConnect after I select "Shares".
    When browsing a large collection like my music collection, it gets really slow - but I think you already mentioned this above.
    When I try to open a Picture, I get the error "Resource Unavailable; The resource for 'xyz' is currently unavailable.
    When I browse my music collection, it works if I only browse directories with other sub-directories in it. As soon as I select a directory in which actual music files in it, I get the error "UPnP Error: Action Failed. Error code = 501"

    Nevertheless, for the short development time of this plugin, the result is already amazing. As mentioned, I'll provide proper bug reports as soon as I find the time.

    In the meantime - please keep up this excellent work!

    Michael
     

    McGoober

    Retired Team Member
  • Premium Supporter
  • August 13, 2006
    122
    105
    Cambridge, UK
    United Kingdom United Kingdom
    Re: Plugin: UPnP / DLNA Media Server

    Hey MJGraf, thanks for the comments, keep em coming.

    I happened to name my shares the same as my folders, whoops, I'll get that sorted.
    As for the error code 501, I'll need the exception that's in the logs to figure out what went on there. You should find a file in ...

    C:\ProgramData\Team MediaPortal\MP2-Server\Log\Server.log

    At least that's where mine is :)
    I've been working on the DLNA compatibility, which is rather slow going. Lots of extra code to support the rather specific encoding handshaking. Still I reckon I'll get a new version out tonight, that will be a step closer.

    New plugin uploaded (1.02).

    Fix for PictureAspect code change.
    Added own resource access http module.
    Really bad implementation of protocolInfo (will get better I promise)

    MediaConnect will now play an MPEG file, an MP3 and an MP4 avi.
     

    Users Who Are Viewing This Thread (Users: 0, Guests: 2)

    OP Similar threads Forum Replies Date
    morpheus_xx [Evaluate] Checking UPnP library for security vulnerabilities MediaPortal 2 7
    raffe How do I setup MP2 as an UPnP server? General 3
    morpheus_xx [Finished] Debugging dead locks in UPnP library MediaPortal 2 1
    Lehmden [WiP] [MP2-824] DLNA Server functionality MediaPortal 2 27
    RoChess Weird GPU crash -- possible cause: resizing media MediaPortal 1 Talk 8
    J Navigating media drive General 4
    J Will Media Portal meet my requirements? General Support 4
    C Imported media doesn't show up immediately? General 1
    J Show media item location Feature Requests 4
    HTPCSourcer Media Accessor is flooding logs with files from attached monitor MediaPortal 2 9
    N [fixed] [MP2-822] Folder View is not displaying individual media share elements Submit: Bug Reports 4
    A MP2.2.2, understanding movies/videos/tv and WTV recordings. General 16
    T I cannot get a basic media import-what is the best configuration? General 10
    Rob Hexenmeister [solved] Latest Media Handler - skinning buttons Fanart Handler 19
    J MediaPortal TV Server and Kodi media source issues General 9
    D media portal 2.2 have movies shown on genre not name General 6
    M How to Watch my videos from my Media Portal to My TV without TV Tuner Newcomers Forum 1
    D Media Portal wake schedule General Support 29
    R Media portal resumes with wrong screen resolution General Support 3
    Rob Hexenmeister Latest Media Handler - facade properties - itemcount General Support 3
    P WMC on Windows 7 migrating to Media Portal on Windows 10 Newcomers Forum 5
    Rob Hexenmeister [solved] Latest media handler - time reported as date Fanart Handler 18
    Rob Hexenmeister Video Buttons / Latest Media MediaPortal 1 Skins 7
    C DVB-C Empfänger Hauppauge Win TV dual wird in Media Portal nicht aktiviert TV / Streaming 1
    Patrik-See Unitymedia HD+ Fernsehen mit Media Portal legal möglich? TV / Streaming 0
    Similar threads

























    Top Bottom