UPnP / DLNA Media Server for MediaPortal 2

Discussion in 'UPnP / DLNA Media Server' started by McGoober, January 1, 2012.

  1. McGoober
    • Team MediaPortal

    McGoober Retired Team Member

    Joined:
    August 13, 2006
    Messages:
    122
    Likes Received:
    103
    Gender:
    Male
    Occupation:
    Staff Software Developement Engineer
    Location:
    Cambridge, UK
    Ratings:
    +105 / 0
    Home Country:
    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: March 8, 2015
    • Like Like x 18
    • Thank You! Thank You! x 1
    • Agree Agree x 1
  2. Google AdSense Guest Advertisement



    to hide all adverts.
  3. McGoober
    • Team MediaPortal

    McGoober Retired Team Member

    Joined:
    August 13, 2006
    Messages:
    122
    Likes Received:
    103
    Gender:
    Male
    Occupation:
    Staff Software Developement Engineer
    Location:
    Cambridge, UK
    Ratings:
    +105 / 0
    Home Country:
    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!
     
    • Like Like x 1
  4. McGoober
    • Team MediaPortal

    McGoober Retired Team Member

    Joined:
    August 13, 2006
    Messages:
    122
    Likes Received:
    103
    Gender:
    Male
    Occupation:
    Staff Software Developement Engineer
    Location:
    Cambridge, UK
    Ratings:
    +105 / 0
    Home Country:
    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 ;)
     
    • Like Like x 1
  5. Albert
    • Team MediaPortal

    Albert MP2 Developer

    Joined:
    February 18, 2008
    Messages:
    1,297
    Likes Received:
    1,125
    Gender:
    Male
    Occupation:
    Dipl.-Inform.
    Location:
    Freiburg im Breisgau, Germany
    Ratings:
    +1,130 / 1
    Home Country:
    Germany Germany
    AW: Plugin: UPnP / DLNA Media Server

    Can you please provide the sources of your media server? Thanks!
     
  6. McGoober
    • Team MediaPortal

    McGoober Retired Team Member

    Joined:
    August 13, 2006
    Messages:
    122
    Likes Received:
    103
    Gender:
    Male
    Occupation:
    Staff Software Developement Engineer
    Location:
    Cambridge, UK
    Ratings:
    +105 / 0
    Home Country:
    United Kingdom United Kingdom
    Re: Plugin: UPnP / DLNA Media Server

    Source code is now available in the first post on this thread.
     
    • Like Like x 2
  7. bighick

    bighick Portal Pro

    Joined:
    July 6, 2009
    Messages:
    72
    Likes Received:
    4
    Ratings:
    +5 / 0
    Home Country:
    United States of America United States of America
    Show System Specs
    Re: Plugin: UPnP / DLNA Media Server

    Will this also transcode? IE: let my ps3 play MKV's?
     
  8. McGoober
    • Team MediaPortal

    McGoober Retired Team Member

    Joined:
    August 13, 2006
    Messages:
    122
    Likes Received:
    103
    Gender:
    Male
    Occupation:
    Staff Software Developement Engineer
    Location:
    Cambridge, UK
    Ratings:
    +105 / 0
    Home Country:
    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 :)
     
  9. McGoober
    • Team MediaPortal

    McGoober Retired Team Member

    Joined:
    August 13, 2006
    Messages:
    122
    Likes Received:
    103
    Gender:
    Male
    Occupation:
    Staff Software Developement Engineer
    Location:
    Cambridge, UK
    Ratings:
    +105 / 0
    Home Country:
    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.
     
    • Like Like x 4
  10. MJGraf
    • Team MediaPortal

    MJGraf Retired Team Member

    Joined:
    January 13, 2006
    Messages:
    2,475
    Likes Received:
    796
    Ratings:
    +1,372 / 1
    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
     
  11. McGoober
    • Team MediaPortal

    McGoober Retired Team Member

    Joined:
    August 13, 2006
    Messages:
    122
    Likes Received:
    103
    Gender:
    Male
    Occupation:
    Staff Software Developement Engineer
    Location:
    Cambridge, UK
    Ratings:
    +105 / 0
    Home Country:
    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.
     
    • Like Like x 3
Loading...

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

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice
  • About The Project

    The vision of the MediaPortal project is to create a free open source media centre application, which supports all advanced media centre functions, and is accessible to all Windows users.

    In reaching this goal we are working every day to make sure our software is one of the best.

             

  • Support MediaPortal!

    The team works very hard to make sure the community is running the best HTPC-software. We give away MediaPortal for free but hosting and software is not for us.

    Care to support our work with a few bucks? We'd really appreciate it!