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

3

I'm using the code below to view 3 webcams at once. But it only works with 2.

   getCamera("0") and getCamera("1") = ok% getCamera("1") and getCamera("2") = ok% getCamera("0") and getCamera("2") = no

No error appears, it just does not appear on the 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);
    
asked by anonymous 20.11.2014 / 02:38

1 answer

3

This may be a bandwidth consumption of your computer's USB ports, according to this answer of SOen.

According to the translation of the OP's own response, when performing a test connecting the third webcam to a USB port on 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, all three webcams worked when starting with the standard format, without any change of 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); 

It may be some missing hardware feature.

    
21.11.2014 / 12:53