Setting Up a WebCam on MacOS X


Peter van der Linden, April 2003

Intro

Wouldn't it be great to sit at your desk at work, or in a hotel while you're travelling, and see a live video picture of your house or garden? That's exactly what a webcam delivers, and the technology is here today. Lots of people use webcams for security, child safety, pet sitting, delivery confirmation, overseeing domestic workmen, monitoring a hazardous environment, or other tasks. The uses are as varied as your imagination.

Just a few years ago, setting up a webcam was a challenging operation, beset with hidden technical challenges. And it still is today - on PCs running Microsoft Windows. It's a different story on Apple computers, however. Unlike PC's from other vendors, Apple supports both the hardware and the software. Things that are fraught with difficulty on Windows systems, like recording video, are easily done on Apple systems.

When I became interested in setting up my own webcam, I first tried a protoype implementation on my Compaq PC. There was a great variety of cameras or software for the PC, but nothing was tested with anything else. I tried a couple of different cameras, and 4 different software packages, but nothing was really satisfactory. Like 40 million other people, I have a PC running Windows98 at home, and I don't plan to buy a new version of Windows unless I have to. There was a flaw in every combination of webcam and Windows software that I tried. Either the camera wouldn't export video, or the software couldn't upload it on demand, or some other problem arose. Webcams on Windows just seemed to be more bother than they were worth.

Hardware

I also have a "desklamp" iMac at home. This is a modern system running a Unix-based MacOS, and connected to my ISP via broadband (DSL). I use it for email, web site creation, hobby programming and organizing my digital photography. After the PC disappointment, I decided to see what it would take to run a webcam on the Mac.

Macs are built around digital video. Every Mac system comes with digital video editing hardware and software, and it all works. In addition, the software to handle digital photography and digital music, as well as the ordinary browsing and email tasks, is built right in. But I was still pleasantly surprised at how easy it was to install and operate a webcam on my Mac.

The first step was to choose the hardware. I knew that a webcam that was tethered by a six foot cable to the computer was no good. And I didn't want to trail wire through the house. That meant that I needed a wireless camera that I could place anywhere in the house. The wireless camera would transmit the video to a base receiver connected to the Mac.

You can buy a tiny battery-driven wireless color camera and receiver for around $20-30 on EBay. I decided to get the larger X10 camera instead, because it comes with two power adapters and can run continuously as long as it is plugged into the mains. Now, understand that you are going to lose a little bit of picture quality when you use wireless vs. wired. That's an acceptable tradeoff for the flexibility you get in positioning your camera.

In this picture, the camera/transmitter is on the left, and the receiving unit is on the right. I got this almost new X10 camera on Ebay for $72. Make sure you are buying all four of: the camera/transmitter, the receiver, the camera power supply, and the receiver power supply.

The X10 takes care of capturing a video signal remotely, and sending it over to your computer. You still need some means of importing the video stream into your system in a usable form. The main conduit for "video in" on Macs is the firewire port. The X10 outputs an NTSC video suitable for feeding into a tv or a vcr. It doesn't have a firewire output signal. Since Macs don't come with a "tv signal in" port, some kind of protocol adapter is needed. I could have used an NTSC-to-firewire adapter, but firewire is a fast and hence expensive high end video solution. USB is a slower (hance cheaper) bus.

Speeds 'N Feeds

The USB protocol is a serial bus running at 10 Mbps. The video signal from the X10 is 360 x 240 pixels. That's 86,400 pixels each with 1 byte of color information. That's 691,200 bits of data, being refreshed about 29 times per second. In other words, 20,044,800 bps. That's more than twice as much data as USB 1.0 can handle. Solution: compression!

The Interview Lite hardware sends a complete frame of 691,200 bits only periodically (and you choose the frequency). The complete image is known as a "key frame". Subsequent frames can be optimized away to only send the differences from the key frame.

I looked for an NTSC-to-USB solution, and found the InterView Lite hardware device. This device is a hardware and software bundle that can accept a plug (yellow socket) or s-composite video signal (black socket) and convert it to a data stream over USB. This converter cost $40, new, from http://www.echofx.com/.

So to summarize, the hardware is:

hardware cost source
X10 wireless video camera $70-90 http://www.ebay.com
Interview Lite NTSC-to-USB converter $40 http://www.echofx.com/
total: $130

Software

