A fast picture viewer for the Pi and XBMC?


8 posts
by louisb » Sat Jul 14, 2012 7:45 am
Does anyone know if there is a fast picture viewer for the Pi that can be hooked up to XBMC? Trying to view my photo collection using XBMC is excruciating slow, but I know that the Pi GPU can render pictures really well as I have seen the Pi sample programs that can do this.

What we really need is a version of omxplayer but for photos. Does anybody know if there is a suitable Pi optimised program that can do this already? And how would one connect it up to XBMC? If there is not one already then maybe we should consider writing a program ourselves to improve the XBMC picture viewer experience. Does anybody know if anyone is doing some work on this? What is the best way to get started?

Thanks

Louis
Posts: 47
Joined: Wed Mar 07, 2012 7:08 am
by cfavi » Sun Aug 05, 2012 9:07 pm
Hi Louis,

I've been working a couple of days trying to figure out how to use the OpenMAX api for accelerated image decoding. I was able to get the image_decode component working by mimicking what was done in /opt/vc/src/hello_pi/hello_video. Here is the code:

https://github.com/cfavi/hello_viewer

The current code has several limitations:
1. I only tried JPEG
2. I wasn't able to display images larger than x1080. I'm under the impression that the decoder is working fine but the video_render component is not downsizing the images.

Best
Claudio
Posts: 2
Joined: Tue Jul 31, 2012 7:29 pm
Location: Switzerland
by dom » Mon Aug 06, 2012 9:14 am
cfavi wrote:1. I only tried JPEG
2. I wasn't able to display images larger than x1080. I'm under the impression that the decoder is working fine but the video_render component is not downsizing the images.

There is an image_resize component. XBMC uses it after the jpeg decode component, so you may get hints from the xbmc code.
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 4070
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge
by MattOwnby » Thu Aug 16, 2012 7:26 pm
Hi Claudio,

Your work here looks like it will be very helpful for me. I have a few questions:

- D you have any idea what modifications would need to be done to your code to make it decode a JPEG to a buffer instead of render to video (which is apparently what it is doing, I have not been able to try it out on my pi yet because I do not have a power cable).

- Is there documentation anywhere for how to use the ilclient API or did you just have to guess?

cfavi wrote:Hi Louis,

I've been working a couple of days trying to figure out how to use the OpenMAX api for accelerated image decoding. I was able to get the image_decode component working by mimicking what was done in /opt/vc/src/hello_pi/hello_video. Here is the code:

https://github.com/cfavi/hello_viewer

The current code has several limitations:
1. I only tried JPEG
2. I wasn't able to display images larger than x1080. I'm under the impression that the decoder is working fine but the video_render component is not downsizing the images.

Best
Claudio
Posts: 52
Joined: Thu Aug 16, 2012 7:22 pm
by cfavi » Fri Aug 17, 2012 6:56 am
@dom
thank you the work in xbmc is very useful.

@MattOwnby
For me it has been mostly guess work by looking that the /opt/vc/src/hello_pi/hello_video/ example and the OpenMAX IL spec at http://www.khronos.org/openmax/.

You can read the output of a compenent by using FillThisBuffer().

Check out xbmc image handling in
https://github.com/xbmc/xbmc-rbp/blob/m ... XImage.cpp

I guess that like me you're looking for an accelerated image decode. The only API I found for this is the OpenMAX... unless someone knows an alternative.
Posts: 2
Joined: Tue Jul 31, 2012 7:29 pm
Location: Switzerland
by dom » Fri Aug 17, 2012 8:44 am
One thing to be aware of is that progressive jpegs are not supported by the hardware.
You'll have to fall back to a slower software decoder like (on arm) for those.
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 4070
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge
by MattOwnby » Thu Aug 23, 2012 9:37 pm
Thanks to your help in this thread, I've successfully written a program to decode JPEG to a buffer. I'm very excited. I posted my finished product here:

http://www.raspberrypi.org/phpBB3/viewtopic.php?f=33&t=15463

I hope this can help someone. The XBMC source code along with the hello_viewer.c, ilclient.c, and OpenMAX official spec helped greatly.
Posts: 52
Joined: Thu Aug 16, 2012 7:22 pm
by apoth » Mon Jul 01, 2013 9:34 pm
In case it helps anyone else out, I've got much better photo viewing performance out of my Pi with XBMC by increasing the size of the swap file.

Code: Select all
$ sudo echo "CONF_SWAPSIZE=1024" > /etc/dphys-swapfile
$ sudo service dphys-swapfile stop
$ sudo service dphys-swapfile start

It doesn't seem to actually use the swap space either from a cursory view of free -m, so I'm not sure what gives, but I don't care really! It's gone from unusable to lightning fast.
Posts: 12
Joined: Mon Jul 30, 2012 12:37 pm