Play Using: Integrate transcoding
#1
When using "Play Using", in order for it to work it requires knowing what file type is to be played and what the renderer is capable of playing.

It would seem beneficial if "Play Using" could transcode (by this I mean change the container from, say, mkv to mp4 or mp4 to mkv) content rather than just deliver it when appropriate.
Reply
#2
There is a plan to add this. Our main UPnP guy (alcoheaca) was working on transcoding for a while, but had to take a break from all things XBMC in order to focus on real life endeavors. I imagine when he ever gets time again he would really want to resume his work. At the very least it will be a starting point for any other devs who have the time and want to get transcoding in. All in good time, I'm sure.

Although in many cases, as I understand it, don't always require a full transcoding but just some method of remuxing or something about DLNA profiles. Like you said, changing the container format is often the big issue. That kind of stuff will likely come even sooner, since it doesn't really require the video codecs to be changed/re-encoded, but I don't know the full details on that.
Reply
#3
There may be an even easier solution to the problem I'm facing (with a Samsung TV no less.)

Searching on the 'net, I found this thread:

http://yabb.jriver.com/interact/index.php?topic=71843.0

I then ran a capture between XBMC and the TV and noticed this:

HTTP/1.1 200 OK
Last-Modified: Thu, 20 Feb 2014 16:02:06 GMT
Cache-Control: max-age=0,must-revalidate
Date: Sun, 23 Feb 2014 03:16:00 GMT
Accept-Ranges: bytes
ContentFeatures.DLNA.ORG: DLNA.ORG_OP=01;DLNA.ORG_CI=0
TransferMode.DLNA.ORG: Streaming
Content-Length: 9386349440
Content-Type: video/x-matroska
Connection: close
Server: UPnP/1.0 DLNADOC/1.50 Platinum/0.6.9.1

And all through the conversation, I see "video/x-matroska".

Ultimately XBMC needs a list of some kind to know which devices can understand "video/x-matroska" and which need "video/x-mkv", but in the mean time, is there any knob that I can tune that will allow me to get XBMC to change the mime type from "video/x-matroska" to "video/x-mkv"?
Reply
#4
There is no mime type named "video/x-mkv". It's a brain fart of some Samsung developer.

But you are lucky as I have a Samsung TV with this problem as well and I fixed it in the nightly builds with PR4058 so with the current nightly builds and the upcoming Gotham stable release you'll be able to use Play using with your Samsung TV.
Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not e-mail Team Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply
#5
(2014-02-23, 13:05)Montellese Wrote: There is no mime type named "video/x-mkv". It's a brain fart of some Samsung developer.

But you are lucky as I have a Samsung TV with this problem as well and I fixed it in the nightly builds with #4058 so with the current nightly builds and the upcoming Gotham stable release you'll be able to use Play using with your Samsung TV.

Ok, so I'm using a nightly build (23-2-2014) but the "Play Using" fails against the Samsung TV.

Does this mean XBMC is failing to detect my TV as being a Samsung device or is something required on my part to turn this on?
Reply
#6
I only have one TV (Samsung UE55F6500) to test this with so I can't say it works for all of them but it certainly works with my TV. There will probably be nothing in the debug logs but it might be worth a shot if you could start XBMC (with debug logging enabled), try "Play using" to your TV and then close XBMC again and upload the debug log.
Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not e-mail Team Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply
#7
I can't find a way to attach a file to this reply so I'll include some debug text:

