UPnP / DLNA Media Server for MediaPortal 2 (1 Viewer)

henso

Development Group
  • Team MediaPortal
  • February 16, 2012
    2,170
    735
    Denmark Denmark
    Country flag
    My planned changes are:
    remove <UPNPDeviceDescription>
    replace <Detections> with <Targets>
    Here is my first port of the profiles. I opted for keeping <Detections>. Why have a different name for the same thing? The detection objects is something I put in. I don't know if they work correctly.
     

    Attachments

    FreakyJ

    Development Group
  • Team MediaPortal
  • July 25, 2010
    4,023
    1,420
    Germany Germany
    Country flag
    Thank you very much for porting :)

    Why have a different name for the same thing?
    It is actually different:
    XML:
    <Targets>
          <Target>
            android
          </Target>
        </Targets>
    MPExtended uses this to determine which client gets which profiles. You can request the Profiles by handing a "target" to MPExtended. Sure you can also retrieve android profiles e.g. for a webservice, but this is up to the developer if this makes sense.
    By renaming this we don't get conflicts in case one just copies a profile from the DLNA Server to MP2Extended, because it gets just ignored.

    Does that make sense? If not I am happy to change :)
     

    henso

    Development Group
  • Team MediaPortal
  • February 16, 2012
    2,170
    735
    Denmark Denmark
    Country flag
    MPExtended uses this to determine which client gets which profiles.
    OK, now I understand. I was actually also thinking about having some kind of filter option so this serves the same purpose. I'ts fine by me if you edit the profiles. :)
     

    henso

    Development Group
  • Team MediaPortal
  • February 16, 2012
    2,170
    735
    Denmark Denmark
    Country flag
    short path didn't work for me
    Yeah, I don't even remember why I used it anymore. Shouldn't we just remove it if doesn't work on all systems anyway?

    transcoding in the middle of a file.
    My initial idea was that transcoded files could be cached for by others requesting the same file.
    I would have to rethink the cache strategy for this, but I think it is necessary too.
     

    FreakyJ

    Development Group
  • Team MediaPortal
  • July 25, 2010
    4,023
    1,420
    Germany Germany
    Country flag
    Yeah, I don't even remember why I used it anymore. Shouldn't we just remove it if doesn't work on all systems anyway?
    hehe, okay^^ I thought you had a reason for adding it. I just removed it.

    My initial idea was that transcoded files could be cached for by others requesting the same file.
    I would have to rethink the cache strategy for this, but I think it is necessary too.
    Yes, caching is a good idea and I see the problem if the transcoding starts right in the middle. Maybe we should only cache if we started transcoding from the beginning, otherwise we should just transcode on the fly.
    But maybe you have a better idea. Would be great!
     

    FreakyJ

    Development Group
  • Team MediaPortal
  • July 25, 2010
    4,023
    1,420
    Germany Germany
    Country flag
    I am fixing the HLS Streaming in the Transcoding Plugin right now (basically just adjusting some paths so that it doesn't output into the MP2-Server Application dir).

    For getting the playlist file we use:
    Code:
    Stream stream = new FileStream(filePath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
    The problem is that FFMPEG doesn't like this and creates another file, if we don't open teh file ffmpeg doesn't do that. Has anyone a clue what could be wrong? Or how I could figure out what is wrong?
    The options above indicate that it shouldn't be a problem for ffmpeg to write to this file...
     

    FreakyJ

    Development Group
  • Team MediaPortal
  • July 25, 2010
    4,023
    1,420
    Germany Germany
    Country flag
    I hope I solved the problem after a long night :) I was reading the FFMpeg src for hls: http://ftp2.halpanet.org/source/_dev/ffmpeg.git/libavformat/hlsenc.c
    It looks like FFMPeg create a tmp file with the newly created segment files and than replaces the playlist file with the tmp file. It does this for every new segment.

    Now the problem: Our TranscodingService opened the file, but never closed it. This lead to the fact that FFMpeg couldn't replace the playlist file. I now close it after reading and reopen it:

    Code:
    if (resourceStream is FileStream)
            {
              ServiceRegistration.Get<ILogger>().Debug("Is FileStream");
              if (!((FileStream)resourceStream).CanRead)
                resourceStream = new FileStream(((FileStream)resourceStream).Name, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
            }
    I don't know if this is a really elegant solution, but it looks like it is working and I will provide a patch for our TranscodingService :)
     

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

    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