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.
Page Index Toggle Pages: 1
multiple cams with same name (Read 1402 times)
multiple cams with same name
Aug 13th, 2005, 6:25pm
 
now i'm working on project where have 8 Logitech Quickcams connected to my PC. how i can select any webcam from my webcamlist? they all have the same name!!! Smiley can i use any kind of index or what? for example if i need show only webcams 1,3 and 5 and after user click button show 2,4 and 8?

TIA
Re: multiple cams with same name
Reply #1 - Aug 14th, 2005, 9:24pm
 
hm, i documented this somewhere but i can't remember where it is. this is a flaw in apple's quicktime api.

but have you actually tried it yet or are you just assuming it's broken? if you ask for a camera of the same name in sequence, you might see if it just does the right thing and grabs different cameras.

if that doesn't work, you might try calling capture.settings() which will bring up the prompt and select the camera:
http://processing.org/reference/libraries/video/Capture_settings_.html
Re: multiple cams with same name
Reply #2 - Sep 26th, 2005, 12:32pm
 
Hi!

I´m interested on this subject.
I manage to open 2 web cams and display them, simply by using null at the capture definition.
With three cameras i can only get two of them onscreen....

Any ideas, or do i need to be mores specific?

Thank you.
Re: multiple cams with same name
Reply #3 - Sep 26th, 2005, 2:12pm
 
With this it is working:

void draw() {
 background (102);
 youCapture.read();
 image(youCapture, 308, 140);
 myCapture.read();
 image(myCapture, 28, 252);
 tresCapture.read();
 image(tresCapture, 168, 252);
 }

And Open GL is working fine also.

Re: multiple cams with same name
Reply #4 - Nov 7th, 2005, 4:04am
 
well, I am also working on similar project. I have actually found a sample code about operating two webcams in the reference/ library. It is like this:


import processing.video.*;
Capture myCapture;
String[] caps;

void setup()
{
 size(200, 200);
 caps = Capture.list()
 myCapture = new Capture(this, caps[0], width, height, 30);
 myCapture = new Capture(this, caps[1], width, height, 30);
}

void cameraEvent(Capture c) {
 if(c == caps[0]) {
   myCapture.read();
 } else if (c == caps[1]) {
   myCapture.read();
 }
}

void draw() {
 image(myCapture, 0, 0);
}


I have run it but it doesn't work. In the cameraEvent(), the cap[0] and c are not allowed to do comparison. Moreover, I wonder if it is ok to initialize myCapture twice. Should we initialize two different myCapture instead of one?

Is there anyone who have sample code about operating two webcams? I just don't know how to move forward.
Re: multiple cams with same name
Reply #5 - Jan 20th, 2006, 11:47pm
 
despite wong_chung's code errors, this method also doesn't work.

trying to load 2 webcams with the same name causes each cam to flicker on and off for ~15 seconds then returns this:

quicktime.std.StdQTException[QTJava:6.1.0g1],-50=paramErr,QT.vers:6528000
at quicktime.std.StdQTException.checkError(StdQTException.java:38)
Re: multiple cams with same name
Reply #6 - Jan 23rd, 2006, 3:46pm
 
don't specify a name, and use capture.settings() as i said above, does that not work?
Page Index Toggle Pages: 1