DIY Home Surveillance

nsaspook

Joined Aug 27, 2009
13,273
My card was a cheap 8 chip clone that's no longer available. http://board.homeseer.com/showthread.php?t=144562
Some of the latest models are like these:
http://www.camsecure.co.uk/Camsecure3/BT878_Capture_Cards_Windows_and_Linux.html
http://store.bluecherry.net/capture-cards
You might be able to find cheap multi-port cards on ebay. http://www.ebay.com/itm/CONEXANT-87...521?pt=LH_DefaultDomain_0&hash=item2c959db069
(this has less chips than channels so it multiplexes the other input channels)

IPcams with POE would be my choice today if I had to design a new system from scratch.
 

Thread Starter

Brownout

Joined Jan 10, 2012
2,390
I've ordered a wireless IP cam but will install it near an outlet. The rest of my cams will be webcams powered from USB.
 

strantor

Joined Oct 3, 2010
6,798
I've ordered a wireless IP cam but will install it near an outlet. The rest of my cams will be webcams powered from USB.
I've also ordered one. Getting into this thread of yours and talking about it spurred me to action. I want to get away from the 10/100Mbit wifi bandwith bottleneck, so I want to go with gigabit wired connections where possible. There's no wireless power, so wherever I put a camera, there's going to have be a wire of some kind going to it, whether that's a data cable or a power cable, or both. So I'm going with Power Over Ethernet everywhere I'm going with hardwired gigabit. I bought this 8 port gigabit POE network switch (4 powered ports, 4 unpowered) for $80, and this 720P non-PTZ POE IP camera for $70. I set up the web server on my Synology NAS and modified the zone files on a spare godaddy domain I had (a website I had purchased for my wife's business, which never took off) to point to my home server and I'm currently successfully broadcasting a feed from this new cam to the WWW using the VLC plugin. Here's the code I'm using for the VLC plugin:
(insert into HTML doc):
Code:
<OBJECT classid="clsid:9BE31822-FDAD-461B-AD51-BE1D1C159921"
     codebase="http://downloads.videolan.org/pub/videolan/vlc/latest/win32/axvlc.cab"
     width="640" height="480" id="vlc" events="True">
   <param name="Src" value="rtsp://192.168.2.14:554/camera.sdp" />
   <param name="ShowDisplay" value="True" />
   <param name="AutoLoop" value="False" />
   <param name="AutoPlay" value="True" />
   <embed id="vlcEmb"  type="application/x-google-vlc-plugin" version="VideoLAN.VLCPlugin.2" autoplay="yes" loop="no" width="640" height="480"
     target="rtsp://192.168.2.14:554/camera.sdp" ></embed>
</OBJECT>
This plugin doesn't work for Android so I can't see my cam on my tablet. Still looking for a better solution.
 

Thread Starter

Brownout

Joined Jan 10, 2012
2,390
Strantor,

I haven't tried it yet, but you can download a VLC player for Andriod. The win32 player you linked won't work, I'm pretty sure.
 

strantor

Joined Oct 3, 2010
6,798
Thanks. The win32 VLC player works on my end but that's it. My brother wasn't able to see the feed either. I also tested it by using my phone as a 4g hotspot and couldn't see the feed. I got excited and thought it was working on the WWW but it isn't. I guess the local IP address I put in the code doesn't mean anything to your computer if you're not in my network. But I'm betting that if I connect to my VPN I will be able to see it. Having to connect to a VPN to see a stream ordinarily wouldn't be a satisfactory solution, but in my case I don't care. I'm not trying to share my feed with the world, just trying to see what's going on at home while I'm out. The not-working-unless-you're-on-my-VPN aspect coincidentally seems to add a layer of security, which is a good thing. Now I just need to find a solution that works on android.
 

strantor

Joined Oct 3, 2010
6,798
Strantor,

I haven't tried it yet, but you can download a VLC player for Andriod. The win32 player you linked won't work, I'm pretty sure.
Yes I downloaded the android VLC player and played with it for a minute. It seemed to be more of a file player. I did not see the option to connect with a stream. There may be an option for it but I did not give enough effort to find it because I am not really interested in using the player app; I am only interested in the activex plugin that I hoped would be included. My efforts were focused on that, and I verified that the android vlc player does not come with the plugin like the windows vlc player does. I am only interested in developing my own web based home automation & surveillance app.
 

Thread Starter

Brownout

Joined Jan 10, 2012
2,390
I guess the local IP address I put in the code doesn't mean anything to your computer if you're not in my network.
I have the same issue. I have to use a different IP address if I'm viewing on my private network vs viewing form a remote location. I made two different webpages, each with the appropriate IP address. I forwarded ports 80 (HTTP) and 8080 (My video stream) to the server, and opened those ports on the server's firewall. I was able to view the video on the www.

But I'm betting that if I connect to my VPN I will be able to see it. Having to connect to a VPN to see a stream ordinarily wouldn't be a satisfactory solution, but in my case I don't care. I'm not trying to share my feed with the world, just trying to see what's going on at home while I'm out. The not-working-unless-you're-on-my-VPN aspect coincidentally seems to add a layer of security, which is a good thing. Now I just need to find a solution that works on android.
Another option would be to password protect starting your stream. I'll do that and not fool with VPN.
 

strantor

Joined Oct 3, 2010
6,798
I have the same issue. I have to use a different IP address if I'm viewing on my private network vs viewing form a remote location. I made two different webpages, each with the appropriate IP address. I forwarded ports 80 (HTTP) and 8080 (My video stream) to the server, and opened those ports on the server's firewall. I was able to view the video on the www.
Good idea. I'll give that a shot. Thanks.

IAnother option would be to password protect starting your stream. I'll do that and not fool with VPN.
The vpn offers other benefits though. I did not set up the vpn just to facilitate these cameras. I had it setup already to remotely access files on my nas through windows explorer, and connect to my computers and devices on my network. I can sit at work and listen to my music collection without having to take up space on my work PC with personal music files. I can also do mischievous things like tamper with my surround sound while the kids are watching tv and turn lights on/off.
 

Thread Starter

Brownout

Joined Jan 10, 2012
2,390
The Foscom camera arrived yesterday. I spent most of the day trying to get it to work. First, the client program provided on the CD ain't worth a damn. It just doesn't do anything useful, and doesn't appear to connect to the camera. Fortunately, its not needed. To view and control the camera, ActiveX controls are downloaded from the server that provides a browser based GUI. However, windows security prevented me from installing then because the publisher wasn't recognized. Apparently, Foscam doesn't bother to certify their software so it works out of the box. After hours of searching the experimenting, I was finally able to use an "unsecure" method of installing the controls. Next, I could not get the camera to connect to my Wi-Fi network. This became another hours long journey of experimentation and searching for answers. I finally solved the issue by using my router's WPS along with that of the camera to get a connection. This despite the fact that I painstakingly set every parameter on the camera to my Wi-Fi's requirements!!! Oh well, its working now, and actually performing beautifully.

I took a trip to Starbuck's to try viewing my setup from a remote location. Here's what I was attempting to do: The Foscam was streaming directly to an external port using RTSP and my webcam was streaming to a web client using HTTP. The Foscam looked pretty good, but the webcam video crashed and burned. It appeared as though the client player just wasn't getting enough P-frames to reliably render the video, and eventually gave up and just froze in a weird ghostly half representation of the actual object being captured. This BTW, worked great when I was at home, using 4G wireless to view the capture over the WWW. The takeaway is the Foscam software and server works great once its successfully running.

My thoughts; it appears the difference was the good stream was encapsulated in RTSP, while the other was using HTTP. RSTP would have a QOS advantage so would be provided with sufficient bandwidth for viewing, while the HTTP stream gets stuck in internet traffic. All is not lost however, all I need to is figure how to stream to VLC using RTSP. Hope that clears everything up. I won't have time to try that for a couple days, so I'll go quiet for now.
 

strantor

Joined Oct 3, 2010
6,798
The Foscom camera arrived yesterday. I spent most of the day trying to get it to work. First, the client program provided on the CD ain't worth a damn. It just doesn't do anything useful, and doesn't appear to connect to the camera. Fortunately, its not needed. To view and control the camera, ActiveX controls are downloaded from the server that provides a browser based GUI. However, windows security prevented me from installing then because the publisher wasn't recognized. Apparently, Foscam doesn't bother to certify their software so it works out of the box. After hours of searching the experimenting, I was finally able to use an "unsecure" method of installing the controls. Next, I could not get the camera to connect to my Wi-Fi network. This became another hours long journey of experimentation and searching for answers. I finally solved the issue by using my router's WPS along with that of the camera to get a connection. This despite the fact that I painstakingly set every parameter on the camera to my Wi-Fi's requirements!!! Oh well, its working now, and actually performing beautifully.
Sorry I didn't mention that. Those lessons learned are far back in my memory and I didn't even think to mention it since my computer has been setup for a long time. Also I didn't see you mention specifically that you got the foscam brand. The cam finder software is bordering on useless, but not entirely useless. You are right about the WPS button. It's the only good way to connect to a foscam. Once you have used the WPS button and connected to the camera, you can login to it and the finder program can find it. Your router must be set up as a DHCP server initially. If you connect the foscam out of the box to the network with no DHCP server, it will sit there for 30 minutes or more with no IP address before it finally defaults to 192.168.1.xx, at which point the finder program can find it. Once you get online with it, it's all good from there. you can set a static IP or whatever else.

The "usecure method" you're referring to; would it be unpacking the plugin and running the browser in developer mode?
My thoughts; it appears the difference was the good stream was encapsulated in RTSP, while the other was using HTTP. RSTP would have a QOS advantage so would be provided with sufficient bandwidth for viewing, while the HTTP stream gets stuck in internet traffic. All is not lost however, all I need to is figure how to stream to VLC using RTSP. Hope that clears everything up. I won't have time to try that for a couple days, so I'll go quiet for now.
The code I posted earlier does exactly that. I haven't tested the RTSP-VLC stream with foscam yet, but it worked for the POE camera. (not sure if you wanted it embedded in a page though; maybe you mean into the local VLC player?)
 

Thread Starter

Brownout

Joined Jan 10, 2012
2,390
Strantor said:
The "usecure method" you're referring to; would it be unpacking the plugin and running the browser in developer mode?
No, it involved turning off all security involved with ActiveX controls in order to install the add on software.

The code I posted earlier does exactly that. I haven't tested the RTSP-VLC stream with foscam yet, but it worked for the POE camera. (not sure if you wanted it embedded in a page though; maybe you mean into the local VLC player?)
I used your code :) It plays RTSP streams. I only need to get the server set up to stream them. I did this once before, just need to remember how I did it.
 

