Image Overlays & Performance

  Thread Rating:
  • 1 Votes - 2 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
Cragz Offline
Junior Member
Posts: 10
Joined: Jun 2009
Reputation: 0
Rainbow  Image Overlays & Performance
Post: #1
Hi guys,

I'm working on my first addon and trying to do a few neat* things, one of which is image manipulation prior to allowing XBMC to display it as an icon/fanart/other. I have everything working as intended by pulling in multiple images from the web, modifying & merging them using PIL and feeding them to XBMC through a local URL. It looks smashing (if I do say so myself), but the performance impact is fairly severe.

I'd love to perform the manipulation as a background task and feed have XBMC pick up the files as and when they become available. Any thoughts on how it might be possible? Any thoughts on design otherwise which might help alleviate my issues? One thing I'd like to stay away from is an external service of any type - I want this all to remain within the addon where possible.

Despite XBMC's cache this isn't really a one-time cost that I can deal with as by the nature of the app, the "channels" being browsed will differ fairly frequently and thus there's plenty of call for the overlaying.

I entirely understand if the responses are along the lines of "that's stupid - don't do it" or such, but better to ask than never know!

Cheers!

* daft
find quote
Bstrdsmkr Offline
Posting Freak
Posts: 803
Joined: Oct 2010
Reputation: 17
Post: #2
It depends a lot on the specifics, but you could include an XBMC service to do your fetching and stitching, and output them to a specified directory, then have the main addon grab them and use them. You can include the service addon with the regular addon so for all intents and purposes it's one addon.

The trick is the main addon has to be structured such that it can be called when a new image is ready, even if it's already running. That may cause you to have to refresh the whole addon when changing to a new image
find quote
Cragz Offline
Junior Member
Posts: 10
Joined: Jun 2009
Reputation: 0
Post: #3
Hi Bstrdsmkr, thanks for the advice, I'll look into it. Refreshing the whole addon won't really work for me, but if there's a way I can update an individual list item that would work perfectly.
find quote
topfs2 Online
Team-Kodi Developer
Posts: 4,179
Joined: Dec 2007
Reputation: 13
Post: #4
This is mostly an FYI but my clean scraping API GSoC will probably allow for this if I understand what you try to achieve?

My project will mostly be in regards to items which to extract information to the library but addons etc could probably use the same engine. Did you intend to alter the fanart for library items or addons?

If you have problems please read this before posting

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.

[Image: badge.gif]

"Well Im gonna download the code and look at it a bit but I'm certainly not a really good C/C++ programer but I'd help as much as I can, I mostly write in C#."
find quote
Martijn Offline
Team Kodi
Posts: 11,891
Joined: Jul 2011
Reputation: 170
Location: Dawn of time
Post: #5
(2012-07-26 14:52)topfs2 Wrote:  This is mostly an FYI but my clean scraping API GSoC will probably allow for this if I understand what you try to achieve?

My project will mostly be in regards to items which to extract information to the library but addons etc could probably use the same engine. Did you intend to alter the fanart for library items or addons?

I already have something lined up that will allow you to change fanart through JSON-RPC

Always read the XBMC online-manual, FAQ and search the forums before posting.
Do NOT e-mail Team-XBMC members asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting, make sure you read this first

For your mediacenter artwork go to
[Image: fanarttv.png]
find quote
topfs2 Online
Team-Kodi Developer
Posts: 4,179
Joined: Dec 2007
Reputation: 13
Post: #6
(2012-07-26 15:03)Martijn Wrote:  
(2012-07-26 14:52)topfs2 Wrote:  This is mostly an FYI but my clean scraping API GSoC will probably allow for this if I understand what you try to achieve?

My project will mostly be in regards to items which to extract information to the library but addons etc could probably use the same engine. Did you intend to alter the fanart for library items or addons?

I already have something lined up that will allow you to change fanart through JSON-RPC

Ah true that could also be used, listen to library additions and alter fanart when PIL part is done

If you have problems please read this before posting

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.

[Image: badge.gif]

"Well Im gonna download the code and look at it a bit but I'm certainly not a really good C/C++ programer but I'd help as much as I can, I mostly write in C#."
find quote
Cragz Offline
Junior Member
Posts: 10
Joined: Jun 2009
Reputation: 0
Post: #7
My current intentions are entirely addon-based - there are a couple of sites which provide multiple images per stream and you really need to see all of them at-a-glance to make an informed decision on what to watch without getting frustrated with the UI.

It looks like (although I'd be happy to be convinced otherwise Smile) the JSON-RPC approach may the path of least resistance. Will you be publishing your changes in the main JSON-RPC thread or elsewhere, Martijn?

I'll be keeping an keen eye on how you're getting on with your GSoC project too, topfs.

Thanks guys; appreciate the assistance.
find quote
Martijn Offline
Team Kodi
Posts: 11,891
Joined: Jul 2011
Reputation: 170
Location: Dawn of time
Post: #8
My script will be Frodo only since the changes to JSON-RPC only went in recently
It was meant to update the movie data like votes/ratings and also to fix the broken image urls since the TMDB changed their servers.
You can set the poster/fanart url/location directly into the database. So 3rd party apps can quite easy change them.

So maybe your intention are somewhat different Smile

Always read the XBMC online-manual, FAQ and search the forums before posting.
Do NOT e-mail Team-XBMC members asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting, make sure you read this first

For your mediacenter artwork go to
[Image: fanarttv.png]
(This post was last modified: 2012-07-26 22:37 by Martijn.)
find quote
jmarshall Offline
Team-XBMC Developer
Posts: 26,221
Joined: Oct 2003
Reputation: 178
Post: #9
I wonder what would happen if listitem.thumb could support 3 images and rotate between them?

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


[Image: badge.gif]
find quote
Bstrdsmkr Offline
Posting Freak
Posts: 803
Joined: Oct 2010
Reputation: 17
Post: #10
Can't help but think Cragz is working on porn =P

@jmarshall what about .gifs?
find quote
Martijn Offline
Team Kodi
Posts: 11,891
Joined: Jul 2011
Reputation: 170
Location: Dawn of time
Post: #11
(2012-07-27 03:55)jmarshall Wrote:  I wonder what would happen if listitem.thumb could support 3 images and rotate between them?


Could also use such a thing for extrafanart Wink

Always read the XBMC online-manual, FAQ and search the forums before posting.
Do NOT e-mail Team-XBMC members asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting, make sure you read this first

For your mediacenter artwork go to
[Image: fanarttv.png]
find quote
Cragz Offline
Junior Member
Posts: 10
Joined: Jun 2009
Reputation: 0
Post: #12
(2012-07-27 03:55)jmarshall Wrote:  I wonder what would happen if listitem.thumb could support 3 images and rotate between them?

I like it!

(2012-07-27 22:04)Bstrdsmkr Wrote:  Can't help but think Cragz is working on porn =P

Haha, nothing quite as exotic (although maybe the thread rating would get better Wink). I'll pull together some screenshots of the current proof of concept over the weekend to see if that helps explain it better.
find quote