How to force external subtitles and see HTTP requests/responses

For help and support with Universal Media Server
Forum rules
Please make sure you follow the Problem Reporting Guidelines before posting if you want a reply
ofrias
Posts: 5
Joined: Wed Dec 23, 2015 9:49 pm

How to force external subtitles and see HTTP requests/responses

Post by ofrias »

Hi.

I am trying to debug an issue in a Samsung J Series (or maybe in minidlna server), in particular in model UE65JU7000.

It looks like the TV is not requesting the external subtitles file even if they are correctly reported in the CaptionInfoEx tag. Here are the details: https://sourceforge.net/p/minidlna/feat ... uests/113/

I have tested with UMS and subtitles are displayed. But I don't know if UMS is embedding them in the MKV stream (maybe with transcoding?) or if they are reported in the external file.

In order to confirm if the bug is in the TV or in minidlna could you please help me with this questions:

1) How can I configure UMS to prevent it to embed the subtitles in the MKV stream? (to be sure that they are reported in a external file, as minidlna does)

2) How can I see all the HTTP requests and responses in UMS logs?

Thanks!
Nadahar
Posts: 1990
Joined: Tue Jun 09, 2015 5:57 pm

Re: How to force external subtitles and see HTTP requests/responses

Post by Nadahar »

You can see a lot of what UMS does, like if it's trascoding (embedding subtitles) or streaming (sending subtitles) in the TRACE log. Some of the HTTP traffic is also shown there. To enable TRACE logs, go to the "Logs" tab and select "TRACE" in both log level settings there.

If you want the complete HTTP picture, I'd recommend WireShark if you're on Windows - there are similar tools for Linux.
User avatar
squadjot
Moderator
Posts: 652
Joined: Fri Jun 01, 2012 4:24 am

Re: How to force external subtitles and see HTTP requests/responses

Post by squadjot »

I'm pretty sure subtitles are embeded in to a MKV stream for it to work on the J series
Exsport was the one who helped me with that here: viewtopic.php?f=9&t=3874&hilit=tizen

Afaik, The 2015 Models are different, and are not using the CaptionInfoEx
If you find a way to transcode to this tv, please let us know
Nadahar
Posts: 1990
Joined: Tue Jun 09, 2015 5:57 pm

Re: How to force external subtitles and see HTTP requests/responses

Post by Nadahar »

squadjot wrote: If you find a way to transcode to this tv, please let us know
You mean stream?
User avatar
squadjot
Moderator
Posts: 652
Joined: Fri Jun 01, 2012 4:24 am

Re: How to force external subtitles and see HTTP requests/responses

Post by squadjot »

Nadahar wrote:
squadjot wrote: If you find a way to transcode to this tv, please let us know
You mean stream?
No?

Edit: Here's where i got to with transcoding : viewtopic.php?f=9&t=3874&hilit=tizen&start=10#p17934
Never got it working.
Nadahar
Posts: 1990
Joined: Tue Jun 09, 2015 5:57 pm

Re: How to force external subtitles and see HTTP requests/responses

Post by Nadahar »

squadjot wrote: No?

Edit: Here's where i got to with transcoding : viewtopic.php?f=9&t=3874&hilit=tizen&start=10#p17934
Never got it working.
Ok, you're just confusing me then. What ofrias is saying is that it works with UMS but not with minidlna. What he wants to know is why, so he'd like to know if UMS is actually transcoding and then burning in the subtitles, or if the TV can handle subtitles but that minidlna is somehow sending the wrong information.

Then you say that for it to work they are probably embedded into a MKV. This is probably where the misunderstanding lies, as I interpret that as burnt in aka transcoded. Maybe you mean that they are sent as separate tracks in the MKV. Anyway, from my reasoning, you said they are probably transcoded, and then you don't know a way to transcode to this TV. From that I concluded that you probably meant the opposite. So, I'm still not sure what you mean, only that I misunderstood something.
User avatar
squadjot
Moderator
Posts: 652
Joined: Fri Jun 01, 2012 4:24 am

