Wireless DevCenter    
 Published on Wireless DevCenter (http://www.oreillynet.com/wireless/)
 See this if you're having trouble printing code examples

Industrial-Strength Wireless Webcam

by Derrick Story

Webcams are fun -- at least for the first 10 minutes or so.

After that your viewing audience begins to suffer from dull, comatose images generated by a cheesy, single focal-length lens tethered to a host computer that's usually residing in the dusty recesses of your office. So, unless you have a window to a really great view, I doubt that you're going to win too many Emmys for your online broadcasts.

But, on the other hand, what if you could roam freely with a portable webcam outfitted with a powerful zoom lens that could follow the action as it happens? Your high-resolution images would be processed quickly and directly uploaded to a web server for immediate viewing. Now, that would be a webcam worth watching, wouldn't it?

For example, if your goal was to broadcast your daughter's birthday party so relatives across the globe could share the moment as it was happening, do you really want your webcam fixed on an empty birthday table when all the children are outside playing? Probably not.

I'm sure you've run into offers for tempting solutions such as the X10 XCam2 that promises wireless camera functionality. But in reality, the quality isn't very good, and it's designed to send images to your TV or VCR, not a web page. If you were to spend the extra bucks to transmit murky pictures to your web server, chances are you'd create a tremendous vulnerability that could allow hostile intruders access to your account. My advice is to pass on those devices.

On the other hand, if you own a laptop, and have been experimenting with 802.11b networking, you're already close to a portable, high-quality solution. With the right software, a little ingenuity, and a DV (Digital Video) camcorder, you can build a robust broadcasting system that will publish images actually worth watching.

There are a number of ways to accomplish this. In this article, I'll only discuss one method I've had success with. Take a look at how my system works, then create your own. If you come up with something really cool, be sure to post a TalkBack message.

The basic tools for my approach

I opted for a Mac-OS-X-based solution for a number of reasons. This platform provides a strong graphical interface, a Unix foundation that's accessible via the Terminal application, FireWire connectivity between the camera and laptop, 802.11b networking between laptop and base station, and terrific webcam software. I spent a total of $20 for the software, and I used equipment I already had for the hardware. Here's the parts list:

  Equipment used

The webcam setup -- Canon ZR camera (with LCD flip-screen up) atop an UltraPod II. FireWire cable connected to a PowerBook running Mac OS X 10.1. The browser window is on left side of the screen displaying current webcam image. The CoolCam application window is open on the right side of the screen.


If you're not working on the Mac platform, don't stop reading this article because many of the techniques I'll cover are relatively generic, and will apply in principle to your equipment configuration.

You also might be wondering about my choice of camera. Why not just use a cheapie, single focal-length webcam that connects via USB? Again, those will work, but you won't have the features you need to for creating high-quality, interesting broadcasts. Later on in the article I'll explain why I like the DV camcorder. Take a look at the features I mention, decide which ones you need, and design your system accordingly.

But before we get to the camera itself, let's take a look at the all-important software that orchestrates this entire show.

CoolCam powers your webcam

CoolCam 2.0 software is at the heart of this broadcasting system, so let's take a look at its features.

CoolCam is produced by Evological software which says the purpose of this product is to create a powerful, easy-to-configure webcam. The Mac OS X version allows you to connect a FireWire camcorder to the laptop and broadcast images via FTP to your server. I'll discuss the pros and cons of FTP transfer a little later in the article. But for quick-and-dirty setup, choosing this option gets you on your feet quickly.

CoolCam has a terrific interface that consists of a viewer window and four tabbed control boxes labeled: Server, Options, Status, and Items.

In the Server control box, you set the path to your FTP server and enter your user name and password. According to the Evological man pages, setting the correct path to FTP is the No. 1 problem for most users. That shows you how easy the software is to use. If you're behind a firewall, remember to check the "Use Passive FTP" box.

Once you establish the correct settings, CoolCam will grab an image at the specified interval and upload it to your web site directory. Viewers can see the images by going to the web page you've designed to download the pictures from the server and display them.

The Options control screen has many useful functions. In addition to setting the refresh rate for capturing each image, you can instruct CoolCam to send the image to the server, to a local directory, to an archive folder, or all three!

  Options Screen

The Options screen allows users to control screen refresh and tell CoolCam where to send the images. Here I have it set for sending images directly to my web site (via FTP), plus saving them to a local directory, and archiving them in another location.


There may be situations when you don't want to use FTP for uploading images, such as over a public 802.11b network. In those instances, you can turn off server upload, save the images to a local directory, and use Secure Copy (SCP) to send your webcam shots. This is where Mac OS X's Unix foundation comes in handy because you would need to set up this job in the Terminal application. I'll be discussing this more in the follow-up article on secure uploading of wireless webcam images.

I also want to mention some of the cool archiving options that are available in CoolCam. You can save each webcam image, sequentially numbered, to a local directory, or you can opt for a QuickTime movie. When you choose the movie option, CoolCam actually builds the movie for you -- using all of the captured images -- when the webcam session is closed. Very cool. By using this feature, you can offer past webcam broadcasts as easy to download QuickTime movies.

The one button that I tripped on was the Video Input control that opens another screen with all sorts of cool controls such as Hue, Saturation, Brightness, and Contrast. Unfortunately, none of these controls worked for images sent from my DV camcorder. I contacted CoolCam tech support and found out why.

This dialog box is provided by QuickTime. The QuickTime DV video digitizer software, since DV is already digital, doesn't allow adjustment of brightness, contrast, hue, saturation, etc. These controls are usually only available on capture boards that have analog front-ends.

So, the moral of the story is that you need to control the appearance of the image on the camera side when working with DV.

You can click on the Status tab when you want to keep track of details such as when the last image was uploaded, its size, and its format. You can even review the FTP transcript here.

  Status Screen

The Status screen provides you with a thumbnail of the last image uploaded, and gives you all the numbers too.


One minor annoyance I encounted happened whenever I clicked on the View Image button, which causes CoolCam to lauch the Mac's Classic environment in order to use the Picture Viewer application to display the image. I looked for a way to change that preference to use QuickTime 5 for Mac OS X instead, but I couldn't find out how to make the adjustment. So I pinged tech support (and they got back to me right away). Here's their explanation:

The View Image button simply tells the Finder to open the "CoolCam Image" file (in the same folder as CoolCam) using whatever application is appropriate. Your "CoolCam Image" file, especially if it was initially created on the original release of Mac OS X, might be set to open in PictureViewer. This problem appears to be fixed in version 10.1, so try deleting this file and seeing if it fixes the problem (CoolCam will create a new file on the next upload/save attempt). Also, you can change the application that opens a given file in the file's "Show Info" window. After you've done this, CoolCam will honor this setting whenever you click the View Image button.

Once again, tech support hit the nail right on the head. The key phrase is, "in the same folder as CoolCam." The file named, "CoolCam Image", is the file that you need to remap using Show Info. Once you do that, the View Image button will open your picture in the application you specify.

The last tab, Items, contains all sorts of goodies. If you want to add caption overlays to your pictures, you can set their position and parameters here. Same goes for time-stamping. If you need to censor part of the picture, you can use the "blur" function and obscure selected areas just like the networks do.

  Items Screen

In the Items screen you can set the parameters for your captioning, time-stamping, blurring, and even motion-detection.


And if you want to use your webcam for security purposes, you can create a motion-detection sensor that activates transmission whenever the camera detects movement.

CoolCam performance was terrific, and most of the features worked as advertised. It really feels like a Mac OS X application. You can try CoolCam free for 15 days. After that, Evological asks that you pony up USD$20 and register the software.

DV camcorder advantages and disadvantages

At first you may think that using a DV camcorder is overkill for webcam broadcasting, and in some situations you're right. But DV camcorders also have a number of benefits that cheaper USB cameras don't have. Here a some of the more important advantages:

When covering an event, I like to keep the videotape running even though it's not necessary to do so while using the camcorder as a webcam. That way, I have a complete account of all the action that I can edit down to a movie, or refer to at a later time. Since most DV camcorders can only record 90 minutes per tape, you will have to carry a few extras for those long assignments.

The main disadvantage I've encountered is battery power. Camcorder batteries usually only last an hour or so, and they seem to die at the most inopportune times. It's true you can plug the unit into the wall for unlimited power, but then that sort of defeats the purpose of having a wireless webcam.

The best solution -- carry a couple extra batteries. Chances are that you'll need them to complete the shooting session.

DV camcorders have dropped considerable in price lately, and quality models can be purchased for around USD$500. Make sure you check compatibility with your laptop before spending any of your hard-earned cash.

I've been using an old Canon ZR for a couple years now, and it's a great webcam because it's so compact. I simply plug it into the Mac via a FireWire cable, and the image appears immediately on the CoolCam preview screen. It couldn't be easier to use.

Going wireless with your webcam

So far everything I've covered can be applied to just about any webcam set-up -- tethered or not. Now it's time to cut the umbilical cord and wander freely with your laptop and camera.

Once you have your webcam working on your PowerBook, unplug it from the wall and turn on AirPort. Depending on where your BaseStation is positioned, you'll have up to an 150-foot radius to roam for capturing images.

Does this mean you'll be wandering around with a laptop in one hand and a camera in the other while trying to follow the action? Well, I wouldn't recommend that. Instead, find a table, chair, or any stable surface to set your laptop on, and move around with the camcorder in hand. You should have at least a 6-foot FireWire cable to allow you to get the position you want.

This is where that LCD flip-screen comes in handy. With cheaper webcams, you have to use the computer monitor to see what the camera is recording. That's fine if you're tied to a stationary position. But now that you can roam, you don't want to have to keep referring to your laptop screen for image composition. Set the computer down and explore with the camera. You'll get better shots.

I always carry a portable tripod too. That way I can direct the camera at a scene without having to hold it the entire time. This also adds stability and sharpness to your images.

When you want to record in another area, just pick up your laptop and off you go. This technique works great at home events such as birthday parties, holidays, and other special gatherings. You can roam and record as long as your batteries last and you stay within network range.

But there are a few security issues you should be aware of. As long as you are using FTP over an 802.11b network, your user name and password can be intercepted by "black hats" who then have complete access to your web site.

You might think that since 802.11 only operates within a limited range, such as 150 feet, that you are safe within your apartment or office building. But that's false security because intruders can extend that range by using special antennas.

Is this likely when you're home? No, not really. But I recommend that you play it safe and make sure you have WEP (Wired Equivalent Privacy) enabled to help discourage intruders. Also, if you're using a Mac, it will display all 802.11 networks within range. If you turn on AirPort and see other networks listed, I would caution against using FTP for wireless uploading. Because if you can "see" those networks, they can see you too.

In the follow-up article, I'm going to outline how to set up a secure key and transmit via SCP. This is the way to go if you want to broadcast on a public network, such as at a conference that has a 802.11b network for its attendees.

The bottom line is to use common sense. Keep an eye out for other networks within range, watch for guys with big antennas, and always use WEP.

Setting up your web page

I think an attractive web page serves as a nice frame for your webcam pictures. Be sure to include links to other areas of your site, add your logo, write some text about the event that establishes the situation, list the date and time for your next scheduled webcam broadcast, and offer archived copies of past events for download.

Don't forget to add a couple lines of HTML to the head of your document instructing the page to automatically refresh at a specified interval. I like the page to reload every 60 seconds, so here's the way I write those instructions:

		<meta http-equiv="refresh" content="60">
		<meta http-equiv="expires" content="0">
                <meta http-equiv="pragma" content="no-cache">
		<title>My Webcam Page</title>

In the body of your page, just add the image source link so your page grabs the uploaded pictures:

<p><img src="webcam_images/webcam.jpg" alt="Webcam image appears here"></p>

Don't bury your webcam page too deep in your directory structure. You want to keep the URL easy to remember so site users can go back to it. Use something like:


The CoolCam software allows you to set the size of your JPEGs and their image quality. If many of your viewers are using dial-up, then keep those file sizes to 50k or below so they have snappy screen refreshes.

Hitting the road

Now that you have freed your webcam from your clunky tower computer, let your artistic juices flow. Look for good compositions. Zoom in for tight portraits, and zoom out for establishing shots. Position your camera so you get the best lighting possible on the subject. Use the captioning function of CoolCam to add bits of information that help viewers follow the action.

I know in my house we'll be using our webcam this holiday season to share some of the moments with relatives all across the states. And the nice thing about using wireless to do so is that we won't have to open gifts and eat dinner in my office next to the dusty, old workstation.

Happy shooting!

Derrick Story is the author of The Photoshop CS4 Companion for Photographers, The Digital Photography Companion, and Digital Photography Hacks, and coauthor of iPhoto: The Missing Manual, with David Pogue. You can follow him on Twitter or visit www.thedigitalstory.com.

Return to the Wireless DevCenter.

Copyright © 2009 O'Reilly Media, Inc.