There are an increasing amount of webcams on the internet, everyday thousands of new ones appear and at the same time thousands go offline. This article is going to show you how to get a webcam up and running online and streaming via a web interface(i.e your website).
The result of this tutorial will look something like this:
Firstly, you’re going to need to decide what sort of camera you want to use. There are two options, USB or Composite video. USB is the easiest to set up and composite is the most flexible. I chose composite as I needed to run a long cable from the location of the camera to the machine that sends the image to internet. If you just want a webcam on your desk pointing at you then just use a USB one to make your life a lot easier.
Here is a list of equipment you’ll need depending on which camera type you use.
USB Webcam
Computer with USB port
Windows XP/2k
Capture card
Composite video RCA connectors/cable
Compatible camera (More info later on in the tutorial)
Choosing Your Hardware
If you picked a USB webcam then skip this section.
There is so much to choose from when it comes to capture cards and cameras. For this tutorial I’m going to assume that you want an outdoor webcam, if not you can still follow this but you’ll want to get a cheaper indoor camera. So, to start you’ll need a device that’s going to intercept that analog signal that your camera gives you. For this, you’ll need something called a video capture card, also known as a TV card. There are a lot of people who say don’t go for the cheap ones as they are bad quality. This is true but for this particular application it doesn’t matter as we will be broadcasting our webcam image at 320×240 which means the quality of the TV card doesn’t matter. For this tutorial I recommend a Hauppauge WinTV variety card, like this one:
You now have a TV card, you are almost ready to start putting your webcam setup together, of course you’re going nowhere without an actual webcam! For this I would recommend something a bit higher quality and with a good build quality. The weather is getting more and more extreme so you’ll need one with decent weather resistance too. For an example of the webcam used in the demo I showed you earlier in the tutorial look here. This webcam is actually a very cheap indoor one I bought from Hong Kong on ebay! The reason I used one of these is the shed roof covers up and parts that are open to the elements so I won’t have any problems with rain getting in. Not only that it is easily replaceable but for most people this isn’t the best option as you’ll probably not have a convenient shed roof where you want to place yours. This is where I suggest you buy a decent quality CCTV camera designed to be outdoors. I recommend that you use the camera shown here:
Now, you have everything you need hardware wise to get this show on the road! All you need to do is install it. To do this I suggest you DO read the instructions that come with the camera. It will almost always show you exactly what to do. Just don’t wire it to your TV as that part of the instructions is what you need to ignore. Wire it as if the computer you will install the capture card in is going to be your TV, you should have to problems at this stage.
I’m not going to run through how to install a capture card in your PC. That is easily done by you if you know how or you can get a friend or a professional in to do it for you.
Adcuz.co.uk is not responsible for any damage caused to you or your computer when trying to install your capture card.
Now, let’s get down to business. I’ll assume that you already have the capture card installed and you have all the drivers installed too. If you’ve got this far then the last bits will be easy! One last thing you must do on the hardware front is turn the camera power ON and make sure the RCA cable is plugged into the capture card. (little yellow plug next to the ariel input).
Setting Up The Software
Welcome back USB people! So now you have all this camera stuff hooked up, but no image to see! Don’t worry this next section will show you how to do everything, from getting the image on your screen all the way to putting it on your website, blog or any other form of web interface. I’ll even show you how to relay the image to your server to relieve strain off your home connection.
To get the image from the camera to the internet you’ll need a piece of software called a webcam server, what this does is takes a snapshot from the camera every time an HTTP request is sent to it. It then compresses the image to a JPG image and sends it to the viewer. If on a fast enough connection it can be done fast enough to be real time, to do this on a home DSL connection would be difficult as most upload speeds are laughable at the moment. Unless of course you live in somewhere like Hong Kong.
Now you know what the software does, you probably need to download it and have a look. So the software we’ll be using is Webcam 2000, It seems to have been abandoned at the moment but it works a treat anyway, I’ve been using this one for about 3 years now.
To download it directly, click here.
Once downloaded, unzip the program to a folder anywhere you like on your computer. The good thing about Webcam2000 is it doesn’t require any installation, it just works right out of the box. Now you have it un zipped and ready to go, open up WebCam2000.exe and you’ll probably see a black screen. Or, if it has auto detected your USB cam or capture card you’ll see something like this:

