We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpVideo Capture,  Movie Playback,  Vision Libraries › Multiple webcams of the same type, is it possible
Page Index Toggle Pages: 1
Multiple webcams of the same type, is it possible? (Read 1560 times)
Multiple webcams of the same type, is it possible?
May 1st, 2007, 4:38am
 
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);
}
Re: Multiple webcams of the same type, is it possi
Reply #1 - May 1st, 2007, 4:42am
 
I just found something that might fix this using camera.settings() but it seems finicky. Any better way?

The info is here:
http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Video;action=display;num=1159140387

<edit>
The camera settings thing doesn't seem to be working. I made  .mov files in quartz composer that are able to see each camera independently, but when I try to import them as a standard quicktime movie I get the error "Invalid memory access of location 0000000a eip=9173a6b3".

Any other possible workarounds I'm missing?

Re: Multiple webcams of the same type, is it possi
Reply #2 - Sep 5th, 2007, 4:41pm
 
the settings() method is the only way. more here:
http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Video;action=display;num=1188770395;start=5#5

an error message reading "Invalid memory access of location" is quicktime crashing. it may be caused by something that processing is doing, but it's equally likely just to be a quicktime bug or messed up codec.
Page Index Toggle Pages: 1