|
|
|
Here are a few notes regarding webcam design and construction here at 'bluenose'. As time goes by, elements of the camera chains will likely change, simply because I enjoy experimenting with the hardware and software ... after all, this is a hobby! |
|
Webcam #1
NOTE: This camera has been reassigned to serve as Webcam #2 This camera currently consists of an ELMO TSN410D CCTV camera with a Cosmicar Pentax HS6ZME2 motorized zoom lens, connected to the RCA video port of a Matrox Meteor PCI frame grabber card. The camera's built-in DSP circuit controls (among many things) color balance, artifact reduction and the zoom lens' auto-iris motor. The zoom lens is equipped with both UV (haze reduction) and polarizing filters. The software runs on a Linux-based camera server, starting with the Meteor driver v1.5.4 , implemented as a loadable kernel module. A single video frame is captured in PPM format by the 'snap' program and then forwarded to the 'convert' utility of ImageMagick , where it is given a small dab of image processing and a timestamp label. The corrected picture is then fed into the 'cjpeg' utility for conversion to 90% quality JPEG format, before leaving the camera server. This sequence of events takes about 5 seconds. Every 30 minutes this process is initiated by a 'cron' job on the web server, causing an image capture by the camera server. The resulting JPEG data is sent back over the LAN to the web server, where it is saved in the 24 hour circular queue. When a live picture is requested from a user's browser, the same process is performed on-demand. |
Webcam #2
This camera has recently been replaced with what was Webcam #1 (the Elmo camera) because the C200 camera described below finally wore out its third Flash memory card. This was originally an inexpensive old Hewlett-Packard C200 digital snapshot camera. It was connected to the camera server via an RS232 serial port (USB cameras were an expensive dream when the C200 was designed). This was used to send commands to the camera and download images from it. No special filters or lenses were added to the camera, which was set to its 'fine' mode (1152x863 pixels with JPEG compression). A cron job on the camera server started a capture script every 3 minutes. This script invoked the GNU gPhoto 'qm100' program to grab a picture and pass it to the ImageMagick 'convert' utility, which cropped the image to an 1100x480 pixel size, did a bit of image processing and added a timestamp label. A cron job on the web server requested the most recent picture every 30 minutes by copying the JPEG image via the LAN and saving it in the 24 hour queue. Live on-demand pictures were emulated by copying the most recent 3-minute capture. This was done primarily because of the camera's relatively slow RS232 link speed. The camera survived taking a picture every 3 minutes 24 hrs/day (that's over 14,000 pictures per month)! The folks at HP (and Konica/Monolta - now Sony) would probably cringe in horror to see how it was being abused. Note: As of the end of June 2010, this little camera had taken almost 1.9 million pictures without a single problem, and it still works. Amazing! |
Webcam #3
Like camera #1, this consists of an ELMO CCTV camera and Pentax motorized zoom lens, again with the UV and polarizing filters. It is connected to the S-VHS video port of the Matrox Meteor card. The same software used for Camera #1 is used here as well, the only difference being the video input port on the frame grabber card. |
|
|
| The
current automatic movie creation process is aimed at capturing sunrise
each day, plus a full daylight sequence at a rate of one frame
every 2 minutes. This begins with a version of the
'sunriset'
program written by Paul Schlyter, which I modified for my own purposes.
This program, running on the web server, is started by 'cron' at
3am each day to calculate the correct times of the next sunrise and
sunset (I use the start and end times of "Civil Twilight").
These times are used to schedule execution of build scripts on the camera server. Since images are captured every 2 minutes, 24 hours/day from this camera, it is simply necessary to select the appropriate frames and then build the movies from them. The individual frame files are combined and converted to MPEG-4 movie format by the 'convert' utility of ImageMagick in concert with the 'ffmpeg' utility, and the resulting movie files are sent back over the LAN to the web server. |
CAMERA NOTES:
14 February 1998 ... Installed a WebCam ...
A text-only website is pretty boring, and I think it's a shame not to share the beautiful view from my home, so I went to Computer City and bought a Connectix Color QuickCam-2 to use as a webcam. Heaven knows how well this will work, because the QuickCam isn't designed to be used outdoors, but I want to try it anyway. It's much cheaper than buying a handycam! I am not particularly fond of using a parallel interface because the NT4 'parport' driver layer is so brain-dead, but it's worth a try. The Webcam32 software looks like it'll do the job.
16 March 1998 ... Second Webcam Added ...
Not satisfied to leave well enough alone, I borrowed an old RCA video camera and attached it to a Snappy-3 frame grabber thingy I bought today. The camera uses a videcon tube, so it is subject to the ravages of time (but hey, the price was right!). If this works out, I'll get a proper CCD camera. Fortunately, Webcam32 works with this thing too.
28 April 1998 ... New Camera Hardware ...
Webcam #1 now uses a new ELMO CCTV camera with built-in digital signal processing, adapted for use with the Snappy frame grabber. I must be getting serious, because by the time you add a motorized lens these things are expensive! If you see things in the picture looking a bit "shredded", it's because the Snappy driver software interpolates among several video fields to produce a high-quality image, and the objects were in motion at the time.
My thanks to Scotty Henderson at Commercial Electronics in Vancouver for the help and for fast delivery of the camera and lens assemblies.
06 June 1998 ... New Frame Grabber ...
I have installed a new Bt848-based frame grabber card because it is 10 times faster than the Snappy (and half the price!). However, there's a trade-off here, because while this reduces the "shredding" problem with moving objects, the images from the grabber card are not as clear. This is because it's driver does not have the interpolation algorithms the Snappy software uses to produce its sharp pictures. On the other hand, I can now run both webcams simultaneously! A Matrox Meteor capture card arrives soon, so I'll be having lots of fun getting it working.
14 June 1998 ... Even Newer Frame Grabber ...
The Matrox Meteor frame grabber card is now installed and working well. It's image quality is much better than the "economy" Bt848-based card (at a considerably higher price!). I now have more control over picture quality and processing options. It takes a couple of seconds longer to process an image than with the Bt848 card, but it's still much faster than the Snappy driver!
05 July 1998 ... Third Webcam Added ...
Another ELMO CCTV camera has been added, focused on the Port Mann Bridge about 6 Km (3.7 Miles) away. This affords a view of the Trans Canada Highway traffic crossing the Fraser River, and of river traffic passing under the bridge (when rain or summer haze don't interfere). This camera uses the inexpensive Bt848-based frame grabber purchased earlier.
17 August 1998 ... Automatic Movie Capture Added ...
As an experiment, I tried adding processes to the web server and the camera server which calculate the times to start and stop automatic creation of time-lapse movies for sunrise and sunset. This worked so well that I decided to make it a permanent feature of the site.
10 January 1999 ... QuickCam (webcam #2) Retired ...
The poor little QuickCam's image quality has deteriorated to the point where I really must take it out of service. This shouldn't be a surprise, because it was never designed for constant exposure to bright light (and periodic hits by direct sunlight). It is time to think about connecting a real digital camera to the system, when funds become available.
01 July 1999 ... Webcam #1 Server Upgrade ...
Camera #1's server hardware has been running continuously for more than a year, so it's time for an upgrade of hardware and software. Built a new P-II based server with Linux 2.2.10 and meteor-1.5.4 software. This new computer will eventually run all of the cameras. I also resurrected the poor old QuickCam for the summer.
03 July 1999 ... Webcam #3 on the Meteor Frame Grabber ...
I don't know why I didn't think of this one sooner! Camera #3 has been connected to the unused S-VHS video port of the Matrox Meteor card to provide a sharper image. The image capture scripts have been modified to provide switching between the RCA and S-Video connectors for cameras #1 and #3.
05 December 1999 ... HP C200 digital camera for Webcam #2 ...
After resurrecting the old QuickCam for the summer, I finally decided that the poor old thing really had to go, so it has been replaced with a new Hewlett-Packard C200 digital camera. The GNU gPhoto software has a driver designed for this camera. This represents my first attempt at using a real digital camera in a webcam application. One major drawback is the very slow RS232 data link with the camera, which makes transferring pictures to the web server a bit gruesome. But hey, the camera is inexpensive and has very good image quality!
03 June 2000 ... Movie creation switched to Webcam #2 ...
The higher-resolution pictures from the HP C200 camera at Webcam #2 have proven to be more popular, so I decided that the daily automatic time-lapse movies should be created from this source. The "wide-screen" format of the images produces a more pleasing style of movie, and the quality is much better.
21 April 2001 ... New Camera Server ...
As part of a periodic hardware turnover here at the Bluenose site, the Camera Server computer and its Linux software have been upgraded. The speed of Meteor frame captures and movie creation has almost tripled.
14 January 2004 ... Webcam #1 gets a new job ...
Since camera #2 is doing such a good job of capturing weather conditions, I decided to give camera #1 a new task ... looking at the traffic on the Trans-Canada Highway as it passes through Coquitlam on its way to the Port Mann Bridge.
25 November 2004 ... New Web Server ...
The original Bluenose web server was more than 6 years old and getting a bit weary of running 24x7 for all that time, so it was time for a replacement. A larger and faster machine has been installed.
13 March 2005 ... New Camera Server ...
The camera server installed back in April 2001 began to behave rather oddly, and its power supply eventually died. This was just the excuse I needed to replace it with a new machine more than four times faster than the old one. The old Meteor frame grabber card is showing signs of age and will have to be replaced eventually.
16 November 2005 ... Camera #2 tops 1 Million snapshots! ...
The reliability of this quite old Hewlett-Packard C200 digital snapshot camera has exceeded all of my expectations. The mechanical shutter and CompactFlash module should have died long ago but they are both still working perfectly, without a single problem. Well done H-P and Konica! (The camera was manufactured for H-P by Konica).
24 December 2005 ... Camera #2 needs a new CF card ...
This problem had been expected a very long time ago, but didn't appear until Christmas Eve 2005 ... the Compact Flash card in the C200 camera finally wore out. Flash memory cards of that period were expected to last about 100,000 cycles, but this one (from SanDisk) lasted beyond 1 million cycles. Replaced the card, and the trusty old C200 continues to click along, well beyond the 1 million snapshot mark.
14 April 2007 ... Camera #2 needs a new CF card, again :-) ...
This problem was not a surprise because the first replacement was a used card. By that time, new low-capacity cards were getting expensive. Replaced the card with another used card, and the C200 continues to snap photos, well beyond the 1.3 million snapshot mark.
21 June 2009 ... Camera #2 flash card worn out ...
It's time to put the faithful C200 on the shelf. There will be a hopefully-short period without it until I can conjure up a suitable replacement.
05 October 2010 ... Camera #1 replaces the C200 ...
I haven't had an opportunity to get a decent replacement for the C200, so I've reassigned the Elmo camera #1 to take its place. The old Meteor frame grabber has been retired, replaced with an Axis 2411 network video server which grabs JPEG images from the video camera. It seems to work quite nicely despite its age, and eliminates the long upload times of the C200.
25 April 2011 ... A nice new web server! ...
It was time to upgrade the 7-year-old web server hardware, and that presented the opportunity to experiment with CentOS Virtual Machines (using KVM). This new server is much more efficient and also runs the webcam server and email server, so three old boxes have been replaced with a single one, which saves energy and makes maintenance a bit easier. The new server runs Scientific Linux 6 as the Host OS, and several instances of CentOS-5.6 as Guest virtual machines.