Kodi Community Forum
Compressed textures for FanArt - testing here with XBMC 2009-10-05 (r23431) or newer - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: General Support (https://forum.kodi.tv/forumdisplay.php?fid=111)
+---- Forum: OS independent / Other (https://forum.kodi.tv/forumdisplay.php?fid=228)
+---- Thread: Compressed textures for FanArt - testing here with XBMC 2009-10-05 (r23431) or newer (/showthread.php?tid=59115)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26


- furii - 2010-02-08

bleze Wrote:The speed increase is amazing on my ASRock ION 330! Quality looks fine to me, but hard to tell with skin overlapping ect. I can't wait till this is standard. Will give the GUI such a boost especially when posters are supported also (perhaps skin gfx also?)
Thumbs up! Please make support for reading fanart.dss from movie folder (basically copy file to cache I guess?)

totally agree. i haven't noticed any quality loss in my fanart and the speed increase is definitely worth the slightly higher disk space used. i'd love to see this for posters as well.


- bomana - 2010-02-08

So I actually pushed my script live on my xbmc box this weekend and it seems a regexp didn't work quite as expected for some strange reason (only in -md mode). Anyway, now it works on my box. If you use the script and it works for you, no need to grab the latest, if you tried it and it didn't work you can grab an updated one: tbn2dds.

And yeah, this makes an atom 230 perfectly viable to run xbmc on. I was about to test with converting covers as well, but with the views I use it doesn't seem necessary. I may test anyway later.

enjoy


- headcase - 2010-02-08

bomana Wrote:So I actually pushed my script live on my xbmc box this weekend and it seems a regexp didn't work quite as expected for some strange reason (only in -md mode). Anyway, now it works on my box. If you use the script and it works for you, no need to grab the latest, if you tried it and it didn't work you can grab an updated one: tbn2dds.

And yeah, this makes an atom 230 perfectly viable to run xbmc on. I was about to test with converting covers as well, but with the views I use it doesn't seem necessary. I may test anyway later.

enjoy

Will this new version pick up additions to the directory? In testing with the old script, if I changed fanart for something, it picked it up and ran nvcompress on it. But if I added a new movie then it did nothing.

I'm off to check out the inotify tools ... but I'm guessing that it's only looking for changes to existing files and not additions to the directory?


- bomana - 2010-02-08

headcase Wrote:Will this new version pick up additions to the directory? In testing with the old script, if I changed fanart for something, it picked it up and ran nvcompress on it. But if I added a new movie then it did nothing.

I'm off to check out the inotify tools ... but I'm guessing that it's only looking for changes to existing files and not additions to the directory?

I just tested on my xbmc box and it seems to work as expected. I added a movie, a whole new tv show (not just an episode) and I changed a fanart. The issue I had for updating the script was the opposite problem btw, It bugged when a new fanart was downloaded for an existing movie, it all worked in testing as well. Weird.

So grab the new script and try that, let me know if you still have issues.

inotify-tools is just a lib and some utils that lets you use the inotify kernel interface easily. Basically when you use inotify you tell the kernel what file(s) or directories you are interested in and the kernel notifies your program of changes to them relieving you from polling. In this script I use inotify to tell me when a file has been opened O_WRITE, but I told it not to give notification until close() to ensure it doesn't start nvcompress before the file is all in place in the dir. The one issue with that is that nvcompress would be re-run if xbmc ever opens fanart for writing and then just closes the file without changing it. In that case nvcompress would run on the old file and waste a few cpu cycles I guess. I doubt xbmc does that very often if at all however.

enjoy.


- Bongu - 2010-02-10

I'm pretty new at all this but am wondering if this will help the issues I'm seeing.

I'm testing out XBMC on an old 2005 Dell P4 3.0Ghz with 2gb of ram. Both Posters and Fan Art take a long time to load. If I am in the Fan Art view, it will probably take 15-30 seconds for all the thumbnails (posters) to come in. Then if I scroll to a movie it will take 5-10 seconds for the Fan Art to display. All of my media is connected via a USB 2.0 Hard drive.

Would converting the fan art to dds make a difference for this type of older computer? I realize better hardware would make a big difference, but right now I'm testing XBMC before I get something to connect to my TV (perhaps an Acer 3610)

Also, I don't see any Thumbnails folder in the userdata folder. I imagine this is b/c of the external HD, so would I just change the fan art in the folder with the movies (I'm using Video_TS folders/files).

Thank you.


GUILargeTextureManager.cpp Patch - DV3B - 2010-03-19

Before the crash someone had posted a patch for GUILargeTextureManager.cpp to get dds for posters and thumbs. Wondering if anyone still has it, I deleted my copy Sad


- dustbustr - 2010-03-19

Sure.

Code:
--- xbmc/GUILargeTextureManager.cpp~
+++ xbmc/GUILargeTextureManager.cpp
@@ -64,8 +64,10 @@ bool CImageLoader::DoWork()
{
CStdString baseFolder1 = g_settings.GetMusicFanartFolder();
CStdString baseFolder2 = g_settings.GetVideoFanartFolder();
+ CStdString baseFolder3 = g_settings.GetVideoThumbFolder();
if (baseFolder1.Equals(m_path.Left(baseFolder1.GetLength())) ||
- baseFolder2.Equals(m_path.Left(baseFolder2.GetLength())))
+ baseFolder2.Equals(m_path.Left(baseFolder2.GetLength())) ||
+ baseFolder3.Equals(m_path.Left(baseFolder3.GetLength())))
{ // switch to dds
CUtil::ReplaceExtension(m_path, ".dds", loadPath);
}

BTW, I made a quick little modification to nvcompress in nvidia-texture-tools (link) which allows it to read .tbn files directly and determine whether they're JPEG or PNG. Makes converting all those images a little easier, I had quite a few to deal with. Big Grin

Just add these lines to ImageIO.cpp (in nvimage) right before the line that reads "// @@ use image plugins?" (line 98 in the current version):

Code:
#if defined(HAVE_JPEG) && defined(HAVE_PNG)
    if (strCaseCmp(extension, ".tbn") == 0) {
        uint16 tbnheader;

        s << tbnheader; // Read first two bytes of .tbn file
        s.seek(0); // Reset file position

        // Try to guess image type
        if (tbnheader == 0xd8ff) { // File looks like a JPEG
            return loadJPG(s);
        }
        else if (tbnheader == 0x5089) { // File looks like a PNG
            return loadPNG(s);
        }

        return NULL;
    }
#endif

I also wrote a batch file for Windows to automate converting the thumbnails using my modified nvcompress. Just set the correct path to nvcompress.exe and save as makedds.bat in your %AppData%/XBMC/userdata/Thumbnails folder:

Code:
@echo off
for /r %%X in (*.tbn) do if not exist "%%~dpX%%~nX.dds" "C:\Program Files\NVIDIA Corporation\NVIDIA Texture Tools 2\bin\nvcompress.exe" -bc1 "%%X"

When run, it will search inside every subfolder for .tbn files that have no corresponding .dds and run nvconvert on them. I have EventGhost set to execute this whenever a new file is added to my Thumbnails folder, which works ok, but eventually I want to try modding XBMC to execute nvcompress every time it saves a new poster/fanart image.

Hope someone else finds this stuff useful. Using dds for posters/fanart makes a big difference, at least on my system. Everything pops up instantly for me now, even when quickly scrolling through lists.


- DV3B - 2010-03-20

Thanks dustbustr, you're a lifesaver. Smile


- jmarshall - 2010-03-21

Note that as of r28714, XBMC will create .dds versions (indiscriminately) of .tbn files at viewing time if you use the <useddsfanart> advancedsetting.

Note that in some cases the DDS version may not be suitable due to quality being too poor. We need to identify a good benchmark for this so that we can have quality (at the expense of extra load time) where we need it.

If you find images the produce bad looking DDS equivalents, please make a note of them. I'll add some logging to dump out the error, so to work out the error that XBMC sees, just remove the .dds file and have XBMC regenerate it, then look in the log for the dds error.

Cheers,
Jonathan


- Bob___ - 2010-03-21

jmarshall Wrote:Note that as of r28714, XBMC will create .dds versions (indiscriminately) of .tbn files at viewing time if you use the <useddsfanart> advancedsetting.

Hi jmarshall,

can you tell me where i can find the r28714? The latest nightly build i can found was 28699 (at http://sshcs.com/xbmc/). Thanx in advance.


- Elbert - 2010-03-21

Bob___ Wrote:Hi jmarshall,

can you tell me where i can find the r28714? The latest nightly build i can found was 28699 (at http://sshcs.com/xbmc/). Thanx in advance.

Either build it yourself or wait for a few hours until a new build appears on http://sshcs.com/xbmc/

@jmarshall Thanks for this feature. It will hopefully speed up fanart on my atv


- Smenus - 2010-03-21

jmarshall Wrote:Note that as of r28714, XBMC will create .dds versions (indiscriminately) of .tbn files at viewing time if you use the <useddsfanart> advancedsetting.

Just a quick query - you use the word indiscriminately; does this now include thumbnails (covers etc)? And if it does, does it also use the converted covers?


- jmarshall - 2010-03-21

Indiscriminately. As in, it'll be done for ANY .tbn (yes, this includes covers) regardless of whether it'll look nasty or not.

I plan on doing some analysis to see if we can programmatically determine when DXT versions are going to look nasty. I could do with some help here - effectively I need source images which look nasty when DXT compressed using XBMC (or libsquish.)

Cheers,
Jonathan


- .:B:. - 2010-03-22

Sounds great Smile.

I just built 28744 now, gonna activate the DDS setting and report back with any problems.


- moontan77 - 2010-03-22

anyone have a linux script for converting all posters/thumbnails/fanart (.tbn) to .dds? i.e. one that checks all the folders in the Thumbnails folder.

if anyone could modify this script posted earlier in the thread so that it looks in all folders within the Thumbnails folder. It would be appreciated!

#!/bin/sh
cd ~/.xbmc/userdata/Thumbnails/Video/Fanart/ || exit
find . -name '*.tbn' -or -name '*.dds' | cut -c-10 | sort | uniq -u |
while read n; do
mv $n.tbn $n.jpg
nvcompress -bc1 $n.jpg | awk '/taken:/{printf $3}'
mv $n.jpg $n.tbn
echo "s $(ls *.dds | wc -l)/$(ls *.tbn | wc -l)"
done