The next step is to procure and configure the software which regularly grabs frames from the video stream, and uploads them to your website. We also need to write some HTML to display the most recent uploaded frame and to make sure the client browser refreshes it every few seconds.

The Interview Lite hardware comes bundled with an application called ImageCaster that does exactly the grabbing and uploading we need. That was an additional reason I selected that hardware.

Interview Lite comes with a CD, allowing you to install two applications: InterView and ImageCaster. You can also download a more up-to-date copy of ImageCaster from this website. Now you are ready to put the pieces together and start testing.

So to summarize, the software that I used is:

software cost source
Interview camera preview app $0 (bundled with Interview Lite hw) http://www.echofx.com/
ImageCaster image uploader $0 (bundled with Interview Lite hw) http://www.echofx.com/

There are many other software packages available. Some of the alternative software and/or sites are:

software price source
evological webcam software $20 http://www.evological.com/evocam.html
BTV (bundled with Macgix webcam sw) $20 http://www.bensoftware.com/

If you're looking for a MacOS driver for a camera you already have, try these:

Source of info on Webcams for OSX http://osxcam.org.uk
USB drivers for many cameras (has list) http://www.ioxperts.com/devices_usbstillcams.html
Mac device drivers for all cameras http://www.ioxperts.com/devices_allcams.html
Mac USB webcam support

Configuration

Step one is to plug the power adapter into the receiver, the receiver into the Interview Lite hardware, and the Interview Lite into a USB port. It has a large power requirement (did you know USB ports can supply power?) so has to go into a USB port on your system, not an unpowered USB hub. Similarly, plug the camera into the power adapter.

Now start the application called InterView Capture which you installed from the CD accompanying the InterView Lite hardware. If you start the app before plugging in the hardware, it will operate only in demo mode (a common user error). That brings up a "preview" window on your desktop that displays the streaming video. Wave at the camera. Poke around the settings, and tell it to send a key (entire) frame every 15 frames. That's how the video stream can be compressed enough to run over a low bandwidth bus like USB.

At that point, you should be seeing the video stream on your desktop. The next step is to use the ImageCaster instead of the Interview software. The manual doesn't mention this, but only one program at a time can process the incoming video stream. If you are running Interview, then ImageCaster won't work. A quick email to echofx support garnered a speedy reply, and got me past this hiccup.

Website

The camera takes images continuously, the Interview Lite hardware brings them into your system, and the ImageCaster grabs frames periodically and uploads them using ftp to your website. All you need do is configure all the details of where your site is and how to access it, and you are in business. ImageCaster is truly excellent software. If you already have a way to bring video into your system (perhaps over firewire), you can buy just the ImageCaster software for $20. It is well worth it.

I chose to have the picture grabbed every 15 secs and uploaded during working hours. That's a 20Kb upload 4 times a minute for 8 hours a day. I'm not sure exactly how much bandwidth my DSL provider and my ISP allocate to me, but I'm sure that 38 Mbyte/day is well within it.

Here are lines for your HTML file that cause the page with your image to be reloaded automatically.

<HEAD>
       <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
       <META HTTP-EQUIV="Refresh" CONTENT="15">
</HEAD>
<BODY>
       <img src=YOURPIC.jpg>

Bluetooth cameras

There are lots of other cameras and choices for software. I just described the combination that I chose, and that worked for me right away. To me, a wireless camera was a "must have". Otherwise you can only video things that are visible from within a few feet of your Mac system.

One potential improvement is to use a bluetooth camera. Bluetooth is a low-range wireless net connection. A bluetooth camera would be an alternative to the X10 wireless camera with the advantage that it would stream directly into the Mac without needing the Interview Lite USB adapter. I wonder how far away the camera can be from the base system though? This was a major consideration for me.

All Apple systems are bluetooth-capable these days. But bluetooth is still in its early stages, and there may not be a lot of choices for cameras. You can get a list of bluetooth cameras by googling.

Camera/Webservers

Another choice is a camera with an ethernet connection. This may upload pictures to your website or act as its own webserver. This design tends to be ten times as expensive as the alternative I used, but it frees you from attaching to your computer altogether. You just have to attach to a DSL modem or other ethernet connection.

http://www.axis.com/
http://www.dlink.com/ DCS-1000
http://www.panasonic.com/netcam KX-HCM8
http://www.veo.com Veo Observer