Feature request: Support of Samsung DLNA abilities

Discuss alternative media renderers (not PS3) supported by PS3 Media Server (e.g. Xbox 360, TVs &c.)

Re: Feature request: Support of Samsung DLNA abilities

Postby SamiMakinen » Sun Nov 20, 2011 6:11 pm

The same code for v1.5 marked with <addition> comments (insert in RequestV2.java):

Code: Select all
               inputStream = dlna.getThumbnailInputStream();
                    // <addition>
                } else if (fileName.indexOf("subtitle0000") > -1) {

                    output.setHeader(HttpHeaders.Names.CONTENT_TYPE, "text/plain");
                    output.setHeader(HttpHeaders.Names.EXPIRES,  getFUTUREDATE() + " GMT");
                    List<DLNAMediaSubtitle> subs = dlna.getMedia().getSubtitlesCodes();
                    if(subs != null && !subs.isEmpty()) {
                        // TODO: maybe loop subs to get the requested subtitle type instead of using the first one
                        DLNAMediaSubtitle sub = subs.get(0);
                        inputStream = new java.io.FileInputStream(sub.getFile());
                    }
                    // </addition>
            } else {
               // This is a request for a regular file.

               // If range has not been initialized yet and the DLNAResource has its
               // own start and end defined, initialize range with those values before
               // requesting the input stream.
               Range.Time splitRange = dlna.getSplitRange();

               if (range.getStart() == null && splitRange.getStart() != null) {
                  range.setStart(splitRange.getStart());
               }

               if (range.getEnd() == null && splitRange.getEnd() != null) {
                  range.setEnd(splitRange.getEnd());
               }

               inputStream = dlna.getInputStream(Range.create(lowRange, highRange, range.getStart(), range.getEnd()), mediaRenderer);
                    // <addition>
                    List<DLNAMediaSubtitle> subs = dlna.getMedia().getSubtitlesCodes();
                    if(subs != null && !subs.isEmpty()) {
                        DLNAMediaSubtitle sub = subs.get(0);

                        int type = sub.getType();
                        if(type < DLNAMediaSubtitle.subExtensions.length) {
                            String strType = DLNAMediaSubtitle.subExtensions[type -1];
                            output.setHeader("CaptionInfo.sec", "http://"+PMS.get().getServer().getHost()+':'+PMS.get().getServer().getPort()+"/get/"+id+"/subtitle0000." + strType);
                        }
                    }
                    // </addition>


EDIT: ^range check added for DLNAMediaSubtitle.subExtensions. Embedded subs crashed the code without it.
SamiMakinen
 
Posts: 10
Joined: Thu Oct 27, 2011 6:40 pm

Re: Feature request: Support of Samsung DLNA abilities

Postby anastako » Thu Dec 01, 2011 8:30 pm

What you did is great

The thing is that I can not make it to work with idx/sub subtitles...
anastako
 
Posts: 7
Joined: Wed Nov 30, 2011 8:18 am

Re: Feature request: Support of Samsung DLNA abilities

Postby SamiMakinen » Tue Dec 06, 2011 12:23 pm

I'm not sure if the TVs support that or the subtitle file-extension might go wrong for that kind of subs. Also the code only serves link to one subtitle file and idx/sub has 2? Personally I try to use only srt-files since that seems to always work no matter the device :) .sub-files are tied to framerate which often seems to lead to sync-problems on some devices (even when playing from usb so not ps3ms related). I only modified the code to offer other subtypes so it didn't have clunky .srt hardcoding :/
SamiMakinen
 
Posts: 10
Joined: Thu Oct 27, 2011 6:40 pm

Re: Feature request: Support of Samsung DLNA abilities

Postby ExSport » Tue Dec 06, 2011 3:26 pm

Maybe better to post it in development thread or on googlecode site so it will be discussed and maybe merged. Here it is little bit lost in space 8-)
ExSport
 
Posts: 2168
Joined: Mon Jan 19, 2009 5:40 pm

Re: Feature request: Support of Samsung DLNA abilities

Postby SamiMakinen » Tue Dec 06, 2011 7:10 pm

Done viewtopic.php?f=11&t=12812, thanks for the tip :)
SamiMakinen
 
Posts: 10
Joined: Thu Oct 27, 2011 6:40 pm

Re: Feature request: Support of Samsung DLNA abilities

Postby anastako » Fri Jan 06, 2012 9:27 pm

Thank you for your answer

I can not understand how to merge this in my ps3 because I am not a developer :) anyway I was mentioning these subs because are used for 3d movies..
anastako
 
Posts: 7
Joined: Wed Nov 30, 2011 8:18 am

Re: Feature request: Support of Samsung DLNA abilities

Postby jhalttu78 » Thu Jan 12, 2012 8:52 pm

SamiMakinen wrote:Just got a Samsung d8005 tv and been trying a couple of media servers but always coming back to PS3mediaserver. Spent a couple of evenings debugging the subtitles feature and i think i nailed it (with very limited testing using only mkv and srt-files).

