Speedup the interface for XBMC on Linux/Atom PC's.
#1
Hi,

Firstly, I'd like to say great work on XBMC.

I'm currently running XBMC on a Acer Aspire Revo on Ubuntu, works fantastic. But one thing I found out is that converting Fanart / Thumbs etc to Bitmap really speeds things up on these devices, especially if your using custom backgrounds or the Aeon Stark skin. In fact not converting to Bmps on the Revo just makes the interface feel really sluggish and unworkable.

So I thought I'd have a go at creating some bash scripts to do all of this automatically. eg. Whenever scrapping for Movie Info, XBMC will usually retrieve JPG's etc, so having to say load up Gimp or similar find the tbn's that are Jpegs/Pngs would be a pain each time. So after doing lots of scrapping you could run this 1 script to make sure everything is using Bmps.

My idea is just to have a simple bash script say called XBMCBmpSpeedup.sh, that then goes and checks every tbn file and if there JPG/PNG then converts them to BMP.

So far I've got it to doing single directories, my next step is to make it recursively check all directories.

So my question is, am I re-inventing the wheel here. If not I'll continue developing the script and make it available for everyone.

One note of caution, I'm a bit of a Linux noob, so my Bash script might not be the prettiest/or the most elegant. Smile
Reply
#2
other than it being a rather simple for loop; no reinventing going on Smile
Code:
for i in `find . -name *tbn`; do file $i | grep JPEG && convert $i temp.bmp && mv temp.bmp $i; done

obviously handles recursive fine, just keep those nasty spaces in filenames away (not a problem in the thumbcache dir)
Reply
#3
Hi, spiff.

Nice script, but I believe I do see some small problems. I might be a linux newbie, but not a programmer one. Smile

Your using GREP to look for the letters JPEG inside the files, and Jpeg headers have either 'JFIF' or 'Exif', apart from that it might be possible for a BMP/PNG to have these in them too, so would wrongly identify them as being Jpegs. I soppose if it does make a false positive it's not really bad as it would just end up converting from Bmp to Bmp again, but of course would keep on doing this every time the script was run.

Also wouldn't using GREP be slow, as most images have there Tags at the start, having to scan a whole file would seem wasteful.

My idea is that it also converts PNG's, as they are slow on the Atom PC's too.

But thanks for your bit of code, it certainly gives me some ideas.

Regards

Keith..
Reply
#4
no i'm not using grep on the images, that would be silly. i'm using grep on the output from file. just try it,
'file some.jpg'. same program easily identifies png as well. in fact pretty much any standardized filetype there is
Reply
#5
Hi Spiff,

Oh, right. sorry for that.

How neat is that script Smile,

Thanks again,. Looks like I was going to re-invent the wheel after all. Smile
And looks like I've got a lot to learn in linux.
Reply
#6
A bit of searching, I believe for it to do Png as well I could do ->

for i in `find . -name *tbn`; do file $i | fgrep -e JPEG -e PNG && convert $i temp.bmp && mv temp.bmp $i; done
Reply
#7
yup
Reply
#8
Did anyone look into optimizing jpegs instead,
bmp's might be easier to decode, but you would need to load much larger files from disk/network.

Looking around I think Intels' optimizations for Atom and multithreading (not for the Asus Revo though) could be helpful here.

Using Intel IPP libraries for optimized JPEG decoding

Compiling with the intel c compiler (With atom-specific switches)

I haven't got XBMC to show proper coverart yet, just had my HTPC a few days now...

... browsing the aeonproject.com I found this quote about downloaded backdrops:
"If you want them to cycle smoothly in Aeon and XBMC, however, it's vital they're converted from JPG to an uncompressed BMP format once downloaded."
So this is likely not an issue going away with a 10-15% optimization since Aeon isn't normally developed on atom pc's.
Reply

Logout Mark Read Team Forum Stats Members Help
Speedup the interface for XBMC on Linux/Atom PC's.0