How Webcams Work

A webcam on a computer.
Webcams range from the silly to the serious -- a Webcam might point at a coffee pot or a space shuttle launch pad. Steve Chenn / Getty Images

If you have been exploring the Web for any length of time, then you have run across any number of Webcams in your travels. Webcams range from the silly to the serious -- a Webcam might point at a coffee pot or a space shuttle launch pad. There are business cams, personal cams, private cams, traffic cams... You name it and there's probably a Webcam pointed at it.

Have you ever considered setting up a Webcam yourself? You might want to create a funny Webcam by pointing it at your hamster or putting it inside your refrigerator. But it turns out there are lots of productive uses for Webcams, too. For example:

Advertisement

  • You will be out of town for a week and you want to keep an eye on your house.
  • You'd like to be able to check on the baby sitter and make sure everything is OK while you are at work.
  • You'd like to know what your dog does in the back yard all day.
  • You want to let the grandparents watch the new baby during nap time.

­ If there is something that you would like to monitor remotely, a Webcam makes it easy.

In this article, we will look at the steps you can take to put up your own simple Web camera.

­

The Basic Idea

This simple USB Webcam from Creative Labs costs around $30.
Photo courtesy Amazon.com

Webcams, like most things, range from simple to complex. If you understand the essence of a simple Webcam setup, increasing the complexity is only a matter of adding functionality through software, custom code and/or equipment connections.

A simple Webcam setup consists of a digital camera attached to your computer, typically through the USB port. The camera part of the Webcam setup is just a digital camera -- there's really nothing special going on there. The "Webcam" nature of the camera comes with the software. Webcam software "grabs a frame" from the digital camera at a preset interval (for example, the software might grab a still image from the camera once every 30 seconds) and transfers it to another location for viewing. If you're interested in using your Webcam for streaming video, you'll want a Webcam system with a high frame rate. Frame rate indicates the number of pictures the software can grab and transfer in one second. For streaming video, you need a minimum rate of at least 15 frames per second (fps), and 30 fps is ideal. To achieve high frame rates, you need a high-speed Internet connection.

Advertisement

Once it captures a frame, the software broadcasts the image over your Internet connection. There are several broadcast methods. Using the most common method, the software turns that image into a JPEG file and uploads it to a Web server using File Transfer Protocol (FTP). You can easily place a JPEG image on any Web page (for information on creating Web pages and adding JPEG images, see How Web Pages Work).

If you don't have your own Web server, lots of companies offer you a free place to upload your images, saving you the trouble of having to set up and maintain a Web server or a hosted Web site.

This is the simplest possible Webcam. Let's see what you need to make it happen.

What You Need

In order to create a simple Webcam, you need three things:

  • A camera of some sort connected to your computer
  • A piece of software that can grab a frame from the camera periodically
  • A way to broadcast your images on the Web

