Hi,
Just starting a project that requires two webcams, using a Macbook Pro with OS X 10.4.8. One camera is the built-in iSight and the other is a cheap USB camera using macam drivers. Both work independently but not together. I stripped the example so it is very simple and still I can’t see what could be causing the problem. Perhaps I am going about this wrong?
Code:
void testApp::setup(){
camWidth = 320; // try to grab at this size.
camHeight = 240;
vidGrabber.setVerbose(true);
vidGrabber2.setVerbose(true);
vidGrabber.listDevices();
// device ID 2: USB camera
// device ID 3: built-in I-sight
vidGrabber.setDeviceID(3);
vidGrabber2.setDeviceID(2);
vidGrabber.initGrabber(camWidth,camHeight);
vidGrabber2.initGrabber(camWidth,camHeight);
}
//--------------------------------------------------------------
void testApp::update(){
vidGrabber.grabFrame();
vidGrabber2.grabFrame();
}
//--------------------------------------------------------------
void testApp::draw(){
ofSetColor(0xffffff);
vidGrabber.draw(20,20);
vidGrabber2.draw(20,20+camHeight);
}
Here is the console output:
[Session started at 2010-02-05 13:55:07 -0800.]
-------------------------------------
(unavailable) device[0] DV Video
(unavailable) device[1] IIDC FireWire Video
device[2] Intel Create and Share CS330 (SPCA501) - macam #0: Intel Create and Share CS330 (SPCA501)
device[3] USB Video Class Video - Built-in iSight
-------------------------------------
OF_WARNING: No camera settings to load
OF_ERROR: error: can't get default sequence grabber component
OF_ERROR: error: unable to initialize the seq grabber
When the program is running, the first stream displays video and the second is just a white box. The same is true if I switch the order of the cameras.
While the application is running, if I open a different application (e.g. the macam utility) I can still get the stream from the second webcam. So it seems the hardware is capable of capturing both streams.
Any ideas? Thanks