Code:
19:57:10 T:5884   DEBUG: Thread JobWorker 5884 terminating (autodelete)
19:57:22 T:12720   DEBUG: CPlayerCoreConfig::<ctor>: created player [TV]UA55ES7100 for core 5
19:57:39 T:11700   DEBUG: CAESinkDirectSound::Deinitialize: Cleaning up
19:58:08 T:13088  NOTICE: Thread JobWorker start, auto delete: true
19:58:08 T:12904   DEBUG: ------ Window Init (Pointer.xml) ------
19:58:10 T:12904   DEBUG: CApplication::ProcessMouse: trying mouse action rightclick
19:58:10 T:12904   DEBUG: CPlayerCoreFactory::GetPlayers(E:\MOVIE.mkv)
19:58:10 T:12904   DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: system rules
19:58:10 T:12904   DEBUG: CPlayerSelectionRule::GetPlayers: matches rule: system rules
19:58:10 T:12904   DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: rtv
19:58:10 T:12904   DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: hdhomerun/myth/mms/udp
19:58:10 T:12904   DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: lastfm/shout
19:58:10 T:12904   DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: rtmp
19:58:10 T:12904   DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: rtsp
19:58:10 T:12904   DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: streams
19:58:10 T:12904   DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: dvd
19:58:10 T:12904   DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: dvdimage
19:58:10 T:12904   DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: sdp/asf
19:58:10 T:12904   DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: nsv
19:58:10 T:12904   DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: radio
19:58:10 T:12904   DEBUG: CPlayerCoreFactory::GetPlayers: matched 0 rules with players
19:58:10 T:12904   DEBUG: CPlayerCoreFactory::GetPlayers: adding videodefaultplayer (1)
19:58:10 T:12904   DEBUG: CPlayerCoreFactory::GetPlayers: for video=1, audio=0
19:58:10 T:12904   DEBUG: CPlayerCoreFactory::GetPlayers: for video=1, audio=1
19:58:10 T:12904   DEBUG: CPlayerCoreFactory::GetPlayers: adding player: DVDPlayer (1)
19:58:10 T:12904   DEBUG: CPlayerCoreFactory::GetPlayers: adding player: media-PC (4)
19:58:10 T:12904   DEBUG: CPlayerCoreFactory::GetPlayers: adding player: Denon AVR-X4000 (5)
19:58:10 T:12904   DEBUG: CPlayerCoreFactory::GetPlayers: adding player: [TV]UA55ES7100 (6)
19:58:10 T:12904   DEBUG: CPlayerCoreFactory::GetPlayers: added 4 players
19:58:10 T:12904   DEBUG: CFavourites::Load - no system favourites found, skipping
19:58:10 T:12904   DEBUG: CFavourites::Load - no userdata favourites found, skipping
19:58:10 T:12904    INFO: Loading skin file: DialogContextMenu.xml, load type: KEEP_IN_MEMORY
19:58:10 T:12904   DEBUG: ------ Window Init (DialogContextMenu.xml) ------
19:58:12 T:12904   DEBUG: CApplication::ProcessMouse: trying mouse action leftclick
19:58:13 T:12904   DEBUG: ------ Window Deinit (DialogContextMenu.xml) ------
19:58:13 T:12904   DEBUG: CPlayerCoreFactory::GetPlayers(E:\MOVIE.mkv)
19:58:13 T:12904   DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: system rules
19:58:13 T:12904   DEBUG: CPlayerSelectionRule::GetPlayers: matches rule: system rules
19:58:13 T:12904   DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: rtv
19:58:13 T:12904   DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: hdhomerun/myth/mms/udp
19:58:13 T:12904   DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: lastfm/shout
19:58:13 T:12904   DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: rtmp
19:58:13 T:12904   DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: rtsp
19:58:13 T:12904   DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: streams
19:58:13 T:12904   DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: dvd
19:58:13 T:12904   DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: dvdimage
19:58:13 T:12904   DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: sdp/asf
19:58:13 T:12904   DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: nsv
19:58:13 T:12904   DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: radio
19:58:13 T:12904   DEBUG: CPlayerCoreFactory::GetPlayers: matched 0 rules with players
19:58:13 T:12904   DEBUG: CPlayerCoreFactory::GetPlayers: adding videodefaultplayer (1)
19:58:13 T:12904   DEBUG: CPlayerCoreFactory::GetPlayers: for video=1, audio=0
19:58:13 T:12904   DEBUG: CPlayerCoreFactory::GetPlayers: for video=1, audio=1
19:58:13 T:12904   DEBUG: CPlayerCoreFactory::GetPlayers: adding player: DVDPlayer (1)
19:58:13 T:12904   DEBUG: CPlayerCoreFactory::GetPlayers: adding player: media-PC (4)
19:58:13 T:12904   DEBUG: CPlayerCoreFactory::GetPlayers: adding player: Denon AVR-X4000 (5)
19:58:13 T:12904   DEBUG: CPlayerCoreFactory::GetPlayers: adding player: [TV]UA55ES7100 (6)
19:58:13 T:12904   DEBUG: CPlayerCoreFactory::GetPlayers: added 4 players
19:58:13 T:12904   DEBUG: ------ Window Init (DialogContextMenu.xml) ------
19:58:15 T:12904   DEBUG: CApplication::ProcessMouse: trying mouse action leftclick
19:58:16 T:12904   DEBUG: ------ Window Deinit (DialogContextMenu.xml) ------
19:58:16 T:12904   DEBUG: ------ Window Init (DialogContextMenu.xml) ------
19:58:18 T:12904   DEBUG: CApplication::ProcessMouse: trying mouse action leftclick
19:58:18 T:12904   DEBUG: ------ Window Deinit (DialogContextMenu.xml) ------
19:58:18 T:12904   DEBUG: CGUIWindowVideoBase::OnPlayMedia E:\MOVIE.mkv
19:58:18 T:12904   DEBUG: CAnnouncementManager - Announcement: OnClear from xbmc
19:58:18 T:12904   DEBUG: GOT ANNOUNCEMENT, type: 2, from xbmc, message OnClear
19:58:18 T:12904   DEBUG: CAnnouncementManager - Announcement: OnAdd from xbmc
19:58:18 T:12904   DEBUG: GOT ANNOUNCEMENT, type: 2, from xbmc, message OnAdd
19:58:18 T:12904   DEBUG: UPnP: Building didl for object 'E:\MOVIE.mkv'
19:58:18 T:12904   DEBUG: ------ Window Init (DialogBusy.xml) ------
19:58:20 T:11684   DEBUG: Received request to serve '37F7C4B9076828FB494F5777B86B9DB3/MOVIE.mkv' = 'E:\MOVIE.mkv'
19:58:26 T:12904   ERROR: UPNP: CUPnPPlayer::OpenFile - remote player signalled error E:\MOVIE.mkv
19:58:26 T:12904   ERROR: UPNP: CUPnPPlayer::OpenFile - unable to open file E:\MOVIE.mkv
19:58:26 T:12904   DEBUG: CApplication::OnPlayBackStopped : play state was 1, starting 0
19:58:26 T:12904   DEBUG: CAnnouncementManager - Announcement: OnStop from xbmc
19:58:26 T:12904   DEBUG: GOT ANNOUNCEMENT, type: 1, from xbmc, message OnStop
19:58:26 T:12904   ERROR: Playlist Player: skipping unplayable item: 0, path [E:\MOVIE.mkv]
19:58:26 T:12904   DEBUG: Playlist Player: no more playable items... aborting playback
19:58:26 T:10980  NOTICE: Thread BackgroundLoader start, auto delete: false
19:58:26 T:12904   DEBUG: ------ Window Deinit (DialogBusy.xml) ------