If you have your own Web server and Web site, you already have a way to post your Webcam images on the Web. At its most basic, a Web server is simply a piece of hardware that has the ability to deliver Web-based content to a Web browser. For some people, their home computer serves as their Web server. If that's the case, a camera, a piece of software and your PC are all that you need. If you want to use a Web server that's hosted elsewhere (for example, if you're paying an ASP to host your Web server), you also need:

Advertisement

  • The ability to move frames from your computer to the Web server, typically by File Transfer Protocol (FTP). For most Web servers, this is no problem; but occasionally, a hosting company will have policies in place that make this difficult.
  • A relatively consistent connection between your computer and the Internet. A modem connection to an ISP is fine if it is something that you keep connected most of the time, which implies that you have a dedicated phone line for your computer. If you have something like a cable modem that is connected all the time, that's perfect.

If you don't have a Web server or a Web site, and you don't want one, you can simply have someone else maintain your Webcam images. Lots of Webcam software comes complete with Web-based image access. They usually offer different access options, including remote access, which utilizes UDP protocol to transfer your Webcam images directly from your computer to another computer. This can be done:

  • via Web browser, in which case the software itself establishes its own HTTP server so anyone using a Web browser can access the Webcam images on your PC
  • via traditional FTP upload to a remote Web server

By using this type of service, you avoid having to host and/or maintain your own Web site. If you are using one of these services and you want the image to refresh itself constantly, you need a relatively consistent connection between your computer and the Internet. If your connection is not consistent, it won't hurt anything. It just means that the image won't always be up to date.

Setting It Up

In order to experiment with Webcams and go through the process of setting one up, HowStuffWorks got itself a Webcam. To set it up, here is what we did:

  1. We went down to the local computer warehouse and bought the Intel Pro Video PC Camera.
  2. We installed the software for the camera on a Windows XP machine.
  3. We went to the Web site www.webcam32.com and downloaded a program called Webcam32. This is a popular software package for Webcams. You can get a free demo version or pay $39.95 for the full version. We went ahead and paid for a registered copy. (The complete user's manual for this product is available on the Web site. Check it out to see the wide array of features available on today's Webcam software.)
  4. We installed Webcam32. It was a very easy installation.
  5. After entering the address of the FTP site and a couple of other pieces of information, the Webcam showed its first signs of life!
  6. We pointed the camera out the window.
  7. We then tuned the software a bit to reduce the file size of the images and to enable the temporary-file copying feature.

There are many different features you can experiment with in Webcam32: streaming video, chat, captions, AVI files and different resolutions and compression ratios, to name a few. Webcam32 also supports the AutoCam feature, which allows you to create a Web page for your Webcam for free on the company's server. The software makes it simple.

Advertisement

As you can see, setting up a basic Webcam is extremely easy. If nothing else, the setup described here is a fun, inexpensive and simple way to experiment with a Webcam and see what you can do with one of your own!

Advanced Features

Once you manage the simple system, you can look into other Webcam features and settings like:

  • Motion sensing - The Webcam takes a new picture when it detects motion.
  • Image archiving - You can create an archive that saves all of your Webcam images or only certain images at pre-set intervals.
  • Video messaging - Some instant messenger programs support Webcam video.
  • Advanced connections - Use wired or wireless methods to connect your home-theater A/V equipment to your Webcam.
  • Automation - Robotic cameras let you set a series of pan/tilt positions and program frame-capture settings based on the position of the camera.
  • Streaming media - For professional applications, a Webcam setup can use MPEG4 compression to achieve true streaming audio and video (this is the compression system used in most of the popular PC-based media players).
  • Custom coding - Import your own computer code to tell the Webcam what to do.

One example of custom coding is a set of commands that makes a Webcam image automatically refresh. The simple Webcam system we've set up in this article produces a static image. Users have to refresh the image manually (by pushing the Refresh button in the browser) if they want to see any changes. There are three different techniques you can use to create automatic refreshing:

Advertisement

  • You can add a meta tag to the HTML for the page so that the page refreshes at some frequency. The tag to add is: <meta http-equiv="refresh" content="30"> The "30" is the number of seconds between each refresh and can be set to anything you like. The entire page will reload every 30 seconds, so it is beneficial to keep the page short.
  • You can add a Java applet to your site. The Webcam32 and Java Applets page explains how to obtain and install the free applet. The applet is a program that automatically fetches the image periodically. The advantage is that only the image refreshes, not the entire page. Most browsers support Java applets, so most of your viewers will have no problem.
  • You can use JavaScript, as demonstrated on The JavaScript Source: Refresh (look at the source code on this page). You can also check out How Java Works for a detailed look at Java programming.

Webcam Networking

One problem with using a camera hooked to a computer via a USB cable is the limited cable length. What if the room you want to capture is at the other end of the house, or outside? In that case, you need to purchase a camera with external connections. You have a few options:

  • You can place a standard camera anywhere in the house and run a video cable with RCA jacks on it from the camera to the computer. There are all sorts of places on the Web that sell small pinhole video cameras, either on their own or embedded in things like clocks and smoke detectors. You can find small security cameras for less than $100. (Click here to use the HowStuffWorks search engine to search for security cameras.)
  • You can avoid the cable by using a radio link (X10: XRay Vision is one example of this type of product), an Ethernet connection or a WiFi setup. If you already have a home network, connecting an external Webcam to your computer probably won't require any additional networking.

Monitoring your home and sharing images via the Web are only a couple of the things you can do with your Webcam. There are any number of ways to make use of a camera that's connected to your computer. You can get software that will let you make video phone calls with a friend who also has a Webcam. You can hold a video-conferencing session with business associates on the other side of the world. You can conduct a video interview and broadcast it live on your blog. Some Webcam software will even deliver images directly to your Web-enabled PDA or smartphone. Other products let you connect your camcorder to your Webcam setup so you can let everybody watch your vacation footage via the Internet. The possibilities are endless.

Advertisement

To learn more about Webcams and related topics, check out the links on the next page.

Lots More Information

Related HowStuffWorks Articles

More Great Links

Sources

  • MOBI Technologies: ReCam http://www.getmobi.com/recamsw.html
  • Surveyor Corp.: Webcam32 http://www.webcam32.com/
  • WebCamStore: Webcam 101 http://www.webcamstore.com/consumer/tutorial/intro.php