Open image thumb generated from video file
#1
I using PIL library to open image from link returned from json request. When thumb are created from video file, json return link to this file:
Code:
image://video@smb%3a%2f%2f192.168.1.101%2fO%2fSeriale%2fRodzinka.pl%2fSezon%201%2fRodzinka.pl.S01E26.avi/

It is a way to open this created thumb or create it again from video file using python?
Reply
#2
you can open the url using xbmcVfs. if PIL can eat a file-like object, you can pass it, if not you have to copy to a temp file, then open that (or read into memory and open from there).
Reply
#3
IIRC, a virtual image:// path corresponds to a real http:// path served by the Kodi web-UI. But unfortunately, I forgot how those paths are converted into each other and cannot find the info quickly. Maybe someone else remembers?

Update: I've found it: http://kodi.wiki/view/Webserver#Image_cache_.2Fimage
Reply
#4
(2015-09-24, 13:35)ironic_monkey Wrote: you can open the url using xbmcVfs. if PIL can eat a file-like object, you can pass it, if not you have to copy to a temp file, then open that (or read into memory and open from there).

Thanks, it works.
link for xbmcvfs must be encoded using urllib.quote_plus and must have prefix "image://".
To load image using PIL:

Code:
import xbmcvfs
import cStringIO
from PIL import Image

f = xbmcvfs.File(source)
data = f.read()
f.close()
source = cStringIO.StringIO(data)

image = Image.open(source)
Reply

Logout Mark Read Team Forum Stats Members Help
Open image thumb generated from video file0