Req Get movie advanced details
#1
Hi, I'm building a webpage to display the movies available in Kodi using a Python script which queries the server using a single "VideoLibrary.GetMovies" request with some parameters (IMDB number, title and year for now) and building a simple HTML out of the JSON returned by it.

Works fine, however I'd like to have more details available to choose from, starting with each movie's resolution (video height & width, or else a simple HD 720/1080/SD tag might do the trick) and also it's associated file size in bytes or GB. As the latter may not be possible if there are stacked movies, a string containing the movie file or folder would do, whatever I can get, and then getting the size by myself through Python.

However this does not seem feasible after reading the documentation (Which is lacking, as another fellow user posted in this forum), but again I may have missed something important
Reply
#2
For the video resolution etc you need to retrieve "streamdetails" and look for the video stream and read out its details.
For the file size you need to retrieve "size" which should be in bytes IIRC.

These are all well documented when you go to JSON-RPC_API/v6 (wiki) and from there to JSON-RPC_API/v6#VideoLibrary.GetMovies (wiki) and from there to JSON-RPC_API/v6#Video.Fields.Movie (wiki) you should find all of these details.
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
#3
I found streamdetails, thank you, however as the info doesn't get populated by Kodi automatically as I thought it was, I'll have to find a workaround for this instead of playing each and every library file for a couple seconds for this field to be filled...

Regarding getting the file size, I could not find the return value, sorry

Thanks!
Reply
#4
You don't have to play every file. You just need to go into a GUI view that shows the items and Kodi will then load all the details in the background. After that all the streamdetails should also be available through JSON-RPC.
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
Hi Montellese,

It seems that as I'm running Raspbmc, that option was disabled by default to free the Raspberry Pi's CPU from too much usage. Disabling it in settings has worked with no problem, and now after leaving the Pi a couple of hours the data is slowly being generated and now every movie has been analysed.

Regarding the file size, the "file" parameter returns the file path (Or paths if the movie is stacked), and then it's just a matter of using Python's os.path.getsize() or whatever other language's method to get the value and then use it.


Thank you! And sorry for the inconvenience
Reply
#6
(2015-03-24, 08:54)Montellese Wrote: For the video resolution etc you need to retrieve "streamdetails" and look for the video stream and read out its details.
For the file size you need to retrieve "size" which should be in bytes IIRC.

These are all well documented when you go to JSON-RPC_API/v6 (wiki) and from there to JSON-RPC_API/v6#VideoLibrary.GetMovies (wiki) and from there to JSON-RPC_API/v6#Video.Fields.Movie (wiki) you should find all of these details.

I'm trying to retrieve the resolution of a video ("1080", or "720", etc) by using VideoLibrary.GetMovieDetails (including field streamdetails).

However, streamdetails.video does not seem to include a "resolution" property.

Is that supported? I can't see it listed in http://kodi.wiki/view/JSON-RPC_API/v6#Video.Streams

I think there should a way to obtain this information via JSON-RPC directly, at least for skinners have the possibility?
Looking into this issue, I read on a post from 2009 about possibly implementing: ListItem.VideoResolution, however that doesn't seem to be in the V6 spec either.

Otherwise, I'd just implement this on the javascript client: https://github.com/xbmc/xbmc/blob/8d4a5b...s.cpp#L559

But before reinventing the wheel, I thought I would ask first Smile

It could very well be also that I'm missing something or doing something wrong.
Reply
#7
Deciding on what video you are looking to get the resolution for, the commands are different. That ListItem command should get a video resolution of the currently selected item in your current containers list.
I would expect the VideoLibrary.GetMovieDetials method to get the currently PLAYING video info, but if as you say it doesn't, and the playing video resolution is actually what you want, then what you should try is not ListItem command but the VideoPlayer command. And the way you need to send it via jsonrpc is with the infolabel method in the xmbc namespace, not anything in VideoLibrary namespace.
Reply
#8
Right, I'm only trying to show (on html, not in skin) the media flags for a given movie in the library, which is not necessarily currently playing.

AFAIK, I should use VideoLibrary.GetMovieDetials, I thought .streamdetails would give me the resolution, but it doesn't, so I ask if there is another way to get it.
Reply
#9
i should say haven't used video much so maybe should butt out, but it seems to me the the problem with montellese's suggestion is that if your trying to do work with an entirely remote client, you aren't using a GUI view (ie osd/skin...) so I might expect what he suggests not to work, especially if the media your regarding inst already scanned into your library.

So if looking to do this entirely remotely, stream details or whatever metadata at the least should be available for any media scanned into Video library using via Video.GetXXXDetails.
I would wish that any/all info is also available for non scanned items that might just be opened in a directory or list otherwise, but wouldn't be shocked if that couldn't be done.
Finally would expect that any thing currently being played, in the Video Library or not would have the info available as well (via Player.GetItem)

But for some reason any of that doesnt work via methods, i mentioned the use of info label via XBMC.
Reply

Logout Mark Read Team Forum Stats Members Help
Get movie advanced details0