I modified the code quite a bit so I'm not too confident if this is all you need but I think I narrowed it down to this:

requestv2.java:
// (insert after the thumbnail handling (if (fileName.startsWith("thumbnail0000")) )

Code: Select all
} else if (fileName.startsWith("subtitle0000.srt")) {

    output.setHeader(HttpHeaders.Names.CONTENT_TYPE, "text/plain");
    output.setHeader(HttpHeaders.Names.EXPIRES,  getFUTUREDATE() + " GMT");
    inputStream = new java.io.FileInputStream(files.get(0).getMedia().subtitlesCodes.get(0).file);
} else {
// This is a request for a regular file.
    inputStream = dlna.getInputStream(Range.create(lowRange, highRange, range.getStart(), range.getEnd()), mediaRenderer);
    if(files.get(0).getMedia().subtitlesCodes.size() > 0) {
        output.setHeader("CaptionInfo.sec", "http://"+PMS.get().getServer().getHost()+':'+PMS.get().getServer().getPort()+"/get/"+id+"/subtitle0000.srt");
    }
    String name = dlna.getDisplayName(mediaRenderer);


So the media file response needs the CaptionInfo.sec http-header with an url to subtitles and then the actual subtitle requesthandling with very few lines. The tv doesn't seem to really care about the content-type or at least smi/caption (as used by serviio) works just as well as text/plain for .srt-files. Tried about everything based on the previous work on this thread, but then figured out the tv just needed the file-extension in the subtitle url…

I'll try to find time to test this with the latest code (tried this with some 1.5.0 beta code) and confirm the needed changes. Just wanted to share this with anyone struggling with the subtitles and samsung tv.


Hi Sami. I got same TV, but I cannot get MKV to work with it... (BTW, IM FINNISH)
jhalttu78
 
Posts: 10
Joined: Thu Jan 12, 2012 8:24 pm

Re: Feature request: Support of Samsung DLNA abilities

Postby SamiMakinen » Sun Jan 15, 2012 10:48 am

jhalttu78 wrote:Hi Sami. I got same TV, but I cannot get MKV to work with it... (BTW, IM FINNISH)


@jhalttu78
Here's the renderer conf I'm using if it's any help. It might not be just right for the device but it works for my purposes.

Code: Select all
# ps3mediaserver renderer profile for Samsung AllShare
#http://ps3mediaserver.org/forum/viewtopic.php?f=15&t=8889&start=0
#Conf: Version 1.4.1

RendererName=Samsung AllShare
RendererIcon=samsung.png

UserAgentSearch=UE55D8000
UserAgentAdditionalHeader=X-AV-Client-Info
UserAgentAdditionalHeaderSearch=(\w{3}_\w{3}_\w{2}-\w{2}\d{2}\w\d{4}/\d.\d)|(\w{3}_\w{3}_\[\w{2}\]-\w{2}\d{2}\w\d{4}/\d.\d)|(\w{3}_\w{3}_\w{2}-\w{2}\d{2}\w\d{3}/\d.\d)|(\w{3}_\w{3}_\[\w{2}\]-\w{2}\d{2}\w\d{3}/\d.\d)
Video=true
Audio=true
Image=true
SeekByTime=true
TranscodeVideo=MPEGAC3
TranscodeAudio=PCM
DefaultVBVBufSize=true
ForceJPGThumbnails = true
MuxH264ToMpegTS=true
MuxDTSToMpeg=true
WrapDTSIntoPCM=false
MuxLPCMToMpeg=true
MaxVideoBitrateMbps=75
MaxVideoWidth=0
MaxVideoHeight=0
MimeTypesChanges=audio/wav=audio/L16|video/x-matroska=video/avi|video/x-flv=video/mp4|audio/mp3=audio/L16|video/mp4=video/mpeg
TranscodeExtensions=flv,wav
StreamExtensions=mkv,mp3,mp4,avi,mov


It's based on an older version of renderer confs and as such doesn't have the modifications Raptor399 committed to the ps3ms code.

EDIT: replace the 55 to the inch size of your tv in:
UserAgentSearch=UE55D8000
SamiMakinen
 
Posts: 10
Joined: Thu Oct 27, 2011 6:40 pm

Re: Feature request: Support of Samsung DLNA abilities

Postby jhalttu78 » Sun Jan 29, 2012 7:46 pm

Thank you.

Now it plays MKV, but cannot show subtitles. I have tried from inside MKV and .SRT with same name. Because of that, i am still forced to use PS3 for movies...
I havent got that raptor399 version anywhere ( i do not know how to create my own form code)
jhalttu78
 
Posts: 10
Joined: Thu Jan 12, 2012 8:24 pm

Re: Feature request: Support of Samsung DLNA abilities

Postby marqo » Tue Jan 31, 2012 6:50 pm

Are samsung subtitles working in the new relesae 1.50.1 or 1.50.2-SB62?
marqo
 
Posts: 5
Joined: Fri Dec 30, 2011 1:22 pm

PreviousNext

Return to Alternative Media Renderers

Who is online

Users browsing this forum: No registered users and 5 guests