Working on a simple remote app and I'm trying to pull over the thumbnails generated for my videos. If I use the method VideoLibary.GetMovies then it returns a lovely blob of JSON represented videos, and one attribute is the "thumbnail" : "special://masterprofile/Thumbnails/Video/1/1a4eaf33.tbn"
But I'm not sure how to access this image in my application. Is there a method I'm not seeing to somehow send image data over the API? And also, how do I read a .tbn file in the first place (I've read up on it a bit on the Wiki but still not quite sure).
Any help would be greatly appreciated! Thanks.
jsonrpc have a Files.Download method that will specify depending on the transport layer how you can aquire it. In the current state the only transport layer capable of delievering binary blobs is http and it has a standard way of dealing with it. So you can skip the Files.Download spec since its unused here, just worth mentioning since its by design as some transport may need it, say TCP which might open a new socket just for the data.
Onwards to your question, http has a vfs node which you may use.
http://IP:PORT/vfs/urlencodedpathtodata
So Files.Download should give you vfs/urlencodedpathtodata (if you want to use it, there is no real need for http).
example:
http://localhost:8080/vfs/special://mast...4eaf33.tbn
The .tbn is either a png or a jpeg, there is no real way to know which but most imagelibraries will be able to tell them appart without knowing the extention. At some point we will probably deprecate the .tbn.
Perfect! Works great, thanks very much.
Sounds Great.
I was wondering is there also a API for retreiving thumbnail's location in filesystem by giving the Movie's filename?
e.g. GetThumbnailURL("Cliffhanger (1993).iso"
This requires the XBMC to be running ofcource.
But how could I read the database by PHP and there ask what thumbnails are there for spesific movie?
Apologies for resurrecting this topic however I'm trying to grab the thumbnail of the currently playing item.
If we assume for now that I'm trying to pull a TV episode thumbnail:
When the item is in the library (provided the thumbnail param is requested) the json Player.GetItem call will give me the thumbnail as a tvdb url.
However when the item is NOT in the library I get the following result:
Code:
{"id":"VideoGetItem","jsonrpc":"2.0","result":{"item":{"fanart":"","file":"nfs://myservers_ipaddress/media/Hitachi4TB/tv/American Horror Story/Season3/American Horror Story - S03E09 - Head.mkv","label":"American Horror Story - S03E09 - Head.mkv","thumbnail":"image://video@nfs%3a%2f%2fmyservers_ipaddress%2fmedia%2fHitachi4TB%2ftv%2fAmerican%20Horror%20Story%2fSeason3%2fAmerican%20Horror%20Story%20-%20S03E09%20-%20Head.mkv/","type":"unknown"}}}
The thumbnail decoded is:
Code:
image://video@nfs://myservers_ipaddress/media/Hitachi4TB/tv/American Horror Story/Season3/American Horror Story - S03E09 - Head.mkv
I don't see how I'm able to get this thumbnail, any ideas?
Ciao, I have somewhat similar issue user Habitual, but the URL returned by the JSON-RPC is postfixed with
Code:
/transform?size=thumb
For example this I get the following JSON-RPC response
Code:
{
"id": "0",
"jsonrpc": "2.0",
"result": {
"item": {
"file": "/home/pi/_MG_9679-78.jpg",
"label": "_MG_9679-78.jpg",
"thumbnail": "image://%2fhome%2fpi%2f_MG_9679-78.jpg/transform?size=thumb",
"type": "picture"
}
}
}
There are two issues:
- The %2fhome%2fpi%2f prefix is not correctly interpreted, either that I leave it unchanged, I unencode it, or double encode it. The response from the http://xbmc:8080/image/ is always file not found. If I strip away the prefix, then the http get would download the FULL image. E.g.: this works to download the full image: http://xbmc:8080/image/_MG_9569-44.jpg
- The /transform?size=thumb postfix always generate file not found as a response. Either I leave it as is, or url encoded. For instance this http://xbmc:8080/image/_MG_9569-44.jpg/t...size=thumb does NOT work, unfortunately.
Any idea how can I fix my two issues, please? The first one I don't care much, but be able to have a thumbnail rather then the full download would be helpful.
Thank you very much in advance,
Ciao
(2013-12-23, 03:11)Habitual Wrote: [ -> ]I don't see how I'm able to get this thumbnail, any ideas?
Thanks Tolriq. That works!.... I should have posted earlier and saved the hours I've spent trying to get this to work myself.
By the looks you're missing a double URL encode on the first. i.e. the URL is url_encode(image://url_encode(smb://blah/))
As always, pass in the (url encoded) URL you get from JSON-RPC.
The second one only works because it directly accesses the original artwork on your samba share. But the idea behind image:// URLs is that you access a locally cached version of the artwork which should be faster and also works for HTTP sources etc.
(2014-03-24, 08:50)jmarshall Wrote: [ -> ]By the looks you're missing a double URL encode on the first. i.e. the URL is url_encode(image://url_encode(smb://blah/))
As always, pass in the (url encoded) URL you get from JSON-RPC.
Thanks you are correct, I had url decoded the artwork url before adding the image:// portion. Its working fine now