Is it possible to use 3 webcams at once using Flash AS3?

Asked

Viewed 106 times

3

I am using the code below to display 3 webcams at once. But it only works with 2.

getCamera("0") and getCamera("1") = okay
getCamera("1") and getCamera("2") = okay
getCamera("0") and getCamera("2") = okay
getCamera("0") and getCamera("1") and getCamera("2") = nay

No mistake appears, just doesn’t appear on stage.

var cameras = Camera.names;
trace('Cameras: '+cameras);

// Cameras: Microsoft® LifeCam HD-3000,Integrated Webcam,USB2.0 Camera,IP Camera [JPEG/MJPEG]
// Camera.getCamera("0") = Microsoft® LifeCam HD-3000
// Camera.getCamera("1") = Integrated Webcam
// Camera.getCamera("2") = USB2.0 Camera

var camera0:Camera = Camera.getCamera("0");
camera0.setMode(400, 300, 100); 
camera0.setQuality(0,100);
var video0:Video = new Video(); 
video0.smoothing = true;
video0.width = 400;
video0.height = 300;
video0.x=0;
video0.y=0;
video0.attachCamera(camera0);
addChild(video0);

var camera1:Camera = Camera.getCamera("1");
camera1.setMode(400, 300, 100); 
camera1.setQuality(0,100);
var video1:Video = new Video(); 
video1.smoothing = true;
video1.width = 400;
video1.height = 300;
video1.x=400;
video1.y=0;
video1.attachCamera(camera1);
addChild(video1);

var camera2:Camera = Camera.getCamera("2");
camera2.setMode(400, 300, 100); 
camera2.setQuality(0,100);
var video2:Video = new Video(); 
video2.smoothing = true;
video2.width = 400;
video2.height = 300;
video2.x=800;
video2.y=0;
video2.attachCamera(camera2);
addChild(video2);

1 answer

3

This can be a bandwidth consumption of your computer’s USB ports, according this answer soen.

According to the translation of the OP’s own answer, when performing a test by connecting the third webcam to a USB port from another computer, it worked correctly.

Another test he did was to start the camera with a smaller size and quality.

According to this post of a forum, the three webcams worked by starting with the standard format, without any change in quality and size with the code below:

var cam:Camera = Camera.getCamera("0"); 
var vid:Video = new Video(); 
vid.attachCamera(cam); 
v1.addChild(vid);

var cam1:Camera = Camera.getCamera("1"); 
var vid1:Video = new Video(); 
vid1.attachCamera(cam1); 
v2.addChild(vid1);

var cam2:Camera = Camera.getCamera("2"); 
var vid2:Video = new Video(); 
vid2.attachCamera(cam2); 
v3.addChild(vid2); 

Could be some hardware feature missing.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.