Multiple Webcams in Flash with Actionscript 3
It’s true! You can have multiple webcam feeds in your swf/as3 application. Here’s how:
- Plug in your webcams.
- 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).
- Call your cameras with Actionscript 3. Here’s the AS3 code, and here’s a FLEX project.
- 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.
- 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!
Warning: sizeof(): Parameter must be an array or an object that implements Countable in /homepages/37/d93876897/htdocs/chris-reilly_dotorg_WP-2013/wordpress/wp-content/themes/chris-custom/content-blog.php on line 56