strantor

Joined Oct 3, 2010
6,798
I used your code :) It plays RTSP streams. I only need to get the server set up to stream them. I did this once before, just need to remember how I did it.
I'll be working on that in tandem. But you will probably get it before I do. If not, I'll post my solution.
 

Thread Starter

Brownout

Joined Jan 10, 2012
2,390
I'll be working on that in tandem. But you will probably get it before I do. If not, I'll post my solution.
1) start vlc and chose you input device, click next
2) Chose RSTP for New Destination, click Add
3) Chose port number and stream name ie 8080 /stream, click next
4) check "Activate Transcoding", chose "Video-H264+MP3(MP4) for Profile
5) chick the tools icon, for Encapsulation, chose MPEG-PS (very important!)
6) chose H-264 for video codec, chose fps (I use 5)
7) chose audio bitrate, click save
8) click next, click stream

To view your stream, insert the following in your webpage:

Code:
  <embed type="application/x-vlc-plugin" name="video1" autoplay="yes" \
  loop="no" volume="100" width="640" height="480" \
  target="rtsp://10.0.0.5:8080/stream">
Substitute your IP address for the one shown.

Later, I'll post a line command to do the same thing.
 
Last edited:

Thread Starter

Brownout

Joined Jan 10, 2012
2,390
I'm not sure about #5 above, it seems to work with both MPEG_PS and MPEG-TS selected. Actually, I think the tools ignores the difference. For some reason, I was not able to make it work with -TS at first, but now it seems to work fine.

