Multiple Webcams in Flash with Actionscript 3

blog.180

It’s true! You can have multiple webcam feeds in your swf/as3 application. Here’s how:

  1. Plug in your webcams.
  2. Look in your Flash Player’s Camera Settings Panel. You might have to open an existing swf to get here. You should see a dropdown list of all the cameras available to you. The first camera on the list is camera 0, the second is camera 1, and so on. Remember the numbers of the cameras you want to work with (In my case, I want #7 and #8).
blog.181
  1. Call your cameras with Actionscript 3. Here’s the AS3 code, and here’s a FLEX project.
blog.182
  1. A few pointers: be careful about plugging/unplugging the cameras. Flash Player seems not to like this, you may have to quit and restart to refresh the list. You can adjust how and where both video feeds are placed in the scene. In this example they’re layered on top of each other with the blend mode set to OVERLAY, which [sort of] averages the two feeds together.
  2. Only see one camera? Depending on your camera & drivers, your computer may not recognize two identical cameras at the same time. Cameras with different hardware should be recognized, though.

Also, I am using Playstation 3 Eye cameras, because they are great in low light and have high frame rates, and are pretty cheap. You can get drivers for Windows and Mac since they are not recognized automatically. Have fun!

by 8 years ago

RESPOND

Your email address will not be published. Required fields are marked *