PTZ
Basha Lounge Webcam -- How it Works
This particular webcam has been active in some form continuously since December of 1996. It was originally running on a Windows PC in a dorm room. In October of 1997, the webcam officially moved to the lounge on our hall where it remains today. The webcam server has been running the RedHat Linux operating system since the fall of 1998. We believe that this may possibly make it the oldest webcam on the internet that is still operating and features human subjects (not fish or coffeepots).
There used to be, in ancient times, a hacked together mechanism using old parts from floppy disk drives and a pulley mechanism with weights and string and a parallel interface, that could control movement (panning) of the webcam from the website. There was also at one point a failed experiment in which we allowed visitors of the page to enter text into a form and have speakers in the lounge sound out the words of our visitors. A new motion-capable camera has been installed, and perhaps, in the fullness of time, some of these functions will be restored, or new ones developed.
The domain name "www.mitwebcam.com" points to this web server, webcam.mit.edu, located in the lounge on our hall. Webcam is a cobbled-together AMD Athlon XP-class system that was installed in late February 2007, replacing a 7-year old 200mhz dell workstation. The camera hooked up to this server's USB port is a Logitech Quickcam Orbit. The system also has two IVTV-type video capture cards, and an ATI all-in-wonder (mach64). These composite capture cards are used to capture input from other cameras on the hall (such as the kitchen cam at http://www.collegecoedsgonewildinthekitchen.com).
Webcam.mit.edu is currently running Fedora Core 6 , and the Apache web server -- assuming this page is kept up to date. The Free Phillips USB Webcam driver (PWC) module is installed to give us a v4l interface to the camera. Basically, the system is running a shell script that loops continuously and captures a .jpg image, using mplayer, every few seconds. This image is stored and then copied to an archive where it is also stored to make a complete archive of recorded images. The image is then served up by the "G3webcam" java applet, which automatically refreshes the image in your browser.
For the original, non-java web page, the process is more complex. Basically, the captured .jpg is viewed on the main non-java webcam webpage via a frame with a META tag to force a refresh, and a tricky CGI shell script to fool caching web browsers and proxies by dynamically adding a string of numbers based on the current time in seconds as a dummy parameter. The full details follow below.
Within the page that the viewer sees when hitting the www.mitwebcam.com webpage is an iframe that contains the captured image and refreshes automatically every few seconds. This frame is actually html generated by a CGI shell script (/cgi-bin/webcam-framegen.cgi). In the header of this generated frame page is the tag: <HTTP-EQUIV="refresh" content="4">. This is what forces that frame to refresh every four seconds.
The webcam-framegen frame displays the most recent captured image by calling another CGI script. This script, "/cgi-bin/webcam-nocache.cgi" doesn't require any parameters, and simply cats the image file to stdout after a "Content-type: image/jpeg" header. But, this script is called with a random parameter generated by the server using the current time and date. This makes the image URL unique every time it is refreshed, and defeats all caching by any web browser and/or proxy. For more details on how these CGI scripts work, see the source code of the generated page at: http://www.mitwebcam.com/cgi-bin/webcam-framegen.cgi.