Also, I made this simple bash shell to set up RTSP streaming automatically:

#!/usr/bin/bsh
vlc v4l2:///dev/video1 --sout '#transcode{vcodec=h264,fps=5,scale=Auto,acodec=mp3,ab=128,channels=2,samplerate=8000}:duplicate{dst=rtp{sdp=rtsp://:8554/rtspstream},dst=display}'
NOTE: No 'newlines' in the above vlc command.
 

tracecom

Joined Apr 16, 2010
3,944
I read through the thread, but it's mostly over my head. What I want to do is exemplified on this web site; I linked to it in case there was any info that might help Brownout, strantor, or anyone else.

I have electricity in the coop, but it's too far from my house to use USB. I am thinking about setting up a dedicated (small) server in the coop and using wi-fi to connect to my wireless ISP. But that small amount of thinking is all that I have done.
 

Thread Starter

Brownout

Joined Jan 10, 2012
2,390
I just tested my webcam with a 30' USB active repeater cable and it work fine. You can use up to ~90' cable segments, and up to six cables for ~540' total length. Of course, that can get expensive. Also, my Foscam wireless IP cam has a server built-in, so if you used something like that, there would be no need for a dedicated server. I don't know the range, however. A wired IP camera might work for 100' or so, I'd have to look up the Ethernet spec.

