Search  
Search Options

WEBCAM BASICS

There are lots of wonderful things you can do with a webcam, for instance check out Glen Murphy’s Robot Mirror video …or Charles Forman’s gesture controlled animation in “Snow is Fun”.

That is some pretty advanced image processing, but before you can even do something as simple as using Flash’s built-in motion detection functions to trigger actions when something moves in front of the camera you have to learn how to make Flash talk to the webcam and start pulling a video stream from it, and how to differentiate between a USB webcam and any other video capture devices than are detected on the system.

This file demonstrates how to:

  • get the names of all video devices installed on the system.
  • automatically initialize a USB Video Class webcam in preference to a TV Tuner or other device.
  • set up a menu of all available devices for the user manually to select from.
  • set your camera to deliver video at various resolutions.

The user interface is a right-click menu on the video window so you also learn:

  • how to modify Flash’s default main context menu, including:
  • remove some of the default menu options.
  • add new single items to the context menu (the available video stream resolutions)
  • dynamically create a list of available devices (adding to the menu as they are detected)

All the “help” is contained in detailed comments in the compact code ( Check the 1kb file size :) )

This file is written in Actionscript2 on CS3 and published as a Flash 8 fla.

I have an Actionscript 3 class version ready with all the functioality except the contex menu, which I will finish and make available for free to any buyers of this file who want it.

I will support all the advertised functionality, and for any buyers interested I will provide code samples and limited support towards the next step: basic motion-triggered actions, which I will announce here as I develop it.

Posted 2 months ago

Hmm, why is the preview and click through not showing up?

Posted 2 months ago

Whoops: I didn’t have my webcam plugged in :)

Actually the preview I uploaded was a static image (screen shot from my webcam) with a clickthrough to full browser webcam view. It looks like teh den has put my full-screen file in the preview window. In this mode you don’t really get to see the higher resolutions (trying to get it fixed)

Posted 2 months ago

it does support laptop webcams? :(

Posted 2 months ago

ahh ok it supports laptop webcam…right click :)

Posted 2 months ago

@KNO3. I presume you mean a webcam built into the lid of a laptop. I don’t have one on which to test it but it should support any video capture device (webcan, tv tuner, pvr, etc) on any system so I’d say 99% for sure, yes.

But all you need to do to find out is click through to the full screen preview and see if you get video from your camera (after clicking “allow” on the Flash Player’s built in webcam warning screen)

Posted 2 months ago

Note to all: If you don’t see live video after clicking “Allow” on thr Flash Player’s webcam warning screen (or see “snow” or other garbage), then right-click on the window and select your webcam device from the list of available video capture devices generated in the menu.

Posted 2 months ago

I don’t understand what this is for and I have a very good cam and when I use it with this file the quality is really bad

Posted 2 months ago

@realwebdesigns: I tried to explain what this for in my description above. If you already know how to set up Flash to detect your webcam, to open it in a video window and change video stream properties then you don’t need this file.

As for why you might want to use a webcam: that is only limited by the imagination. An example – I am currently working on a simple head tracking application which will allow a you to scroll a parallax type movieclip by simply moving your head right and left, so the scene will move as if you’re looking out of a window.

If you imagination is still not fired up read up on the Sony Eye Toy an imagine that kind of control in Flash. :)

Posted 2 months ago

@realwebdesigns: Is the quality of your webcam bad at all sizes? 640×480, etc. Can you link to a screen-shot?

Posted 2 months ago

is it possible to use this for live streaming? i.e. only the admin sets the device and the user sees the video being recorded lively! Please help

Posted 9 days ago