UPnP / DLNA Media Server for MediaPortal 2 | Page 37

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

  1. henso
    • Team MediaPortal

    henso Development Group

    Joined:
    February 16, 2012
    Messages:
    1,933
    Likes Received:
    459
    Gender:
    Male
    Ratings:
    +698 / 0
    Home Country:
    Denmark Denmark
    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.


     

    Attached Files:

    • Thank You! Thank You! x 1
  2. Google AdSense Guest Advertisement



    to hide all adverts.
  3. FreakyJ
    • Team MediaPortal

    FreakyJ Development Group

    Joined:
    July 25, 2010
    Messages:
    4,021
    Likes Received:
    839
    Gender:
    Male
    Ratings:
    +1,424 / 1
    Home Country:
    Germany Germany
    Thank you very much for porting :)

    It is actually different:
    Code (XML):
    1. <Targets>
    2.       <Target>
    3.         android
    4.       </Target>
    5.     </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 :)
     
  4. henso
    • Team MediaPortal

    henso Development Group

    Joined:
    February 16, 2012
    Messages:
    1,933
    Likes Received:
    459
    Gender:
    Male
    Ratings:
    +698 / 0
    Home Country:
    Denmark Denmark
    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. :)
     
  5. FreakyJ
    • Team MediaPortal

    FreakyJ Development Group

    Joined:
    July 25, 2010
    Messages:
    4,021
    Likes Received:
    839
    Gender:
    Male
    Ratings:
    +1,424 / 1
    Home Country:
    Germany Germany
  6. henso
    • Team MediaPortal

    henso Development Group

    Joined:
    February 16, 2012
    Messages:
    1,933
    Likes Received:
    459
    Gender:
    Male
    Ratings:
    +698 / 0
    Home Country:
    Denmark Denmark
    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?

    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.
     
  7. FreakyJ
    • Team MediaPortal

    FreakyJ Development Group

    Joined:
    July 25, 2010
    Messages:
    4,021
    Likes Received:
    839
    Gender:
    Male
    Ratings:
    +1,424 / 1
    Home Country:
    Germany Germany
    hehe, okay^^ I thought you had a reason for adding it. I just removed it.

    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!
     
  8. henso
    • Team MediaPortal

    henso Development Group

    Joined:
    February 16, 2012
    Messages:
    1,933
    Likes Received:
    459
    Gender:
    Male
    Ratings:
    +698 / 0
    Home Country:
    Denmark Denmark
    I think I have but let me think about it first. ;)
    I will look into it next week. I'm going away for the weekend.
     
    • Like Like x 1
  9. MrTechno
    • Team MediaPortal

    MrTechno Development Group

    Joined:
    February 27, 2011
    Messages:
    1,256
    Likes Received:
    275
    Gender:
    Male
    Location:
    London
    Ratings:
    +515 / 1
    Home Country:
    United Kingdom United Kingdom
    Show System Specs
    @FreakyJ I've started porting the DLNA plugin to the MIA rework branch. Doesn't compile yet, progress report to follow.
     
    • Thank You! Thank You! x 1
  10. FreakyJ
    • Team MediaPortal

    FreakyJ Development Group

    Joined:
    July 25, 2010
    Messages:
    4,021
    Likes Received:
    839
    Gender:
    Male
    Ratings:
    +1,424 / 1
    Home Country:
    Germany Germany
    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 (Text):
    1. 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...
     
  11. FreakyJ
    • Team MediaPortal

    FreakyJ Development Group

    Joined:
    July 25, 2010
    Messages:
    4,021
    Likes Received:
    839
    Gender:
    Male
    Ratings:
    +1,424 / 1
    Home Country:
    Germany Germany
    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 (Text):
    1. if (resourceStream is FileStream)
    2.         {
    3.           ServiceRegistration.Get<ILogger>().Debug("Is FileStream");
    4.           if (!((FileStream)resourceStream).CanRead)
    5.             resourceStream = new FileStream(((FileStream)resourceStream).Name, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
    6.         }
    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 :)
     
    • Like Like x 1
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!