Your own webcam - the easy way
Many webcam sites rely on ActiveX and CGI scripts. In such cases the user has to download an ActiveX component before he can see your images. Moreover, in many cases firewalls will not allow webcam operation.
You don't need ActiveX and you can leave your firewall untouched with the very simple technique described here.
You need the following:
- A webcam; I use a Kodak EZ 200 - a very good product that allows focusing down to 5 cm, and has good colours. You can shoot 10 x 10 seconds videos and/or take a many pictures before the memory is full. It works well under very dark conditions. I have already taken 1300 images + videos with the first set of batteries, and they are still not empty!!!
- Webcam software; I use the freeware "Pryme" www.hilo.dk/pryme and set it as follows:
- Auto-capture every second in order to update the website
- Frame rate 30
- Compression quality approx. 20 %
- Fixed filename "pryme.jpg" (case sensitive!)
- No logfile
Pryme will shoot a picture every second and upload it via FTP to your server into the same directory where the two html-files reside which are described here below.
- A html-file (you can call it "webcam-opener.html") that looks like this (indented text must be in one the same line as the previous line):
<html>
<head>
<meta name="ROBOTS" content="NOINDEX">
<meta name="ROBOTS" content="NOFOLLOW">
<title>Webcam</title>
</head>
<script language="JavaScript">
function webcamwindow()
{
MyWindow = window.open("webcam.html", "webcamwindow",
"width=180,height=145,scrollbars=no");
webcamwindow.focus();
}
</script>
<body>
<a href="javascript:webcamwindow()">Webcam</a>
</body>
</html>
The "robots" lines should prevent that page from being indexed by search engines if you do not want that to happen.
The size of the subwindow is a few pixels larger than the image in order to show it with regular borders.
- A html-file "webcam.html":
<html>
<head>
<meta name="ROBOTS" content="NOINDEX">
<meta name="ROBOTS" content="NOFOLLOW">
<title>Webcam</title>
<meta http-equiv="Refresh" content="2;
URL=http://www.yourdomain.com/webcam/webcam.html">
</head>
<body bgcolor="#000000">
<img src="http://www.yourdomain.com/webcam/pryme.jpg"
width="160" height="120" border="0" alt="">
</body>
</html>
The original image from the Kodak is 240 x 180 pixels. In order to regain some sharpness - the compression factor is pretty high to allow for fast upload and download - I force a reduction to 66% of the size. The background is black to suppress white flickering as much as possible.
The refresh rate is set to 2 seconds. Maybe 3 seconds or even longer will suit your better.
This setup works through any system where the FTP-port (21) is open. Even a hardware firewall can be configured to pass this traffic.
In order to invite your conversation partner for a private conversation and keep out lurkers you can protect the access to "webcam-opener.html" with some password scheme.
That's all.
|