Subtitle support with Samsung TV broke

2011-11-14
2015-12-01
  • Hey guys,

    Recently something broke the subtitle support with my Samsung UE40D7000 TV. My MiniDLNA setup did not change, so I suppose an update for the TV caused this. Curiously, in Windows, with the AllShare DLNA server, subtitles still work.

    I did a little investigation and found out that AllShare has a <sec:CaptionInfoEx> tag for the subtitles in the DIDL_Lite item description:

    <DIDL-Lite xmlns="urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/"
     xmlns:sec="http://www.sec.co.kr/dlna"
     xmlns:dlna="urn:schemas-dlna-org:metadata-1-0/"
     xmlns:dc="http://purl.org/dc/elements/1.1/"
     xmlns:upnp="urn:schemas-upnp-org:metadata-1-0/upnp/"
    >
    <item id="1_10_22_23" parentID="1_10_22" restricted="0"><res sec:acodec="dca" sec:vcodec="h264" duration="01:58:09" resolution="1920x800" size="8520673418" protocolInfo="http-get:*:video/x-mkv:DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=01500000000000000000000000000000">http://192.168.0.191:17679/FileProvider/M$7089000/O$1/S$41.srt/P$/I$video/x-mkv/41</res><res resolution="160x66" size="3471" protocolInfo="http-get:*:image/jpeg:DLNA.ORG_PN=JPEG_TN;DLNA.ORG_CI=1;DLNA.ORG_FLAGS=00D00000000000000000000000000000">http://192.168.0.191:17679/FileProvider/M$0/O$0/S$/P$JPEG_TN/I$image/jpeg/44</res><res resolution="640x266" size="22419" protocolInfo="http-get:*:image/jpeg:DLNA.ORG_PN=JPEG_SM;DLNA.ORG_CI=1;DLNA.ORG_FLAGS=00D00000000000000000000000000000">http://192.168.0.191:17679/FileProvider/M$0/O$0/S$/P$JPEG_SM/I$image/jpeg/43</res><sec:CaptionInfoEx sec:type="srt">http://192.168.0.191:17679/SubtitleProvider/41.SRT</sec:CaptionInfoEx><upnp:playbackCount>0</upnp:playbackCount><sec:dcmInfo>CREATIONDATE=1321142739,FOLDER=The Change-Up,BM=72</sec:dcmInfo><sec:modifiationDate>2011-11-13T01:05:39</sec:modifiationDate><sec:preference>0</sec:preference><dc:date>2011-11-13T01:05:39</dc:date><upnp:class>object.item.videoItem</upnp:class><dc:title>The.Change-Up.UNRATED.1080p.BluRay.x264-BLOW</dc:title><sec:MetaFileInfo sec:type="mta">http://192.168.0.191:17679/FileProvider/45</sec:MetaFileInfo><upnp:objectUpdateID>26</upnp:objectUpdateID><sec:initUpdateID>26</sec:initUpdateID></item>
    </DIDL-Lite>
    

    However MiniDLNA has nothing like that for the same item:

    <DIDL-Lite xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:upnp="urn:schemas-upnp-org:metadata-1-0/upnp/" xmlns="urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/" xmlns:dlna="urn:schemas-dlna-org:metadata-1-0/">
    <item id="64$6$0" parentID="64$6" restricted="1"><dc:title>The.Change-Up.UNRATED.1080p.BluRay.x264-BLOW</dc:title><upnp:class>object.item.videoItem</upnp:class><dc:date>2011-11-13T01:05:39</dc:date><res size="8520673418" duration="1:58:09.088" bitrate="192000" sampleFrequency="48000" nrAudioChannels="6" resolution="1920x800" protocolInfo="http-get:*:video/x-matroska:DLNA.ORG_OP=01;DLNA.ORG_CI=0">http://192.168.0.198:8200/MediaItems/29.mkv</res></item></DIDL-Lite>
    

    So now I wonder why it worked previously, since it does not seem to describe the srt file.

     
  • Justin Maggard
    Justin Maggard
    2011-11-19

    Can you post the browse request that the TV sends?  Of particular interest is the "Filter" field.

     
  • This is the Browse request the TV sends:

    POST /ctl/ContentDir HTTP/1.0
    HOST: 192.168.0.198:8200
    CONTENT-LENGTH: 661
    CONTENT-TYPE: text/xml;charset="utf-8"
    USER-AGENT: DLNADOC/1.50 SEC_HHP_[TV]UE40D7000/1.0
    SOAPACTION: "urn:schemas-upnp-org:service:ContentDirectory:1#Browse"
    <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body><u:Browse xmlns:u="urn:schemas-upnp-org:service:ContentDirectory:1"><ObjectID>2$15$8</ObjectID><BrowseFlag>BrowseDirectChildren</BrowseFlag><Filter>@id,@parentID,@restricted,dc:title,upnp:class,res,dc:date,@childCount,sec:CaptionInfo,sec:CaptionInfoEx, sec:dcmInfo, sec:MetaFileInfo,res@resolution,res@size,upnp:genre,dc:date,upnp:album,res@duration,upnp:albumArtURI,res@bitrate,dc:creator</Filter><StartingIndex>0</StartingIndex><RequestedCount>30</RequestedCount><SortCriteria></SortCriteria></u:Browse></s:Body></s:Envelope>
    

    and this is the response:

    HTTP/1.1 200 OK
    Content-Type: text/xml; charset="utf-8"
    Connection: close
    Content-Length: 1211
    Server: Ubuntu/10.04 DLNADOC/1.50 UPnP/1.0 MiniDLNA/1.0
    <?xml version="1.0" encoding="utf-8"?>
    <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body><u:BrowseResponse xmlns:u="urn:schemas-upnp-org:service:ContentDirectory:1"><Result>&lt;DIDL-Lite xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:upnp="urn:schemas-upnp-org:metadata-1-0/upnp/" xmlns="urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/" xmlns:dlna="urn:schemas-dlna-org:metadata-1-0/"&gt;
    &lt;item id="2$15$8$0" parentID="2$15$8" restricted="1"&gt;&lt;dc:title&gt;The.Change-Up.UNRATED.1080p.BluRay.x264-BLOW&lt;/dc:title&gt;&lt;upnp:class&gt;object.item.videoItem&lt;/upnp:class&gt;&lt;dc:date&gt;2011-11-13T01:05:39&lt;/dc:date&gt;&lt;sec:dcmInfo&gt;CREATIONDATE=0,FOLDER=The.Change-Up.UNRATED.1080p.BluRay.x264-BLOW,BM=0&lt;/sec:dcmInfo&gt;&lt;res size="8520673418" duration="1:58:09.088" bitrate="192000" resolution="1920x800" protocolInfo="http-get:*:video/x-mkv:DLNA.ORG_OP=01;DLNA.ORG_CI=0"&gt;http://192.168.0.198:8200/MediaItems/52.mkv&lt;/res&gt;&lt;/item&gt;&lt;/DIDL-Lite&gt;</Result>
    <NumberReturned>1</NumberReturned>
    <TotalMatches>1</TotalMatches>
    <UpdateID>2</UpdateID></u:BrowseResponse></s:Body></s:Envelope>
    
     
  • Justin Maggard
    Justin Maggard
    2011-11-23

    Can you try with the latest code from CVS?  We should now be sending the <sec:CaptionInfoEx> tag for Samsung Series C/D models.

     
  • I'm having trouble compiling from CVS. When I run the autogen.sh script, I get this:

    Generating configuration files for minidlna, please wait....
    autoreconf: Entering directory `.'
    autoreconf: running: autopoint --force
    Can't exec "autopoint": No such file or directory at /usr/share/autoconf/Autom4te/FileUtils.pm line 344.
    autoreconf: failed to run autopoint: No such file or directory
    autoreconf: autopoint is needed because this package uses Gettext
    

    I saw this thread on the help forum: https://sourceforge.net/projects/minidlna/forums/forum/879957/topic/4802181, but it didn't work for me: gettext is installed, unable to find gettext-devel or similar package.

    Help?

     
  • Justin Maggard
    Justin Maggard
    2011-11-30

    What distro?  With newer Debian derivatives, you can install the autopoint package.  With Fedora it should be gettext-devel.

     
  • Ok, installed autopoint on my Ubuntu machine and successfully compiled the CVS code. The browse action the TV does:

    POST /ctl/ContentDir HTTP/1.0
    HOST: 192.168.0.198:8200
    CONTENT-LENGTH: 661
    CONTENT-TYPE: text/xml;charset="utf-8"
    USER-AGENT: DLNADOC/1.50 SEC_HHP_[TV]UE40D7000/1.0
    SOAPACTION: "urn:schemas-upnp-org:service:ContentDirectory:1#Browse"
    <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body><u:Browse xmlns:u="urn:schemas-upnp-org:service:ContentDirectory:1"><ObjectID>2$15$9</ObjectID><BrowseFlag>BrowseDirectChildren</BrowseFlag><Filter>@id,@parentID,@restricted,dc:title,upnp:class,res,dc:date,@childCount,sec:CaptionInfo,sec:CaptionInfoEx, sec:dcmInfo, sec:MetaFileInfo,res@resolution,res@size,upnp:genre,dc:date,upnp:album,res@duration,upnp:albumArtURI,res@bitrate,dc:creator</Filter><StartingIndex>0</StartingIndex><RequestedCount>30</RequestedCount><SortCriteria></SortCriteria></u:Browse></s:Body></s:Envelope>/code]
    and the DIDL_Lite Result seems to have the <sec:CaptionInfoEx> field, exactly like AllShare does it:
    [codeHTTP/1.1 200 OK
    Content-Type: text/xml; charset="utf-8"
    Connection: close
    Content-Length: 1320
    Server: 2.6.32-35-generic DLNADOC/1.50 UPnP/1.0 MiniDLNA/1.0
    <?xml version="1.0" encoding="utf-8"?>
    <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body><u:BrowseResponse xmlns:u="urn:schemas-upnp-org:service:ContentDirectory:1"><Result>&lt;DIDL-Lite xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:upnp="urn:schemas-upnp-org:metadata-1-0/upnp/" xmlns="urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/" xmlns:dlna="urn:schemas-dlna-org:metadata-1-0/"&gt;
    &lt;item id="2$15$9$0" parentID="2$15$9" restricted="1"&gt;&lt;dc:title&gt;The.Change-Up.UNRATED.1080p.BluRay.x264-BLOW&lt;/dc:title&gt;&lt;upnp:class&gt;object.item.videoItem&lt;/upnp:class&gt;&lt;dc:date&gt;2011-11-13T01:05:39&lt;/dc:date&gt;&lt;sec:dcmInfo&gt;CREATIONDATE=0,FOLDER=The.Change-Up.UNRATED.1080p.BluRay.x264-BLOW,BM=201&lt;/sec:dcmInfo&gt;&lt;res size="8520673418" duration="1:58:09.088" bitrate="192000" resolution="1920x800" protocolInfo="http-get:*:video/x-mkv:DLNA.ORG_OP=01;DLNA.ORG_CI=0"&gt;http://192.168.0.198:8200/MediaItems/53.mkv&lt;/res&gt;&lt;sec:CaptionInfoEx sec:type="srt"&gt;http://192.168.0.198:8200/Captions/53.srt&lt;/sec:CaptionInfoEx&gt;&lt;/item&gt;&lt;/DIDL-Lite&gt;</Result>
    <NumberReturned>1</NumberReturned>
    <TotalMatches>1</TotalMatches>
    <UpdateID>5</UpdateID></u:BrowseResponse></s:Body></s:Envelope>
    

    Unfortunately, subtitles are not playing. The srt file is correctly hosted by minidlna (i.e. I can download it with my browser), but the TV does not HTTP GET it.

    After comparing with AllShare further, I noticed that when the video is played, some HTTP HEAD request also included information about the subtitles. This is what AllShare does:

    HEAD /FileProvider/M$7089000/O$1/S$391.srt/P$/I$video/x-mkv/391 HTTP/1.0
    getCaptionInfo.sec: 1
    HTTP/1.0 200 OK
    Content-Type: video/x-mkv
    Content-Length: 8520673418
    Date: Wed, 30 Nov 2011 22:26:35 GMT
    Connection: close
    contentFeatures.dlna.org: DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=01500000000000000000000000000000
    CaptionInfo.sec: http://192.168.0.198:17679/SubtitleProvider/391.srt
    transferMode.dlna.org: Streaming
    

    Here is where minidlna makes a mistake by using 127.0.0.1 as IP address:

    HEAD /MediaItems/52.mkv HTTP/1.0
    getCaptionInfo.sec: 1
    HTTP/1.1 200 OK
    Content-Type: video/x-mkv
    Content-Length: 8520673418
    transferMode.dlna.org: Streaming
    CaptionInfo.sec: http://127.0.0.1:8200/Captions/52.srt
    Accept-Ranges: bytes
    Connection: close
    Date: Wed, 30 Nov 2011 21:40:33 GMT
    EXT:
    realTimeInfo.dlna.org: DLNA.ORG_TLAG=*
    contentFeatures.dlna.org: DLNA.ORG_OP=01;DLNA.ORG_CI=0
    Server: 2.6.32-35-generic DLNADOC/1.50 UPnP/1.0 MiniDLNA/1.0
    

    So I guess when this ip address is filled in correctly, the subtitles should play.

    regards,

    dvrslype

     
  • excuse me for the messy code tag usage, this should be more readable:

    Ok, installed autopoint on my Ubuntu machine and successfully compiled the CVS code. The browse action the TV does:

    POST /ctl/ContentDir HTTP/1.0
    HOST: 192.168.0.198:8200
    CONTENT-LENGTH: 661
    CONTENT-TYPE: text/xml;charset="utf-8"
    USER-AGENT: DLNADOC/1.50 SEC_HHP_[TV]UE40D7000/1.0
    SOAPACTION: "urn:schemas-upnp-org:service:ContentDirectory:1#Browse"
    <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body><u:Browse xmlns:u="urn:schemas-upnp-org:service:ContentDirectory:1"><ObjectID>2$15$9</ObjectID><BrowseFlag>BrowseDirectChildren</BrowseFlag><Filter>@id,@parentID,@restricted,dc:title,upnp:class,res,dc:date,@childCount,sec:CaptionInfo,sec:CaptionInfoEx, sec:dcmInfo, sec:MetaFileInfo,res@resolution,res@size,upnp:genre,dc:date,upnp:album,res@duration,upnp:albumArtURI,res@bitrate,dc:creator</Filter><StartingIndex>0</StartingIndex><RequestedCount>30</RequestedCount><SortCriteria></SortCriteria></u:Browse></s:Body></s:Envelope>
    

    and the DIDL_Lite Result seems to have the <sec:CaptionInfoEx> field, exactly like AllShare does it:

    HTTP/1.1 200 OK
    Content-Type: text/xml; charset="utf-8"
    Connection: close
    Content-Length: 1320
    Server: 2.6.32-35-generic DLNADOC/1.50 UPnP/1.0 MiniDLNA/1.0
    <?xml version="1.0" encoding="utf-8"?>
    <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body><u:BrowseResponse xmlns:u="urn:schemas-upnp-org:service:ContentDirectory:1"><Result>&lt;DIDL-Lite xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:upnp="urn:schemas-upnp-org:metadata-1-0/upnp/" xmlns="urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/" xmlns:dlna="urn:schemas-dlna-org:metadata-1-0/"&gt;
    &lt;item id="2$15$9$0" parentID="2$15$9" restricted="1"&gt;&lt;dc:title&gt;The.Change-Up.UNRATED.1080p.BluRay.x264-BLOW&lt;/dc:title&gt;&lt;upnp:class&gt;object.item.videoItem&lt;/upnp:class&gt;&lt;dc:date&gt;2011-11-13T01:05:39&lt;/dc:date&gt;&lt;sec:dcmInfo&gt;CREATIONDATE=0,FOLDER=The.Change-Up.UNRATED.1080p.BluRay.x264-BLOW,BM=201&lt;/sec:dcmInfo&gt;&lt;res size="8520673418" duration="1:58:09.088" bitrate="192000" resolution="1920x800" protocolInfo="http-get:*:video/x-mkv:DLNA.ORG_OP=01;DLNA.ORG_CI=0"&gt;http://192.168.0.198:8200/MediaItems/53.mkv&lt;/res&gt;&lt;sec:CaptionInfoEx sec:type="srt"&gt;http://192.168.0.198:8200/Captions/53.srt&lt;/sec:CaptionInfoEx&gt;&lt;/item&gt;&lt;/DIDL-Lite&gt;</Result>
    <NumberReturned>1</NumberReturned>
    <TotalMatches>1</TotalMatches>
    <UpdateID>5</UpdateID></u:BrowseResponse></s:Body></s:Envelope>
    

    Unfortunately, subtitles are not playing. The srt file is correctly hosted by minidlna (i.e. I can download it with my browser), but the TV does not HTTP GET it.

    After comparing with AllShare further, I noticed that when the video is played, some HTTP HEAD request also included information about the subtitles. This is what AllShare does:

    HEAD /FileProvider/M$7089000/O$1/S$391.srt/P$/I$video/x-mkv/391 HTTP/1.0
    getCaptionInfo.sec: 1
    HTTP/1.0 200 OK
    Content-Type: video/x-mkv
    Content-Length: 8520673418
    Date: Wed, 30 Nov 2011 22:26:35 GMT
    Connection: close
    contentFeatures.dlna.org: DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=01500000000000000000000000000000
    CaptionInfo.sec: http://192.168.0.198:17679/SubtitleProvider/391.srt
    transferMode.dlna.org: Streaming
    

    Here is where minidlna makes a mistake by using 127.0.0.1 as IP address:

    HEAD /MediaItems/52.mkv HTTP/1.0
    getCaptionInfo.sec: 1
    HTTP/1.1 200 OK
    Content-Type: video/x-mkv
    Content-Length: 8520673418
    transferMode.dlna.org: Streaming
    CaptionInfo.sec: http://127.0.0.1:8200/Captions/52.srt
    Accept-Ranges: bytes
    Connection: close
    Date: Wed, 30 Nov 2011 21:40:33 GMT
    EXT:
    realTimeInfo.dlna.org: DLNA.ORG_TLAG=*
    contentFeatures.dlna.org: DLNA.ORG_OP=01;DLNA.ORG_CI=0
    Server: 2.6.32-35-generic DLNADOC/1.50 UPnP/1.0 MiniDLNA/1.0
    

    So I guess when this ip address is filled in correctly, the subtitles should play.

    regards,

    dvrslype

     
  • Justin Maggard
    Justin Maggard
    2011-11-30

    All right, that should also be fixed now.  The problem there is that Samsung uses an HTTP 1.0 request, without a Host header, so we weren't able to detect which interface we should be representing.  I just checked in some fallback code for this situation, so we should now be able to guess the interface.

     
    • ofrias
      ofrias
      2015-12-01

      Hi.

      I am using minidlna version 1.1.4 and a Samsung Smart TV UE65JU7000 and external srt subtitles do not show. I can send debug information like HTTP headers if you need.

      Thanks!

       
  • New code from CVS works, thanks!

    dvrslype

     
  • Jesper Karlsen
    Jesper Karlsen
    2012-01-31

    I had a simular problem the other day, when subtitles were suddenly not picked up anymore. I stopped the minidlna server removed the tmp db in /tmp/minidlna and started the server again to rebuild db, which worked. I am wondering though why I had to do this - shouldn't minidlna automatically discover the subttitles even if they are added after the movie has been added. I believe there is a default 15 min. rescan with inotify - maybe I was not patient enough, but i doubt it.

     
  • Jesper Karlsen
    Jesper Karlsen
    2012-01-31

    Does anyone know if there is a good practice of some kind to make minidlna discover newly added subtitles?

     
  • Justin Maggard
    Justin Maggard
    2012-01-31

    Yes, if inotify is enabled and working, it should detect new caption files, basically immediately.

     
  • Jesper Karlsen
    Jesper Karlsen
    2012-01-31

    Thanks for the quick reply….maybe my db was corrupted….I will check if things have improved after cleaning up.

     

  • Anonymous
    2012-04-29

    Hello everybody

    I'm trying to use the .srt subtitles support for streaming through DLNA via LAN o my samsung U40D5500 and I cant't
    My LAN is composed by:

    eTrayz Linux miniDLNA 1.0.24 server -> LAN -> Samsung TV LCD U40D5500

    This patch re-enable this freature and is included in the 1.0.23 release, but I have not able to run it.

    I questioning myself:
    1 - Have I to apply the patch for subtitles support? maybe have I to compile CVS?
    2 - Could be a problem from MY TV, only my TV?
    3 - Is possible that  the compilation of miniDLNA 1.0.24 (through ipkg) comes without subtitles support?

    Thank you very much!!