Technical information about original The Amazing Chez
Inwap Backyard WebCam.
Note: Everything here is written in the past tense since John
took the Pentium with him when he and Chris moved to
Chez TyeDye.
The original set up was a Pentium running Windows-95 and
SnapCAP. The current set up is a 486
running Linux and a Sun SPARCstation working in tandem.
Hardware provided by John O'Halloran.
Programming by Joe Smith.
- Hardware
- Toshiba CCD Color Camera, Model IK-M27A
This Desktop Camera went by the name ShareVision when it was
sold by >Creative (the SoundBlaster people).
- "http://www.play.com/snappy/" Snappy 2.0 Video Snapshot
digitizer by Play, Inc.
(Plus 9-volt battery eliminator.)
This device was plugged in to the parallel port.
- Win95 Software
- "http://www.snapcap.com" SnapCAP
This program captures an image every 5 minutes, uploads it via FTP,
and comes with a little tiny web server.
- Files that got uploaded
- Unix Software
- capture.pl - returns the most recent jpg from the current-hour directory.
- savecurrent.pl - run 3 times per hour to copy current.jpg and current.gif to current-today
- hourly.pl - moves older pictures from current-today to current-yester
- previous.pl - produces a listing of images in current-hour directory.
- thumbs.pl - run by savecurrent.pl and previous.cgi to create thumbnail gifs.
- Other files
Our WebCam was powered by SnapCAP running on John's tower Pentium at home.
The software starts up automatically when Windows-95 was loaded, and updates
www.inwap.com/backyard/
throughout the day.
Sequence of events, Win95
Image Capure
Every five minutes, SnapCAP told Snappy to do a frame-capture from the video
camera. This produced a CAPTURE.BMP file which got converted to 640x480
JPEG file and an 80x60 thumbnail image. Each capture had a unique file name
based on the month, day of month, hour, and minute of capture. The name of
the JPEG image was stored in capture.txt which is used by the perl scripts.
Image Upload
SnapCAP contacted our main web site and uploaded the following files via FTP:
- public_html/backyard/current-hour/mmDDHHMM.jpg
- public_html/backyard/current-hour/capture_t.jpg
- public_html/backyard/current-hour/capture.txt
Image Display
The most recent capture was available on port 81 on the Pentium at home.
Image Archiving and Rotation on Win95
The primary web site is on a Unix server at
www.inwap.com/backyard/.
Two perl scripts, savecurrent.pl and
hourly.pl are run by the System
Agent to make the files on Win95 match the files on Unix. Note:
The two scripts (savecurrent.pl and hourly.pl) work equally well
under Win95 and Unix.
Sequence of events, Unix
Two perl scripts are run every twenty minutes via 'cron' on the Unix server
03 * * * * backyard/savecurrent.pl 00; backyard/hourly.pl -q
23 * * * * backyard/savecurrent.pl 20
43 * * * * backyard/savecurrent.pl 40
The first one, savecurrent.pl, copies the
current JPEG file (and its thumbnail GIF) from the
current-hour directory into the
current-today directory.
Image Rotation
The second script, hourly.pl, moves anything older
than 24 hours out of the current-today directory
to the current-yester directory. Anything
older than 48 hours is deleted.
Image Display
Joe had to resort to a bit of trickery to get the URL with
backyard/capture.jpg to work. The ArteMedia
"http://www.halcyon.com/artamedia/snapcap/wallofsnap.html" Wall
of Snap page and other sites refer to "capture.jpg", but the actual
image name keeps changing. The key was to convince the web server to run
a CGI script whenever "capture.jpg" was requested. This script,
capture.pl, reads
capture.txt for the name of the
JPEG file. It then sends the image (Content-type: image/jpeg) without
a Last-modified header so that browser won't cache the file.
That same script performs a different function when invoked as
<!--#exec cgi="capture.cgi"--> - it returns
<A HREF="mmDDHHSS.jpg"><IMG SRC="mmDDHHSS.jpg" WIDTH=320 HEIGHT=240></A>
This tells the browser to display the image at half size; clicking on the
image will display the full picture.
- SnapCAP General Settings
- Frequency: Capture images every 5 minutes; autostart
- Image Size: Standard: 640 x 480
- Graphics Format: JPEG; Image Quality = 75
- Schedule: All seven days of the week, 04:30 to 21:30 during the summer
- Naming: %O%D%H%M.jpg (month,day,hour,minute)
- Thumbnail: 80 x 60, name = "capture_t.jpg"
- Draw Caption on Image:
"[ The Amazing Chez Inwap Backyard WebCam - %O/%D/%Y %A:%M:%Q ]"
- Image: Highest Quality, printer port 1
- External Control: (none)
- SnapCAP Internet Settings
- HTTP: Enable web server, port 81, index.html,
c677793-a.frmt1.sfba.home.com
- FTP: Host=shell3.ba.best.com, Username=inwap, Password=*****,
Directory=public_html/backyard/current-hour.
Always save=(not checked), Send INFO FILE, Send thumbnail, no proxy.
- Connections: via extablished network
- System Agent - three instances of savecurrent.pl
and one of hourly.pl run each hour.
- Cmd Line: c:\perl\bin\perl.exe e:/www/www.inwap.com/backyard/savecurrent.pl
- Descripton: Copy SnapCAP 3 times per hour
- Start In: e:\www\www.inwap.com\backyard
- Run: minimized
- Schedule: Hourly, 3 (and 23 and 43) minutes past the hour
- Unix httpd settings
- echo "AddType application/x-httpd-cgi capture.jpg" >>.bhtaccess
- ln capture.pl capture.jpg
- See above for crontab entries.
See also: recent pictures and
the gallery.