I currently have two identical webcams which will each be used for simultaneous blob tracking. I'm using the macam component to allow processing to access the cameras, but because both cameras have the same name it only seems to be able to access one camera at a time.
When I use the webcam with my dv camcorder or built in eyesight it works fine, however I can't seem to get it to work with both at once. Any idea what I can do?
Here's the code I'm using, right now it displays two cameras side by side when the cameras' names are defined differently.
Code:
import processing.video.*;
Capture camera;
Capture camera2;
void setup()
{
size(640, 240);
// List all available capture devices to the console
// Use the information printed to the text area to
// correctly set the variable "s" below
println(Capture.list());
// Specify your own device by the name of the capture
// device returned from the Capture.list() function
String s = "Generic SPCA561A Webcam";
camera = new Capture(this, s, width/2, height, 30);
String t = "Generic SPCA561A Webcam";
camera2 = new Capture(this, t, width/2, height, 30);
// If no device is specified, will just use the default
//camera = new Capture(this, 320, 240, 12);
// Opens the settings page for this capture device
//camera.settings();
}
void captureEvent(Capture camera)
{
camera.read();
}
void draw()
{
image(camera, 0, 0);
image(camera2, 320, 0);
}