Now, you’ll need to check that you are receiving an image from the camera, click the tick box that says “View Preview”. You should see a live image of the camera. If not then you’ll need to specify the capture source. To do this, in the top menu go to Video, you’ll see a drop down menu with the name of the capture sources installed on your computer. Click on the one that you’ve just installed. Now, you’ll see a live image!
If your image looks fuzzy and has a lot of static on it you probably need to change the filter, try changing it to PAL if you’re in Europe.
Now you have your live image playing on your screen you need to get it on the internet, this part can be difficult depending on your network setup. Due to my laziness, I’ll assume that you have a router with a firewall and no other firewalls installed on the machine you are hosting the camera from. First, lets be sure the webcam server has the HTTP server enabled. So, on the Webcam 2000 interface, make sure “Enable Web Server” and “Live” tick boxes are checked. The next step is to specify which port you want the server to run on, this is easy! In the top menu: Go to - Options > Web Server. You’ll get this screen:

In the box that says “Image server listens on port” change the number to 8080 (usually default) and press OK. This is all the configuration you need to do now, the last part of this section is to forward the port on your router to allow people to see the camera from the internet. Firstly, take a note of the make and model number of your router. Then click here for instructions on how to forward Port 8080.
Displaying Your Webcam On Your Website/Blog
This part is tricky for anyone who is new to this, I’ll try my best to explain it in the easiest way possible. So, the main part required is all done and you’ve got your equipment setup. Now you need to put the webcam on your website. Firstly you need to find out what your IP address is. To do this you’ll need to visit this site which will tell you what your IP address is. Some hosts use proxies and these sites cannot detect your true IP. If this is the case then you’ll need to get in contact with me or contact your ISP who will tell you your IP. Once you know your IP address you MUST take not of it. Write it down and keep it close to hand it’s vital for this next bit.
Firstly, I’ll assume you already have a website and you know something about HTML code. Next you need to copy and paste the following piece of code to where you want the webcam stream to be displayed.
<SCRIPT LANGUAGE="JavaScript">
<!–
bName = navigator.appName;
var isopen=Math.round(1000000+(Math.random() * 1000000));
var camurl="http://0.0.0.0:8080?";
tmpimage = new Image();var first=1;
function seturl(txt)
{ camurl = txt; }
function doimage()
{
isopen++;
document.images.webcam.src=tmpimage.src;
tmpimage.src=camurl+isopen;
}
function firstimage()
{
if (first == 1) {
first = 0;
isopen++;
tmpimage.onload=doimage;
tmpimage.src=camurl+isopen;
} }
document.write(’<IMG border=0 src="http://0.0.0.0:8080" name=webcam onload="firstimage()" height="240" width="320">’);
//–>
</SCRIPT>
Where is says http://0.0.0.0:8080 (in 2 places) you need to replace the 0’s with the numbers in your IP address, but be sure to keep the dots, and the :8080 in place or it won’t work. Once you’ve done that, save the page and view it, you’ll see a moving image from your camera!
That’s it, you’ve done it! Well done to you.
« Go back to the tutorials index.