I went looking to see what's being exchanged between XBMC and the TV:

Code:
NOTIFY * HTTP/1.1
HOST: 239.255.255.250:1900
NT: urn:samsung.com:service:MultiScreenService
NTS: ssdp:byebye
USN: uuid:0d1cef00-00dc-1000-a04b-************::urn:samsung.com:service:MultiScreenService

NOTIFY * HTTP/1.1
HOST: 239.255.255.250:1900
NT: urn:samsung.com:device:MainTVServer2:1
NTS: ssdp:byebye
USN: uuid:0d1cef01-00dc-1000-a63c-************::urn:samsung.com:device:MainTVServer2:1

NOTIFY * HTTP/1.1
HOST: 239.255.255.250:1900
NT: urn:samsung.com:service:MainTVAgent2
NTS: ssdp:byebye
USN: uuid:0d1cef01-00dc-1000-a63c-************::urn:samsung.com:service:MainTVAgent2

NOTIFY * HTTP/1.1
HOST: 239.255.255.250:1900
CACHE-CONTROL: max-age= 1800
LOCATION: http://10.1.1.2:7676/smp_2_
NT: upnp:rootdevice
NTS: ssdp:alive
SERVER: SHP, UPnP/1.0, Samsung UPnP SDK/1.0
USN: uuid:0d1cef00-00dc-1000-a04b-************::upnp:rootdevice

GET /X_MS_MediaReceiverRegistrar/.../scpd.xml HTTP/1.1
HOST: XBMC_IP:1912
ACCEPT-ENCODING: deflate
ACCEPT-LANGUAGE: en-us
User-Agent: SEC_HHP_[TV]UA55ES7100/1.0 DLNADOC/1.50

HTTP/1.1 200 OK
CONTENT-LANGUAGE: UTF-8
CONTENT-TYPE: text/xml; charset="utf-8"
CONTENT-LENGTH: 1199
Date: Thu, 01 Jan 1970 00:00:17 GMT
connection: close
Application-URL: http://10.1.1.2:80/ws/app/
SERVER: SHP, UPnP/1.0, Samsung UPnP SDK/1.0
<?xml version="1.0"?>
<root xmlns='urn:schemas-upnp-org:device-1-0' xmlns:sec='http://www.sec.co.kr/dlna' xmlns:dlna='urn:schemas-dlna-org:device-1-0'>
<specVersion>
  <major>1</major>
  <minor>0</minor>
