Switch to Usb camera rather than default camera

6 views
Skip to first unread message

Benson Tan

unread,
Dec 14, 2009, 8:23:49 PM12/14/09
to FLARToolKit userz
Hi,

Here is another question, Currently, my flarmanager runs at my laptop
camera. However, I would like it to run on my usb camera. Is there a
way to do that?

Thanks
Benson

craig

unread,
Dec 14, 2009, 8:45:57 PM12/14/09
to FLARToolKit userz
You could just Ctrl+Click on the swf when it's playing in your browser
and swap it in your Flash settings...

Or the proper way of doing it would be along the lines of getting the
mac camera:

private function setupCamera():void
{
vid = new Video(640, 480);
var camIndex:int = 0;
for (var i : int = 0 ; i < Camera.names.length ; i++ ) {
if (Camera.names[ i ] == "USB Video Class Video" ) {
camIndex = i;
break;
}
}
cam = Camera.getCamera(String(camIndex));
cam.setMode(320, 240, 30);
vid.attachCamera(cam);
addChild(vid);

eric socolofsky

unread,
Dec 14, 2009, 9:29:46 PM12/14/09
to flartool...@googlegroups.com
you can manually specify a camera index:

FLARCameraSource(FLARManager.flarSource).cameraIndex = 1;

(replace 1 with whatever index your USB cam is. probably easiest to just use trial and error, or you can look at Camera.names.)

-e

Shachar Oz

unread,
Dec 15, 2009, 12:51:22 AM12/15/09
to FLARToolKit userz
there is another way, although somewhat more of a bypass really...

open DeviceManager and disable all other cameras.
Reply all
Reply to author
Forward
0 new messages