Re: How to force external subtitles and see HTTP requests/responses

Post by squadjot »

Nadahar wrote:Maybe you mean that they are sent as separate tracks in the MKV
Yea i guess that's what both OP and i mean.

So, to be more specific, Muxing the stream into a MKV container with embedded subtitles (not burned in) does work.
Transcoding with mencoder/ffmpeg does not seem to work

The links i provided should explain (Reply's from Exsport)

Sorry for the confusion.
ofrias
Posts: 5
Joined: Wed Dec 23, 2015 9:49 pm

Re: How to force external subtitles and see HTTP requests/responses

Post by ofrias »

I have enabled trace logs but I am still not sure about what is happening. In particular I don't know if UMS is just sending the link to the SRT file to the TV, or if it is adding the subtitles stream to the MKV file.

In the TV, I see the file with this name: myfile {StreamSub:SubRip:Spanish}.mkv

The chunk between { } has been added by UMS. Does this mean that UMS has added a track to the MKV?

On the other side, this is what I see in the logs. It looks like the TV is requesting a separate URL for the subtitles:

Code: Select all

18:00:05 TRACE HTTP: upnp/control/content_directory / 0-0
18:00:05 TRACE Setting subsAreValidForStreaming to true for myfile.srt
18:00:05 TRACE Network debugger: "myfile.mkv" http-get:*:video/avi:DLNA.ORG_OP=01 pv:subtitleFileType=SRT pv:subtitleFileUri=http://192.168.1.134:5001/get/29/subtitle0000myfile.srt size=576993989 duration=00:22:38.00 http://192.168.1.134:5001/get/29/myfile.mkv
18:00:05 TRACE Network debugger: http-get:*:text/srt:*http://192.168.1.134:5001/get/29/subtitle0000myfile.srt
18:00:05 TRACE <?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><DIDL-Lite xmlns="urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:upnp="urn:schemas-upnp-org:metadata-1-0/upnp/"><item id="29" parentID="25" restricted="true"><dc:title>myfile.mkv {StreamSub:SubRip:Spanish}</dc:title><res xmlns:dlna="urn:schemas-dlna-org:metadata-1-0/" protocolInfo="http-get:*:video/avi:DLNA.ORG_OP=01" pv:subtitleFileType="SRT" pv:subtitleFileUri="http://192.168.1.134:5001/get/29/subtitle0000myfile.srt" size="576993989" duration="00:22:38.00" resolution="1280x720" bitrate="424800" nrAudioChannels="6" sampleFrequency="48000">http://192.168.1.134:5001/get/29/myfile.mkv</res><res protocolInfo="http-get:*:text/srt:*">http://192.168.1.134:5001/get/29/subtitle0000myfile.srt</res><res protocolInfo="http-get:*:image/jpeg:DLNA.ORG_PN=JPEG_TN">http://192.168.1.134:5001/get/29/thumbnail0000myfile.mkv</res><res protocolInfo="http-get:*:image/jpeg:DLNA.ORG_PN=JPEG_SM">http://192.168.1.134:5001/get/29/thumbnail0000myfile.mkv</res><dc:date>2015-02-20T17:55:50</dc:date><upnp:class>object.item.videoItem</upnp:class></item></DIDL-Lite></Result>
<NumberReturned>1</NumberReturned>
<TotalMatches>1</TotalMatches>
<UpdateID>2</UpdateID>
</u:BrowseResponse>
</s:Body>
</s:Envelope>

18:00:05 TRACE Sent to socket: Content-Type: text/xml; charset="utf-8"
18:00:05 TRACE Sent to socket: Server: Linux-amd64-4.2.0-22-generic, UPnP/1.0, UMS/5.3.1
18:00:05 TRACE Sent to socket: Content-Length: 1618
18:00:05 TRACE Opened request handler on socket /192.168.1.133:34031
18:00:05 TRACE Request: HTTP/1.0 : HEAD : get/29/myfile.mkv
18:00:05 DEBUG Matched media renderer "[TV] UE65JU7000" based on address /192.168.1.133
18:00:05 TRACE Received on socket: getCaptionInfo.sec: 1
18:00:05 TRACE Received on socket: HOST: 192.168.1.134:5001
18:00:05 TRACE Received on socket: Connection: close
18:00:05 TRACE Recognized media renderer: [TV] UE65JU7000
18:00:05 TRACE HTTP: get/29/myfile.mkv / 0-0
18:00:05 TRACE Asked stream chunk : TimeRange [start=null, end=null] of myfile.mkv and player null
18:00:05 DEBUG Reading SubtitleHttpHeader: "CaptionInfo.sec" (default: "")
18:00:05 DEBUG Reading hide_extensions: false (default: true)
18:00:05 DEBUG Reading ChunkedTransfer: true (default: false)
18:00:05 DEBUG Matched media renderer "[TV] UE65JU7000" based on address /192.168.1.133
18:00:05 INFO  Started playing myfile.mkv on your [TV] UE65JU7000
18:00:05 TRACE Sent to socket: CaptionInfo.sec: http://192.168.1.134:5001/get/29/subtitle0000.srt
18:00:05 DEBUG The full filename of which is: /mnt/almacen/minidlnatest/myfile.mkv and the address of the renderer is: 192.168.1.133
18:00:05 TRACE Sent to socket: Content-Type: video/avi
18:00:05 TRACE Sent to socket: Accept-Ranges: bytes
18:00:05 TRACE Sent to socket: Connection: keep-alive
18:00:05 TRACE Sent to socket: Server: Linux-amd64-4.2.0-22-generic, UPnP/1.0, UMS/5.3.1
18:00:05 TRACE Sent to socket: Content-Length: 576993989
18:00:05 TRACE Opened request handler on socket /192.168.1.133:34032
18:00:05 TRACE Request: HTTP/1.1 : GET : get/29/subtitle0000.srt
18:00:05 DEBUG Matched media renderer "[TV] UE65JU7000" based on address /192.168.1.133
18:00:05 TRACE Received on socket: Accept: */*
18:00:05 TRACE Received on socket: Accept-Language: en-us
18:00:05 TRACE Received on socket: Connection: close
18:00:05 TRACE Received on socket: Host: 192.168.1.134
18:00:05 TRACE Received on socket: User-Agent: DLNA-Host
18:00:05 TRACE HTTP User-Agent: DLNA-Host
18:00:05 TRACE Recognized media renderer: [TV] UE65JU7000
18:00:05 TRACE HTTP: get/29/subtitle0000.srt / 0-0
18:00:05 TRACE Loading external subtitles: id: 100, type: SUBRIP, lang: es, externalFile: /mnt/almacen/minidlnatest/myfile.srt, external file character set: ISO-8859-1
18:00:05 TRACE Available Content-Length: 32198
18:00:05 TRACE Sent to socket: Content-Type: text/plain
18:00:05 TRACE Sent to socket: Expires: Sun, 17 Apr 2016 10:46:45 GMT
18:00:05 TRACE Sent to socket: Server: Linux-amd64-4.2.0-22-generic, UPnP/1.0, UMS/5.3.1
18:00:05 TRACE Sent to socket: Content-Length: 32198
18:00:06 TRACE Opened request handler on socket /192.168.1.133:34034
18:00:06 TRACE Request: HTTP/1.1 : HEAD : get/29/myfile.mkv
18:00:06 DEBUG Matched media renderer "[TV] UE65JU7000" based on address /192.168.1.133
18:00:06 TRACE Received on socket: getcontentFeatures.dlna.org: 1
18:00:06 TRACE Received on socket: Host: 192.168.1.134:5001
18:00:06 TRACE Received on socket: Connection: close
18:00:06 TRACE Recognized media renderer: [TV] UE65JU7000
18:00:06 TRACE HTTP: get/29/myfile.mkv / 0-0
18:00:06 TRACE Asked stream chunk : TimeRange [start=null, end=null] of myfile.mkv and player null
18:00:06 TRACE Sent to socket: CaptionInfo.sec: http://192.168.1.134:5001/get/29/subtitle0000.srt
18:00:06 TRACE Sent to socket: Content-Type: video/avi
18:00:06 TRACE Sent to socket: ContentFeatures.DLNA.ORG: DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=01700000000000000000000000000000
18:00:06 TRACE Sent to socket: Accept-Ranges: bytes
18:00:06 TRACE Sent to socket: Connection: keep-alive
18:00:06 TRACE Sent to socket: Server: Linux-amd64-4.2.0-22-generic, UPnP/1.0, UMS/5.3.1
18:00:06 TRACE Sent to socket: Content-Length: 576993989
18:00:06 TRACE Opened request handler on socket /192.168.1.133:34035
Nadahar
Posts: 1990
Joined: Tue Jun 09, 2015 5:57 pm

Re: How to force external subtitles and see HTTP requests/responses

Post by Nadahar »

I don't know the details of how this is logged myself, but I interpret it as it's being sent as a separate file and not muxed into the mkv. However, there's some vital information missing in your pasted log: The decision about how to deliver this file.

What you've posted is the playback itself, but before that UMS decides how this file should be delivered. That happens when you enter the folder with the file, when the folder is "browsed". That decision making process will probably shed some more light on the situation. Search the log backwards for the file name, or search for "final verdict" to get to the right part of the log.
ofrias
Posts: 5
Joined: Wed Dec 23, 2015 9:49 pm

Re: How to force external subtitles and see HTTP requests/responses

Post by ofrias »

Oops, sorry for that. This is the log with the "Final verdict" part. Does it mean that the 2 files are individually streamed, or is UMS merging them into one MKV ?

Code: Select all

19:38:56 TRACE Opened request handler on socket /192.168.1.133:34626
19:38:56 TRACE Request: HTTP/1.1 : POST : upnp/control/content_directory
19:38:56 DEBUG Matched media renderer "[TV] UE65JU7000" based on address /192.168.1.133
19:38:56 TRACE Received on socket: HOST: 192.168.1.134:5001
19:38:56 TRACE Received on socket: Accept: */*
19:38:56 TRACE Received on socket: CONTENT-LENGTH: 446
19:38:56 TRACE Received on socket: CONTENT-TYPE: text/xml; charset="utf-8"
19:38:56 TRACE Received on socket: USER-AGENT: DLNADOC/1.50 SEC_HHP_[TV] UE65JU7000/1.0 UPnP/1.0
19:38:56 TRACE Received on socket: SOAPACTION: "urn:schemas-upnp-org:service:ContentDirectory:1#Browse"
19:38:56 TRACE Received on socket: Connection: close
19:38:56 TRACE HTTP User-Agent: DLNADOC/1.50 SEC_HHP_[TV] UE65JU7000/1.0 UPnP/1.0
19:38:56 TRACE Recognized media renderer: [TV] UE65JU7000
19:38:56 TRACE HTTP: upnp/control/content_directory / 0-0
19:38:56 TRACE <?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><DIDL-Lite xmlns="urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:upnp="urn:schemas-upnp-org:metadata-1-0/upnp/"><container id="25" childCount="1" parentID="0" restricted="true"><dc:title>minidlnatest</dc:title><res protocolInfo="http-get:*:image/jpeg:DLNA.ORG_PN=JPEG_TN">http://192.168.1.134:5001/get/25/thumbnail0000minidlnatest</res><res protocolInfo="http-get:*:image/jpeg:DLNA.ORG_PN=JPEG_SM">http://192.168.1.134:5001/get/25/thumbnail0000minidlnatest</res><dc:date>2015-12-09T17:20:36</dc:date><upnp:class>object.container.storageFolder</upnp:class></container></DIDL-Lite></Result>
<NumberReturned>1</NumberReturned>
<TotalMatches>1</TotalMatches>
<UpdateID>1</UpdateID>
</u:BrowseResponse>
</s:Body>
</s:Envelope>

19:38:56 TRACE Sent to socket: Content-Type: text/xml; charset="utf-8"
19:38:56 TRACE Sent to socket: Server: Linux-amd64-4.2.0-22-generic, UPnP/1.0, UMS/5.3.1
19:38:56 TRACE Sent to socket: Content-Length: 1124
19:38:56 TRACE Opened request handler on socket /192.168.1.133:34627
19:38:56 TRACE Request: HTTP/1.1 : POST : upnp/control/content_directory
19:38:56 DEBUG Matched media renderer "[TV] UE65JU7000" based on address /192.168.1.133
19:38:56 TRACE Received on socket: HOST: 192.168.1.134:5001
19:38:56 TRACE Received on socket: Accept: */*
19:38:56 TRACE Received on socket: CONTENT-LENGTH: 454
19:38:56 TRACE Received on socket: CONTENT-TYPE: text/xml; charset="utf-8"
19:38:56 TRACE Received on socket: USER-AGENT: DLNADOC/1.50 SEC_HHP_[TV] UE65JU7000/1.0 UPnP/1.0
19:38:56 TRACE Received on socket: SOAPACTION: "urn:schemas-upnp-org:service:ContentDirectory:1#Browse"
19:38:56 TRACE Received on socket: Connection: close
19:38:56 TRACE HTTP User-Agent: DLNADOC/1.50 SEC_HHP_[TV] UE65JU7000/1.0 UPnP/1.0
19:38:56 TRACE Recognized media renderer: [TV] UE65JU7000
19:38:56 TRACE HTTP: upnp/control/content_directory / 0-0
19:38:56 TRACE Matched format MKV to "/mnt/almacen/minidlnatest/myfile.mkv"
19:38:56 DEBUG Detected encoding for /mnt/almacen/minidlnatest/myfile.srt is ISO-8859-1.
19:38:56 DEBUG Detected encoding for /mnt/almacen/minidlnatest/myfile.srt is ISO-8859-1.
19:38:56 TRACE Adding new child "myfile.mkv" with class "net.pms.dlna.RealFile"
19:38:56 DEBUG Reading disable_transcode_for_extensions: "mkv" (default: "")
19:38:56 TRACE File "myfile.mkv" will be forced to skip transcoding by configuration
19:38:56 TRACE Getting player for resource "myfile.mkv"
19:38:56 TRACE Returning compatible player "FFmpeg"
19:38:56 TRACE Looking for an audio track with lang: eng
19:38:56 TRACE Looking for an audio track with lang: fre
19:38:56 TRACE Looking for an audio track with lang: jpn
19:38:56 TRACE Looking for an audio track with lang: ger
19:38:56 TRACE Looking for an audio track with lang: und
19:38:56 TRACE Matched audio track: id: 0, lang: und, audio codec: AC3, sample frequency:48000, number of channels: 6, bits per sample: 16
19:38:56 TRACE Searching for a match for: und with eng and off
19:38:56 TRACE Searching for a match for: und with * and eng
19:38:56 TRACE Searching for a match for: und with * and und
19:38:56 TRACE Matched external subtitles track that did not match language preferences: id: 100, type: SUBRIP, lang: es, externalFile: /mnt/almacen/minidlnatest/myfile.srt, external file character set: ISO-8859-1
19:38:56 DEBUG Reading SupportedExternalSubtitlesFormats: "SUBRIP,ASS,TEXT,MICRODVD,WEBTT,SAMI" (default: "")
19:38:56 TRACE This video has external subtitles that should be streamed
19:38:56 TRACE Matched support line f:avi|mkv             m:video/avi
19:38:56 DEBUG Reading MaxVideoBitrateMbps: "25" (default: "0")
19:38:56 TRACE Final verdict: "myfile.mkv" will be streamed
19:38:56 TRACE Matched support line f:avi|mkv             m:video/avi
19:38:56 TRACE File "myfile.mkv" will be sent with MIME type "video/avi"
19:38:56 TRACE Adding "myfile.mkv" to transcode folder for player: "null"
19:38:56 TRACE Adding new child "myfile.mkv {StreamSub:SubRip/Spanish}" with class "net.pms.dlna.FileTranscodeVirtualFolder"
19:38:56 TRACE Could not match any format to "/mnt/almacen/minidlnatest/myfile.srt"
19:38:56 TRACE Could not match any format to "/mnt/almacen/minidlnatest/myfile.srt"
19:38:56 TRACE End of analysis for /mnt/almacen/minidlnatest
19:38:56 TRACE Setting subsAreValidForStreaming to true for myfile.srt
19:38:56 TRACE Network debugger: "myfile.mkv" http-get:*:video/avi:DLNA.ORG_OP=01 pv:subtitleFileType=SRT pv:subtitleFileUri=http://192.168.1.134:5001/get/29/subtitle0000myfile.srt size=576993989 duration=00:22:38.00 http://192.168.1.134:5001/get/29/myfile.mkv
19:38:56 TRACE Network debugger: http-get:*:text/srt:*http://192.168.1.134:5001/get/29/subtitle0000myfile.srt
19:38:56 TRACE <?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><DIDL-Lite xmlns="urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:upnp="urn:schemas-upnp-org:metadata-1-0/upnp/"><container id="26" childCount="1" parentID="25" restricted="true"><dc:title>#--TRANSCODE--#</dc:title><res protocolInfo="http-get:*:image/jpeg:DLNA.ORG_PN=JPEG_TN">http://192.168.1.134:5001/get/26/thumbnail0000%23--TRANSCODE--%23</res><res protocolInfo="http-get:*:image/jpeg:DLNA.ORG_PN=JPEG_SM">http://192.168.1.134:5001/get/26/thumbnail0000%23--TRANSCODE--%23</res><upnp:class>object.container.storageFolder</upnp:class></container><item id="29" parentID="25" restricted="true"><dc:title>myfile.mkv {StreamSub:SubRip:Spanish}</dc:title><res xmlns:dlna="urn:schemas-dlna-org:metadata-1-0/" protocolInfo="http-get:*:video/avi:DLNA.ORG_OP=01" pv:subtitleFileType="SRT" pv:subtitleFileUri="http://192.168.1.134:5001/get/29/subtitle0000myfile.srt" size="576993989" duration="00:22:38.00" resolution="1280x720" bitrate="424800" nrAudioChannels="6" sampleFrequency="48000">http://192.168.1.134:5001/get/29/myfile.mkv</res><res protocolInfo="http-get:*:text/srt:*">http://192.168.1.134:5001/get/29/subtitle0000myfile.srt</res><res protocolInfo="http-get:*:image/jpeg:DLNA.ORG_PN=JPEG_TN">http://192.168.1.134:5001/get/29/thumbnail0000myfile.mkv</res><res protocolInfo="http-get:*:image/jpeg:DLNA.ORG_PN=JPEG_SM">http://192.168.1.134:5001/get/29/thumbnail0000myfile.mkv</res><dc:date>2015-02-20T17:55:50</dc:date><upnp:class>object.item.videoItem</upnp:class></item></DIDL-Lite></Result>
<NumberReturned>2</NumberReturned>
<TotalMatches>2</TotalMatches>
<UpdateID>2</UpdateID>
</u:BrowseResponse>
</s:Body>
</s:Envelope>

19:38:56 TRACE Sent to socket: Content-Type: text/xml; charset="utf-8"
19:38:56 TRACE Sent to socket: Server: Linux-amd64-4.2.0-22-generic, UPnP/1.0, UMS/5.3.1
19:38:56 TRACE Sent to socket: Content-Length: 2113
Post Reply