I have a plan for an inexpensive weatherproof housing for my webcam, and I'll publish the details when I get around to making it.
 
Last edited:

Thread Starter

Brownout

Joined Jan 10, 2012
2,390
I still have the same issue as described in post #29. Although streaming works great in my private network, when I try to stream to a remote location (Starbuck's) the webcam stream doesn't play; instead it sputters. Using RTSP only makes things worse. The issue is streaming high bandwidth video through a non-determinant internet network. Possible solutions are limiting the bps at the server or using an adaptive service, eg. DASH or HLS. To do that, I will need to do some research.

In other news, I have a basic webpage which displays two cameras simultaneously. Here is a picture:

DualCams.JPG

Here is the simple code to do this:
Code:
<h1> DIY Video Surveilance System </h1>

  <table>  

    <tr>  
      <td>
        <embed type="application/x-vlc-plugin" name="video1" autoplay="yes" \
        loop="no" volume="100" width="640" height="480" \
        target="rtsp://10.0.0.8:8554/rtspstream">
      </td>

      <td>
        <embed type="application/x-vlc-plugin" name="video1" autoplay="yes" \
        loop="no" volume="100" width="640" height="480" \
        target="rtsp://username:password@10.0.0.5:88/videoMain">
      </td>
    </tr>

  </table>
</body>
 

strantor

Joined Oct 3, 2010
6,798
Thanks Brownout. I haven't gotten around to trying your solutions. I have been (and still am) very busy. Tracecom, as Brownout mentioned the foscams (and from what I can tell, just about every other IP cam) has an embedded server. No need to put a server out there.
 

Thread Starter

Brownout

Joined Jan 10, 2012
2,390
Strantor, I'm not working right now, so I have the time to try to develop this. Although, I'm scrambling a little so I can have everything in place before I have to leave town again.

Next thing is to try to use my server to control some things in the house, lights and maybe the HVAC system. Looking at various solutions, including X10.

BTW, I can temporarily solve the issue of low bandwidth by simply using VNC to view the video from my server's desktop, which for some reason is able to adjust to the available bandwidth.
 

Thread Starter

Brownout

Joined Jan 10, 2012
2,390
I can finally answer the original question now concerning using multiple webcams for surveillance. The answer is "yes" but with a caveat. Due to limited bandwidth of the USB2.0 bus, only one webcam can be viewed at a time. That's perfectly OK for my purpose though; I can always switch between cameras to get the all the views I need, albeit not simultaneously.
 
Top