Jump to content


Photo

DLNA support of external subtitles

dlna subtitles external support

Best Answer Luke , 15 January 2015 - 01:57 AM

ok, i've checked in some changes that should cause SubtitleFormat to get populated. great investigative work on your part!

Go to the full post


  • Please log in to reply
34 replies to this topic

#1 Serios OFFLINE  

Serios

    Advanced Member

  • Members
  • 76 posts
  • Local time: 08:00 AM

Posted 08 November 2014 - 04:16 AM

Is it possible to add support for external subtitles trough DLNA to MB?

Currently MB transcodes every item that has external subtitles to burn them in, which is K.I.I.S. solution. The DLNA standard actually support additional subtitle (.srt) files, for example Serviio serves external subtitles to the client as item within the ContentDirectory:
"urn:schemas-upnp-org:service:ContentDirectory:1":

...
  <res protocolInfo="http-get:*:text/srt:*">http://192.168.1.5:8895/resource/6/SUBTITLE.srt</res>
</item>

The URI to the .srt file is given in the media directory and can be read through HTTP, so DLNA media render can access it.
 
I get that, transcoding is the "last hope" when nothing else work but in this case, something else work, and why to force transcoding when natively can get without.


Edited by Serios, 08 November 2014 - 05:56 AM.


#2 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 138124 posts
  • Local time: 04:00 AM

Posted 08 November 2014 - 11:04 AM

we already do this, based on the subtitle profiles of the dlna device profile



#3 Serios OFFLINE  

Serios

    Advanced Member

  • Members
  • 76 posts
  • Local time: 08:00 AM

Posted 08 November 2014 - 05:28 PM

we already do this, based on the subtitle profiles of the dlna device profile

 

Well not according to the log file

<item restricted="1" id="06d0ff366497d215115fee09e79bb7ad" parentID="18f9496d52aa086f5bb7fdb903b5ab2f">
<dc:title>The Hitchhiker's Guide to the Galaxy</dc:title>
<upnp:class>object.item.videoItem.movie</upnp:class>
........
<upnp:director>Garth Jennings</upnp:director>
<upnp:actor>Martin Freeman</upnp:actor>
<upnp:actor>Zooey Deschanel</upnp:actor>
<upnp:actor>Sam Rockwell</upnp:actor>
<upnp:actor>Mos Def</upnp:actor>
<res duration="01:48:46.5300000" size="2773702656" nrAudioChannels="6" resolution="1280x536" sampleFrequency="48000" bitrate="3388836" protocolInfo="http-get:*:video/x-msvideo:DLNA.ORG_PN=AVI;DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=01D00000000000000000000000000000">http://192.168.1.50:8096/mediabrowser/videos/06d0ff366497d215115fee09e79bb7ad/stream.avi?Params=a090a433ae628a3636d4372d1d113d76;test;06d0ff366497d215115fee09e79bb7ad;true;;;;;;;;;;;0;;;;;</res>
<upnp:albumArtURI dlna:profileID="JPEG_SM">http://192.168.1.50:8096/mediabrowser/Items/06d0ff366497d215115fee09e79bb7ad/Images/Primary/0/2d7e60917a6736ef0a858ca9f51ddded/jpg/480/480/0</upnp:albumArtURI>
<upnp:icon>http://192.168.1.50:8096/mediabrowser/Items/06d0ff366497d215115fee09e79bb7ad/Images/Primary/0/2d7e60917a6736ef0a858ca9f51ddded/jpg/48/48/0</upnp:icon>
</item>

Although I have .srt file named exactly as the movie and in my device dlna profile srt files have set the following settings:
Format: srt

Method: External download

Didl mode: res element

 

If you want I can attach both  log file and dlna profile


Edited by Serios, 08 November 2014 - 05:31 PM.


#4 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 138124 posts
  • Local time: 04:00 AM

Posted 08 November 2014 - 05:33 PM

i've tested this without any problem. maybe the server never recognized the subtitles to begin with. or maybe it's the wrong dlna profile. you'll have to investigate.