July 23rd, 2007at 1:11 pm
HELP ON HOW TO SET UP A WEB PAGE WOULD BE SO HELPFUL , I HAVE ABOUT GIVEN UP ON MY CAM NOW , AND ITS HEADING TO THE BIN VERY SOON ;-(
July 23rd, 2007at 1:34 pm
No need to shout. I will probably be writing a tutorial on this. If you want me to help you build a site I can probably do that. I can’t just build you an entire website though as I can get paid to do that.
October 1st, 2007at 2:08 pm
Hey, good stuff here. I do have a website. If I were to want to put this on the home page of my site. Can I just cut and paste and place it at the end of my HTML code of the index page? Is it as easy as that?
October 2nd, 2007at 7:17 am
Yes Beats, you can do that indeed.
October 12th, 2007at 8:35 am
I got my static ip set, set up webcam2000, got portforwarding to forward udp/tcp 8080 ports to my internal IP (192.168.0.110) (it wouldn’t let me leave the IP blank).
I got the website set up, and pasted that script, but it keeps telling me there are errors on the page, and the webcam doesn’t work. I noticed there was a “?” by the ip:8080 part, so I tried it with and without it.
Are the errors due to a problem in the cam feed, or due to some other typing error?
Awesome site btw, you’re going to save me from getting banned on cs:s
October 12th, 2007at 8:36 am
http://noobspwncam.faithweb.com and /webcam.html for the script without “?”
October 12th, 2007at 4:56 pm
How will I save you from being banned from Counter Strike lol?
The code with the question marks in is fine.. it should be like that.
I tried to access your cam directly and it doesn’t work. You might need to double check you opened the ports properly. (you don’t need the UDP port open)
October 12th, 2007at 8:08 pm
I just send people who cry out hacker to this cam page, and they can see that i’m not cheating. This will save me a boatload of grief.
Now on the router setup guide it tells me just to type in the 8080 port, but doesn’t tell me to type an IP in. In the router setup it forces me to type one in. My internal IP is 192.168.0.110 , and external is 76.105.13.35. Now it won’t let me use my external, and I’ve tried the 192.168.0.110, and also 192.168.0.1. Do I need to call my ISP and have them forward the port as well?
“The Gaming option is used to open multiple ports or a range of ports in your router and redirect data through those ports to a single PC on your network” says this on the router page i’m fiddling with. So if it is forwarding the port to my IP, is it also working the opposite way?
Thanks for all your help. I can’t wait to get back on cs:s and play again.
October 13th, 2007at 4:36 pm
OK, right. Your ISP does not need to forward the ports. You must use the internal IP of the pc that has the webcam server on it. Make sure have web server and live ticked on webcam 2000 also. Also make sure you have the right external IP in the javascript as some people’s IP’s change all the time.
If you want further help email me via the contact page and we can discuss it further to save cluttering this page up!
October 14th, 2007at 1:03 am
OK, thanks for all the help!
November 15th, 2007at 1:13 am
Hello Adcuz. Thanks for the tutorial. Can’t get mine to work. The URL is in the box I just filled out for you labeled “Website”. I have Webcam2000 running and I can see image on my PC. Have pasted your code into a blank page and applied my IP address in two places. No image. Rats! I believe I have carefully ticked all the boxes you show. I have no router. Got a Windows warning when starting Webcam2000 and gave permission to unblock everything (I’m a little worried about that). Any help? Thanks…
November 15th, 2007at 2:42 am
Adcuz: I might add, although I’ve left the Webcam2000 page in place because I’d like it to work that way, I came up with another plan that works, even if a bit Rube Goldberg. I realized that Webcam2000 is actually serving a stream from my IP address, so I set up a frame that refreshes every 5 seconds with the top part static (for the refresh code) and the bottom part pointed straight to my IP address. Works! Although there is a white flash as the pictures refresh which is distracting. It is at index2.html of the URL I put in earlier but I probably won’t leave it on when I’m not sitting here until I get your method in place. Thought you’d enjoy this workaround but would still like to get your way in place. Thanks…
November 16th, 2007at 10:36 am
Glad you got it working!
Not sure what you mean though, the white flash could be caused by the prebuffer not working.
April 27th, 2008at 3:57 pm
Hi
Been trying to get the webcam on my site without success. I think the problem is that I am using a proxy server and cannot see my true IP address. I tried the IP addr that was shown but no joy. I can see the webcam on the screen using the program but not on the web. I have enabled UpNP on the router so that should be ok. I want to use the camera to get inbound links from other webmasters who want to link to it which I guess would work?
Any help appreciated.
Best Regards
Peter
April 27th, 2008at 4:53 pm
Peter, thanks for visiting.
The problem sounds probably lies with your router, if you are using Web2000 you will find that it does not support UPnP. It is best to forward the port manually on your router. The proxy could be problematic as well, but it is best to start with the router as that is the source of most problems when trying to set up this sort of thing.
Again, thanks for reading
April 27th, 2008at 8:39 pm
Thanks Adcuz, I’ll give it a try but I’m not sure what I do. I’ve got a conceptronics C54APRA2 and when I check your link to the router website I can’t find where to enter the new port settings. If I go into advanced and then virtual server, I get a list of options including games VPN audio/video apps server and user. I thought I should choose audio video but the options in that menu are net2phone, net meeting and quick time 4 server and I don’t think that has anything to do with it. On the server menu I get another list including web server and ftp server. I can choose web server and add it to a box but if I do that, I still don’t get an option to change the server port to 8080 so I’m a bit stuck. As the saying goes, “a little knowledge is dangerous” and I’m a bit frightened of messing the router up and not being able to get back on the internet. Sorry if its obvious but I just can’t seem to figure it out.
Anyway thanks for trying to help.
Pete
April 28th, 2008at 7:58 am
Hi Adcuz
I’ve managed to get it working using some html code I found on another site and finding my true IP address but the only problem is that it isn’t refreshing automatically. If I refresh the page the picture refreshes. Could you offer any advice? The image is on http://www.apartrent.co.uk/COSTA BLANCA/la cala de finestrat.htm
Thanks for any help.
Pete
April 28th, 2008at 5:25 pm
Peter,
At the time of writing (6:23PM GMT) the cam is not working. I guess you’ve turned it off. Anyway, looking at the page in question you are not using the javascript that I supplied above but some other one. I don’t know why that one isn’t working but it might be worth trying it.
Cheers
And good luck!
April 29th, 2008at 7:41 am
Hi Adcuz
I was kidding myself about it working. I’d typed the ip 127.0.0.1 to test it and uploaded it with the same ip. When I put the right one in, it didn’t work. When I used the java script on this page, no box came up (where the image is displayed) so I searched around and found the one that’s there now. I got a local computer expert to come and have a look for me and he said I had to have a static ip address so I got another domain name valichi.com and when pinged,the i.p returns 69.57.152.149 and 83.51.152.149. He said that the first ip was the one to use. I got a bit lost at this point but after about 3hrs struggling he had to go and it still isn’t working. The fact that it works right with my local ip makes me think I’m not far away, so I’m going to crack on. Apart from my webpage, there isn’t anything else I have to upload is there? I know I’ll get it working but on my own It’s all a bit of trial and error. All the router settings are correct and the firewall for the software is off. If you think you know where I’m going wrong please let me know.
Best Regards
Pete
April 29th, 2008at 7:46 am
Right OK,
This might make things easier, head on over to http://www.dyndns.org and download and install the updater client. Set up an account with them and follow the instructions they give and then set the image on the site to point to that domain from dyndns.org.
Once you have set that up and you still can’t see the camera there are two conclusions you can come to.
1) Your ISP may be blocking any servers from running on your connnection.
2) Your router configuration still isn’t correct!
Good luck with it
May 30th, 2008at 1:10 pm
Thanks so much for this info. Nice to know it’s within the realms of possibilty for my site!
May 31st, 2008at 6:08 pm
No problem! Thanks for letting me know you liked it. I wish more people would
June 13th, 2008at 6:58 pm
Hi Adcuz
Sorry for not getting back to you sooner. I did eventually manage to get my webcam up and running using comcam and ftp at 30 second intervals. At the moment I’m back in the uk and have had to leave an old computer running with a different camera to the one I’ve been using. The camera at the moment is an old logitech and the picture isn’t brilliant. When I get back on Monday, I’ll put my philips cam back on which has a superb picture. Just wanted to say a big thank you for all your help, it was very much appreciated.
Best Regards
Peter
August 6th, 2008at 4:22 am
If you want to see many streaming webcams:
http://www.abcwebcam.com/