MySQL library, store images locally?
#1
I've been searching but only find dead ends, things that don't apply, or things that I just don't understand!

I'm running Kodi 17 on Raspberry Pi devices (OpenELEC). My content is on a NAS that I built using Nas4Free. I'm using a MySQL database on an old Mac Mini so all Kodi devices have the same library.

A power outage corrupted the SD card on the Pi on the living room TV so I had to rebuild that. At the same time, I set up a new Pi for my son's room. I'm having a problem getting all the thumbnails and fanarts to show on both of these devices.

Looking through the MySQL library, I noticed that the majority of the image paths are web addresses, not locally stored images. I have satellite internet and every byte of bandwidth is precious. So I want to make sure that all thumbnails, posters, fanart, etc. is stored locally on the NAS and the database points to that location. When I add a new entry to my library, I want it to download those images one time, store them locally, and then all future references are to those local images.

How can I do that? How can I force all the images that are referenced out on the internet to be downloaded locally, then change the path in the database to the local image rather than the internet image?
Reply
#2
Use a media manager, download your artwork to media folders. There are a few options - Media Companion, Ember, Tiny etc. Look in the Supplementary Tools subforum.
Reply
#3
(2017-06-05, 19:13)trogggy Wrote: Use a media manager, download your artwork to media folders. There are a few options - Media Companion, Ember, Tiny etc. Look in the Supplementary Tools subforum.

Thanks for the pointer! I'm still looking through there, but not finding anything I'm happy with yet.
Reply
#4
The solutions I find there are to use a 3rd party program to download all the scraped info, store that locally as individual files with the media, then I can import that into XBMC. That's not really a workflow I'm interested in. I don't mind going through it once for my existing media, but for future additions I don't want to have to use a 3rd party program. I want to add the new movie or TV show to XBMC as usual, have it add the scraped information to the MySQL database as usual, except change the behavior of image paths from being a web address to a local file path.
Reply
#5
Or you could just use the Export Library function of Kodi
My Signature
Links to : Forum rules (wiki) | Banned_Add-ons (wiki) | Debug Log (wiki)  
Links to : HOW-TO:Create_Music_Library (wiki) | HOW-TO:Create_Video_Library (wiki)  ||  Artwork (wiki) | Basic controls (wiki) | Import-export library (wiki) | Movie sets (wiki) | Movie universe (wiki) | NFO files (wiki) | Quick start guide (wiki)
Reply
#6
(2017-06-05, 21:14)Heathicus Wrote: The solutions I find there are to use a 3rd party program to download all the scraped info, store that locally as individual files with the media, then I can import that into XBMC. That's not really a workflow I'm interested in. I don't mind going through it once for my existing media, but for future additions I don't want to have to use a 3rd party program. I want to add the new movie or TV show to XBMC as usual, have it add the scraped information to the MySQL database as usual, except change the behavior of image paths from being a web address to a local file path.
Good luck with that.
Reply
#7
(2017-06-05, 21:14)Heathicus Wrote: The solutions I find there are to use a 3rd party program to download all the scraped info, store that locally as individual files with the media, then I can import that into XBMC. That's not really a workflow I'm interested in. I don't mind going through it once for my existing media, but for future additions I don't want to have to use a 3rd party program. I want to add the new movie or TV show to XBMC as usual, have it add the scraped information to the MySQL database as usual, except change the behavior of image paths from being a web address to a local file path.

If you're comfortable with the command line, maybe this? If not, ignore this post.