#5 Serios OFFLINE  

Serios

    Advanced Member

  • Members
  • 76 posts
  • Local time: 08:00 AM

Posted 08 November 2014 - 07:16 PM

Well I can see them, when open movie in web library:

 

Subtitle
Codec SRT
Default No
Forced No
External Yes

 

Strange thing is in the log I don't get any of srt files from other movies too it's like completely ignoring all subtitles files, but when preview movie in web dashboard it shows that there is sub file.

 

Heres my dlna profile

Attached Files


Edited by Serios, 08 November 2014 - 07:17 PM.


#6 Serios OFFLINE  

Serios

    Advanced Member

  • Members
  • 76 posts
  • Local time: 08:00 AM

Posted 15 November 2014 - 07:50 AM

Ok I'm in "the ignore this guy" list, but please someone... I even capture the response from MB trough Wireshark and there is no trace of subtitle node in item node. I don't get it, it should work... I don't get any errors in the log about DLNA profile, MB recognize it so what's wrong with damn subtitles I'm sure defined subtitles profiles are ok, even reinstalled MB completely and the installed it again - result is the same. Do I need to clear cache or something?



#7 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 138124 posts
  • Local time: 04:00 AM

Posted 15 November 2014 - 11:27 AM

the most likely answer has been given to you. you configured the subtitle profiles but make sure the dlna device profile is actually being used. you can check that in the server log.



#8 Serios OFFLINE  

Serios

    Advanced Member

  • Members
  • 76 posts
  • Local time: 08:00 AM

Posted 15 November 2014 - 11:34 AM

Yes, it is:
Dlna: Found matching device profile: LG WebOS

 

that's why I'm wondering whats wrong



#9 Beardyname OFFLINE  

Beardyname

    Advanced Member

  • Alpha Testers
  • 944 posts
  • Local time: 09:00 AM

Posted 17 November 2014 - 09:08 AM

Have you setup subtitles to be used for your user? aka if you try to play the same item in the web-client will the subtitles appear or do you have to select them?

 

I could be totally wrong but as far as i know this has not been talked about yet :)


Edited by Beardyname, 17 November 2014 - 09:09 AM.


#10 Serios OFFLINE  

Serios

    Advanced Member

  • Members
  • 76 posts
  • Local time: 08:00 AM

Posted 17 November 2014 - 06:57 PM

As the matter of fact they do appear in the web client (even if they are gibberish because the encoding)  if I made naming convention with the language code they start automatically if not (just movie file name)  I can select them from captions menu and they appear. I browsed the MB source code on github for the last couple of days and indeed as Luke said it must include subtitles file in the stream to dlna device i see that portion, but why is not firing? Also can someone too confirm this, when subtitles format is .sub there is a problem with transcoding - it fails creating temp file so error is returned.


Edited by Serios, 17 November 2014 - 01:15 PM.


#11 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 138124 posts
  • Local time: 04:00 AM

Posted 17 November 2014 - 09:42 PM

double check your user profile subtitle preferences



#12 Serios OFFLINE  

Serios

    Advanced Member

  • Members
  • 76 posts
  • Local time: 08:00 AM

Posted 18 November 2014 - 12:12 AM

My user profile language preferences:

 

546ac70a1b8eb_Untitled1.jpg


  • torrien likes this

#13 Beardyname OFFLINE  

Beardyname

    Advanced Member

  • Alpha Testers
  • 944 posts
  • Local time: 09:00 AM

Posted 18 November 2014 - 09:33 AM

