Hi there,
I've been trying for a while to get my PSEye working with processing. I managed to get it working using
macam, an OSX driver for hundreds of cameras. I dont know if this is the best solution but it might be cool since you will have support for many other cameras. I post it here in case it is useful for anyone.
I used this code to see if the cam was available:
- import processing.video.*;
import hypermedia.video.*;
//Capture myVideo;
void setup() {
String [] devices = Capture.list();
println(devices);
}
and I get this output:
- [0] "Google Camera Adapter 0"
[1] "Google Camera Adapter 1"
[2] "IIDC FireWire Video"
[3] "USB Video Class Video"
[4] "Vídeo DV"
I have no idea of what the two first devices are, any clue? Actually, I ignore what the [2] device is. I tried all the devices using this code:
- import processing.video.*;
import hypermedia.video.*;
Capture myVideo;
void setup() {
size(320,240);
String [] devices = Capture.list();
println(devices);
myVideo = new Capture(this, 320 , 240 , devices[3], 20);
//myVideo = new Capture(this, 320, 240, "USB Video Class Video", 20);
}
void draw() {
if(myVideo.available())
myVideo.read();
image(myVideo,0,0);
}
and got errors in all but devices [2] and [3] ([3] is the built-in iSight). I suspect that if [2] is not available, then processing tries [3], but i'm not sure about that.
As the PSEye did not appear, I dowloaded macam. When extracted, you get the application, the source and a component. To get the stuff working, I copied the macam.component file into /Library/Quicktime/ and restarted processing.
Then, when I run the first code above, I got this output:
- [0] "Google Camera Adapter 0"
[1] "Google Camera Adapter 1"
[2] "IIDC FireWire Video"
[3] "Sony HD Eye for PS3 (SLEH 00201) #459"
[4] "USB Video Class Video"
[5] "Vídeo DV"
which means the PSEye is now recognized! To make it work, I just replaced the name of the PSEye in the constructor:
- myVideo = new Capture(this, 320, 240, "Sony HD Eye for PS3 (SLEH 00201) #459", 20);
or this, if its the third device:
- myVideo = new Capture(this, 320 , 240 , devices[3], 20);
I suspect that since I installed macam, I get this warning when using Capture Objects:
- 2011-10-30 23:19:14.333 java[2537:11803] *** __NSAutoreleaseNoPool(): Object 0x111ae70 of class NSCFString autoreleased with no pool in place - just leaking
Any clue about what this can be?