First of all I want to say that I've been reading a lot about this and I've learnt many ways to do it, but I haven't been able to do it in linux.
My project is an ambilight with arduino, so I need to take a screenshot of the desktop and analyze its colour.
At the beginning I used Processing 2.0 with the class 'Robot' from 'java.awt'. Initially I could take 5 frames per second and then I got 13fps. This works but I want more perfomance, so I start reading.
In Windows or Mac you have libraries that let you access directly to the 'frameBuffer', so you can take screenshot really 'easy' and really fast.
In Ubuntu I have tried python with Gtk, PIL, Qt... and the fastest way is GTK but I can only have about 15fps too.
My problem is: I want to do it cross platform but I prefer that my program work in Linux at the beginning and then in Windows (I don't like it too much :P).
So, the first question: is python able to offer that perfomance? Because I think that C++ can be a better option.
And the second question: what do I need to do it? I've read about Xlib (X11) but I can't find documentation that let me take a screenshot. Also I know, for example, FFmpeg which is a powerful tool but I don't know how to implement it.
I hope that you could help me (and excuse me if I've made any mistakes).