Segment from Hak5 1x02: Darren and Wess setup a security camera using a webcam a server and open source software.
Grab video code:
Male 1: Last time on hak.5 we showed you how to control your household lights over the internet. This time we are going to take a step further with the webcam so you can see what is going on your house while you are away.
Male 2: Alright! Are we going to use a normal USB webcam for this?
Male 1: Well, normally we would use one of these inexpensive USB webcams but in this particular scenario, sever and the webcam are going to be pretty far away so we do not want to use USB because there is finite amount of length we can use with extensions and what not, before we get signal loss.
Male 2: Okay. So, what about X10 Wireless?
Male 1: We could go with the X10 but as you probably already know, one they are expensive and two, if you have seen from the shadows or system, they can be easily picked up and the last thing we want, our viewers getting in there turning on and off the lights and checking out the webcam.
Male 2: I have not forbid.
Male 1: So, what we are going to use here is either this antiquated VHS-C Camcorder or one of these Pixera small little webcams and I like this. You can pick up on eBay, pretty cheap and the neatest thing is, composite.
Male 2: Alright. And like your reference before, composite has no definitive length we can run it wherever. Get with the cables whatever length that we need and USB has a finite length to it.
Male 1: Yes, exactly. So, we are going to go with composite here.
Male 2: Okay. And so, assuming we have everything setup and wired, how do we get that on the server?
Male 1: To get into the computer, we are going to need to use a TV tuner or a Capture Card. This card right here will accept a composite-in jack or we could use ATI All-in-one recorder or basically any card that will accept composite-in jack. Windows is going to recognize that as a windows media device and it is going to work the same whether it is a webcam or whether it is a composite camera like this. It does not care. Our script will still use it. The program will still use it.
Male 2: So all in all, this integration is going to be really seamless?
Male 1: Really seamless. So, let us go ahead and set up the hardware and take it to the software.
Male 2: Let us roll.
Male 1: Alright. So, we are back at the lab. Let us check it out. We are using a piece of software here from Sourceforge, it is called Dorgem, and it is going to be our capture device. It is going to basically take the image from the webcam and put it in a folder. You can get this anywhere. They are pretty simple and I just like Dorgem because it is open source.
Male 2: Alright. And open source, it is free?
Male 1: Yes. So, as you can see it here, we set it up for windows media device. We can go preview here and as you can see there we are.
Male 2: Everybody go and look. Hi!
Male 1: Hey camera guy. So, we are going to the capture settings. I am sorry. We are going to the store settings and see I set up a storage setting here. And hold it to the – store the image as hak.5 jpeg in our Apache folder. We have also done some capture settings. These are pretty cool. We have added the ability to put the hak.5 cam on the bottom with their fonts so it will look pretty neat. So, if we go ahead and take that over to the webpage, you can go ahead and see, now there is the latest image. It got a hak.5 cam.
Male 2: SIP set.
Male 1: Right. So, let us go ahead and check out the code.
Male 2: Alright.
Male 1: Basically, this is the same PHP code that we used before. We have added just a little bit of html. And we got this http-equiv=“refresh” content=“15” seconds. What that is basically saying is every 15 seconds refresh the page.
Male 2: Okay. Now, it is http-equiv=“expires” content=“0”.
Male 1: What that is basically saying is do not cache the image. So, if you are to refresh the page and your browser was caching it, you will get the same image over and over.
Male 2: Yes. And it just has to be cookies?
Male 1: Well, it is not really about the cookies. What it is doing is telling it not to cache that image. So, when you refresh, you get the new one every tim