</specVersion>
<device>
  <deviceType>urn:samsung.com:device:RemoteControlReceiver:1</deviceType>
  <friendlyName>[TV]UA55ES7100</friendlyName>
  <manufacturer>Samsung Electronics</manufacturer>
  <manufacturerURL>http://www.samsung.com/sec</manufacturerURL>
  <modelDescription>Samsung TV RCR</modelDescription>
  <modelName>UA55ES7100</modelName>
  <modelNumber>1.0</modelNumber>
  <modelURL>http://www.samsung.com/sec</modelURL>
  <serialNumber>----------</serialNumber>
  <UDN>uuid:0d1cef00-00dc-1000-a04b-************</UDN>
  <sec:deviceID>*********</sec:deviceID>
  <sec:ProductCap>Resolution:1280X720,ImageZoom,ImageRotate,Y2012</sec:ProductCap>
  <serviceList>
   <service>
    <serviceType>urn:samsung.com:service:MultiScreenService:1</serviceType>
    <serviceId>urn:samsung.com:serviceId:MultiScreenService</serviceId>
    <controlURL>/smp_4_</controlURL>
    <eventSubURL>/smp_5_</eventSubURL>
    <SCPDURL>/smp_3_</SCPDURL>
   </service>
  </serviceList>
</device>
</root>
Reply
#8
Thanks for the details. Is the second snippet everything that is exchanged between XBMC and your TV? Next time please use pastebin or http://www.xbmclogs.com to post such snippets.

From the log it looks like that the patch I've added seems to work as without it, CUPnPPlayer already bailed out much earlier. Now it seems to send the Play action but the state of the UPnP renderer (your TV) doesn't change to PLAYING or PAUSED_PLAYBACK and returns STOPPED with an error.

What platform are you running on? I might be able to throw in some debug log messages and create a custom build for you so we can better track down the problem.
Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not e-mail Team Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply
#9
I've uploaded the fuller log to:

http://pastebin.com/3mjWfTSB

To get it down the 28k, it is bzip2'd and the uuencoded for base64. Raw text was about 800k.

Running on Windows, 32bit.
Reply
#10
Something that I noticed in the logs was xbmc trying to tell the TV to connect using an IP address on a virtual interface that the TV will never be able to reach.

There really ought to be a rule that if there is an IP address on the xbmc host that satisfies the condition where "xbmc_host_ip & xbmc_host_netmask == remote_deveice_ip & xbmc_host_netmask" that there really isn't any point sending DLNA commands using other IP addresses because the best one (on the same subnet) is already being used.
Reply
#11
Here's the test-build with a few additional logging messages: http://mirrors.xbmc.org/test-builds/win3...ogging.exe
That way we'll know for sure if the video/x-mkv quirk also works in your case or not.
Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not e-mail Team Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply
#12
The relevant log information is here:
http://pastebin.com/AqkDW2R4
I can a capture with wireshark and copied it somewhere useful:
$ strings - tv3.pcap | grep x-matroska | wc -l
4
$ strings - tv3.pcap | grep x-mkv | wc -l
0
$ strings - tv3.pcap | grep Content-Type | grep video
Content-Type: video/x-matroska

... so even though the "x-mkv" quirk is being activated, the code does not appear to be kicking in?
Reply
#13
Actually the quirk is only server-side. The problem is that the list of supported mime-types provided by your Samsung TV does not contain "video/x-matroska" but "video/x-mkv" so when XBMC's UPnP player checks if the UPnP renderer (your TV) supports the format of the media item to be played the quirk replaces video/x-matroska with video/x-mkv so that it will find a match in the list of supported mime-types. Without the quirk it would already fail there and never try to do the rest of the interaction.

Actually in the log snippet you provided there's no error from CUPnPPlayer. In my case it can take up to 10 or 15 seconds from the moment I tell XBMC to play the file until my TV actually starts playback.
Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not e-mail Team Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply
#14
I see an immediate pop up on the TV screen saying that it cannot play the content.

So it would seem that the quirk needs to be applied a second time - when the server side of xbmc replies back to the TV's request to serve the content. At present it is sending back "x-matroska" and there it would seem necessary for the xbmc server code to respond saying that the Content-Type is x-mkv?
Reply
#15
To try and help, installed kubuntu in a VM, built xbmc but then could go no further as the mouse would not work in xbmc.
Reply

Logout Mark Read Team Forum Stats Members Help
Play Using: Integrate transcoding0