You can basically script your entire media scraping workflow so that you don't need to do anything yourself within Kodi - how you acquire your new media is up to you, but once it appears on your network it can then be scraped automatically, and finally any remote artwork converted to local.
Texture Cache Maintenance Utility: Preload your texture cache for optimal UI performance. Remotely manage media libraries. Purge unused artwork to free up space. Find missing media. Configurable QA check to highlight metadata issues. Aid in diagnosis of library and cache related problems.
Reply
#8
(2017-06-05, 19:00)Heathicus Wrote: How can I force all the images that are referenced out on the internet to be downloaded locally, then change the path in the database to the local image rather than the internet image?
Where your media files are, there will be banner.jpg, fanart.jpg, poster.jpg and then the season posters (for tv shows, for a movie, it'll just be the fanart and poster). Once you've scraped and exported, that's where kodi reads them from. Only if you go "refresh" will it ask you whether you want to ignore the local files and refresh from the internet. Even though the nfo files have a web address in there, Kodi is only looking locally after you've scraped in the pictures and exported to separate files.
Reply
#9
@bilgepump Just to say that exporting artwork will create local files from the texture cache that will be of lower quality than the original remote artwork. The actual quality of the cached images (and thus the quality of any exported local artwork) will vary from client to client depending on the default fanartres/imageres settings. Caching then exporting will lead to generational losses when the reduced quality exported local artwork is cached by a second client where it may be rescaled/resized/reformatted yet again (possibly using different settings to the first client).
Texture Cache Maintenance Utility: Preload your texture cache for optimal UI performance. Remotely manage media libraries. Purge unused artwork to free up space. Find missing media. Configurable QA check to highlight metadata issues. Aid in diagnosis of library and cache related problems.
Reply
#10
Thanks Milhouse, I don't really understand what you are saying, all I know is that I have the pictures on my computers and none is connected to the internet, only to the server. There doesn't seem anything wrong with their quality to my eyes, but perhaps my clients are "much of a muchness"?.
Reply
#11
@bilgepump let's say you have remote (original) artwork with the following increasingly common high-quality dimensions/resolutions:
Code:
poster: 2000x3000 (width * height)
fanart: 3840x2160 (width * height)


You scrape this remote artwork into your cache - let's assume you're using an x86 system with the following default settings:
Code:
imageres: 720
fanartres: 1080

When cached, your posters will be resized to a maximum of 480x720 and your fanart to a maximum of 1920x1080. That's a significant reduction on the original artwork sizes, but probably not noticeable on a 1080p display.

If the system used for scraping uses lower settings than the default, then you'll see even greater reductions in artwork resolution - the following are the default LibreELEC/RPi settings (optimised for performance/storage):
Code:
imageres: 540
fanartres: 720

and now your high quality artwork will be resized to a maximum of 360x540 (posters) and 480x720 (fanart).

Why does this matter?

Well let's say you export the artwork from your x86 cache, and then cache the now local artwork on an RPi client. You're now converting your posters from 2000x3000 (original, remote) to 480x720 (x86, local) and then again to 360x540 (RPi). That's two generations of resizing/resampling.

And worse, if you scrape into an RPi (with imageres=540) then export your cache, and then cache the now local RPi artwork on x86 with imageres=720, your poster will be resized from 2000x3000 (original, remote) to 360x540 (RPi, local) which is then "upsized" from 360x540 to 480x720 on x86. Eugh!

Also, should you in future get a 4K TV where you might start to see these reductions in quality, and you'd rather now see the full 3840x2160 original artwork and not the lower quality version available locally - you can't, because you're now limited by the quality of the artwork originally exported from your cache.

So my point is, if you can avoid exporting your cache in order to create local artwork, you really should.
Texture Cache Maintenance Utility: Preload your texture cache for optimal UI performance. Remotely manage media libraries. Purge unused artwork to free up space. Find missing media. Configurable QA check to highlight metadata issues. Aid in diagnosis of library and cache related problems.
Reply
#12
@millhouse,

Thanks for the explanation. I was not aware of this.
My Signature
Links to : Forum rules (wiki) | Banned_Add-ons (wiki) | Debug Log (wiki)  
Links to : HOW-TO:Create_Music_Library (wiki) | HOW-TO:Create_Video_Library (wiki)  ||  Artwork (wiki) | Basic controls (wiki) | Import-export library (wiki) | Movie sets (wiki) | Movie universe (wiki) | NFO files (wiki) | Quick start guide (wiki)
Reply
#13
(2017-06-07, 16:41)Milhouse Wrote: So my point is, if you can avoid exporting your cache in order to create local artwork, you really should.
Are you saying that Kodi caches images at a higher quality than that displayed by a system and when you export your library you get something less than the cached version? Wouldn't that only matter if you have a better system than your saved images? If the system you saved the cache on, and your other systems are all the same, there's not going to be any rejigging is there?
Reply
#14
The sizes of the artwork that Kodi caches and Kodi displays are not generally related as the displayed image may be scaled up or down according to how the image is used by the skin. If you have a 720p display then Kodi may be caching artwork at a higher 1080 quality than you can ever display. What is cached depends on the imageres/fanartres settings and it's entirely possible for Kodi to cache artwork at a lower resolution than the maximum full screen resolution of the display - the default settings on most systems are suitable for 1080p displays, but users with 4K displays are almost certainly caching artwork at much lower resolutions than their systems are able to display.

What Kodi exports is exactly the same as what is in the cache of the client being exported from - the problem is that what is being exported has already been decimated in terms of image quality compared with the original artwork. And when another Kodi client with different settings caches the exported local artwork it only reduces the quality of the cached images further (if the settings are the same as on the export system there shouldn't be very much further loss in quality but I'd hesitate to say that the cached images would be exactly the same as the local files - there may still be some changes).

And in future if you cache this exported local content on a system with 4K display (assuming 4K appropriate imageres/fanartres settings) you'll just be blowing up these much lower resolution images introducing artefacts etc. rather than caching the full resolution high quality originals.
Texture Cache Maintenance Utility: Preload your texture cache for optimal UI performance. Remotely manage media libraries. Purge unused artwork to free up space. Find missing media. Configurable QA check to highlight metadata issues. Aid in diagnosis of library and cache related problems.
Reply
#15
(2017-06-08, 13:28)Milhouse Wrote: And when another Kodi client with different settings caches the exported local artwork it only reduces the quality of the cached images further (if the settings are the same as on the export system there shouldn't be very much further loss in quality but I'd hesitate to say that the cached images would be exactly the same as the local files - there may still be some changes).
All I can say is that I have my files on a server, with the posters and everything, and they look absolutely fine on any of the computers that I use. I can't say what would happen with a raspberry pi, but on my computers, there's no obvious (to me) degradation in the quality of the pictures.
Reply
 
Thread Rating:
  • 0 Vote(s) - 0 Average



Logout Mark Read Team Forum Stats Members Help
MySQL library, store images locally?00