[Spy Home Page]SpyCam Technical Debriefing
SpyCam resulted from our need to access video hardware that resided on machines other than our WWW server. Our original one day hack that we did several years ago is similar to the various other cameras that are so prevalent on the net: write a quick shell script that calls some vendor provided binary that grabs a frame from the video source and writes it out to disk. Then add in rsh support where necessary. There are three problems with this solution: it is slow; it is insecure; and it is just downright ugly.

Thus SpyCam was born. The suite of programs that make up SpyCam consists of some 6,000 lines of C++ code that call Silicon Graphics' Video Library to access the video hardware and their Compression Library to convert the image to jpeg format. Thomas Boutell's gd library is used to output a gif image. SpyCam can be broken down into four basic parts:

HTML Page:
The Web page presents a form that grabs the user's input and passes the data on to the cgi binary.

CGI client:
A TCP/IP based client that processes the form, sends the request to the server, reads the resulting raw or processed image back, converts it as necessary to GIF or JPEG format, creates the HTML document on the fly, and returns it to the client's browser.

SpyCam Server:
A TCP/IP based server that receives the request from the client, determines who is on the console, verifies that the console user is granting access to the video device, grabs a frame, does any necessary image processing, and sends the result back to the cgi process.

LoadAvg Server:
A server that communicates with the spy daemon via a unix domain socket. It runs as a separate process for security purposes as it needs to be set group id to zero in order to access /dev/kmem, thereby allowing the spy daemon to run under any given uid/gid.

In addition to the speed benefits that SpyCam provides, it is also highly configurable with a server configuration file, a CGI configuration file, and a per user daemon access configuration file. The server can be configured to run under any user or group id, any port, and has various levels of logging, from simply recording who accessed the daemon and when to detailed reports on the server process. SpyCam users are insured of privacy via the .spyrc configuration file. The daemon can be turned on or off, limited based on the load average of the machine, certain troublesome hosts can be denied, or various access groups can be set up depending on the day of the week and the time of the day. Load balancing can be achieved by either have the local host or the Web server provide the image processing task.

*Note* Due to a change in joba and loss of access to an SGI, SpyCam development was frozen. I'm back home now and have access to an O2 and will jump back on development of the project. Please bear in mind that the next paragraph was written around a year ago:

Best of all SpyCam is provided freely by Todd Green, via the Extreme! Computing Group at Indiana University. If you have an SGI workstation runing Irix 5.3 or newer, equiped with the digital media libraries and a video source, you can ftp the software. The CGI binary software has (actually will have shortly ;) been ported to the following Unix systems: Irix, HPUX, AIX, and Solaris You can contact the author by email if you wish to send comments or suggestions. Current improvements include a C/C++ library interface and ports of the CGI binary to various flavors of the Unix operating system.

Finally, I'd like to thank my fellow subversive, Scott Ostrander, for plucking the idea for the spy icon straight out of my head and realizing it in digital ink. Scott also provided all the images that get generated when an error occurs. Never could a man craft so well with a bar of soap!


[HOME] Page Last Modified on: January 20, 1997, © Todd Green - Indiana Unversity