Will it behave the same if you change Subtitle Mode to Always or similiar? (can't remember exactly) but with theese settings it will only play subtitles if the "main" language differs from Bulgarian.



#14 Serios OFFLINE  

Serios

    Advanced Member

  • Members
  • 76 posts
  • Local time: 08:00 AM

Posted 18 November 2014 - 04:09 PM

Yes I tried that, but no change



#15 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 138124 posts
  • Local time: 04:00 AM

Posted 18 November 2014 - 08:37 PM

try the dev server and see if it makes a difference



#16 anks OFFLINE  

anks

    Advanced Member

  • Alpha Testers
  • 50 posts
  • Local time: 09:00 AM

Posted 18 November 2014 - 09:41 PM

Have you tried using XBMC as the DMR and see if the subtitles appear using this profile?


Edited by anks, 18 November 2014 - 07:49 PM.


#17 Serios OFFLINE  

Serios

    Advanced Member

  • Members
  • 76 posts
  • Local time: 08:00 AM

Posted 19 November 2014 - 04:47 AM

try the dev server and see if it makes a difference

 

Not at all, still no subtitles.

 

 

Have you tried using XBMC as the DMR and see if the subtitles appear using this profile?

 

Yes I tried, the result is the same, also tried to load movie from serviio and it played without a problem with subtitles  :(

 

 

Pardon me if the next sounds very stupid but I see the logic behind subtitles listing like this:
When started MB check each movie folder for list of files and grab them - >
On dlna client request it loads dlna profile and If subtitle file is discovered it's check against to see if device supports this type of file -> 

If Yes: it is added to the proper movie item as res, then nodes list is send to the client
if Not: the movie item is marked for transcoding and again nodes list is send to the client

 

Not very good explanation but still, for me there are 3 breaking points, one is file grabbing process, the second one is check for the type, third one is the inclusion point



#18 Serios OFFLINE  

Serios

    Advanced Member

  • Members
  • 76 posts
  • Local time: 08:00 AM

Posted 11 January 2015 - 09:00 AM

Sorry to bring back this again, but problem still persists I tried everything but it seems MB completely ignores the subtitle file when streaming over dlna. I'm desperate, can someone help me with this



#19 Serios OFFLINE  

Serios

    Advanced Member

  • Members
  • 76 posts
  • Local time: 08:00 AM

Posted 12 January 2015 - 03:30 AM

I noticed something else, although don't know if is related, but anyway - when playing movie in web client subtitles are shown, if I go to metadata manager for the item and go to to subtitles tab i see them listed, when click on them it should bring some kind of editor in html dialog, but nothing is returned. When trace, I see that the query returns 404 error:

NetworkError: 404 Not Found - http://localhost:8096/mediabrowser/Videos/30971a5fb4956ee52c56e489b72b335c/Subtitles/2

 
Don't know is this related in anyway to didl builder or is just a web interface bug, but I think it should be mentioned.


Edited by Serios, 12 January 2015 - 03:32 AM.


#20 Serios OFFLINE  

Serios

    Advanced Member

  • Members
  • 76 posts
  • Local time: 08:00 AM

Posted 14 January 2015 - 05:49 AM

Oook after some fiddling around with the source code, I managed to trace the problem up to the AddSubtitle method in MediaBrowser.Model\Dlna\StreamInfo.cs, we have the following:

 

 

        private void AddSubtitle(List<SubtitleStreamInfo> list, MediaStream stream, string baseUrl, long startPositionTicks)
        {
            string url = string.Format("{0}/Videos/{1}/{2}/Subtitles/{3}/{4}/Stream.{5}",
                baseUrl,
                ItemId,
                MediaSourceId,
                StringHelper.ToStringCultureInvariant(stream.Index),
                StringHelper.ToStringCultureInvariant(startPositionTicks),
                SubtitleFormat);

            list.Add(new SubtitleStreamInfo
            {
                Url = url,
                IsForced = stream.IsForced,
                Language = stream.Language,
                Name = stream.Language ?? "Unknown",
                Format = SubtitleFormat
            });
        }

and for some reason SubtitleFormat is always returned as blank, thus why logic in method AddSubtitleElement in \MediaBrowser.Dlna\Didl\DidlBuilder.cs always returning subtitleProfile as null. Which bring us to the point that subtitles stream is actually never added to the xml.

If someone from dev team can take a look at this, will be nice :)


  • HomerS likes this





Also tagged with one or more of these keywords: dlna, subtitles, external, support

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users