We have moved at community.getvera.com

Author Topic: Using a USB webcam with Vera  (Read 19097 times)

Offline garrettwp

  • Master Member
  • *******
  • Posts: 6371
  • Karma: +227/-128
  • Vera 3, Lite, ISY994
Re: Using a USB webcam with Vera
« Reply #15 on: June 06, 2012, 04:56:05 am »
Received mine yesterday. Going to mess with it later on this week. Tried running xmbc on it, but having install issues (sd card timeouts).

- Garrett

Offline HouseBot

  • Full Member
  • ***
  • Posts: 210
  • Karma: +1/-1
Re: Using a USB webcam with Vera
« Reply #16 on: August 01, 2012, 03:56:13 am »
This http://www.raspbmc.com is what I installed.
I have not "integrated" it with the Vera (yet)

Offline strangely

  • Beta Testers
  • Master Member
  • *****
  • Posts: 3722
  • Karma: +34/-2
  • Vera 1,3 & V light
Re: Using a USB webcam with Vera
« Reply #17 on: August 01, 2012, 06:51:26 pm »
This http://www.raspbmc.com is what I installed.
I have not "integrated" it with the Vera (yet)
This is also what I installed on mine; I had various issues with other builds also due to SC card issues.

Roll on RC4!
Kwickset locks, HA01C, HA14C, HA02C, HA03C, HA05C, HA04C, HA07C, HA09C, Aeon HEM, GE 45604, 45606, 45609, ZDP100, VRF01-1LZ, WDTC-20, HA18WD, WDHA-12R, HRDS1, HM-TS001, AC1-ZW, TV-IP110, BL-C210A, LUUP control- EtherRain8, DSC Alarm, HDMI matrix, HR24-200, Panasonic TV, SQblaster

Offline radarengineer

  • Sr. Member
  • ****
  • Posts: 402
  • Karma: +4/-0
Re: Using a USB webcam with Vera
« Reply #18 on: August 11, 2012, 03:49:24 pm »
My Raspberry Pi was ordered just over a month ago and supposedly I'll have it in another two months. A friend of mine ordered one two weeks ago and he already has his.  ???

In the interim I wanted to chip in with some experiences I have using USB webcams with Vera. I attached mine to Pogoplugs running Archlinux ARM. That distro is available for the Raspberry Pi and I've been very happy with it on my Pogoplugs. You should be able to support streaming quite a few webcams on your Raspberry Pi, I have as many as four hanging off my Pogoplugs.

A few recommendations I have for streaming USB webcams with linux:

1. Unless you need the capabilities of motion (that is, you are using the motion detection built in to motion) use mjpg_streamer instead of motion.
Motion processes each image to see if pixels have changed, and by default runs a lot of binary morphology on the images (erode, dilate, etc), where mjpg_streamer just streams. On my Pogoplus with four cameras this means the difference between 60%+ cpu utilization versus single digits (and to get down to 60% I had to drop the framerate to 2Hz and go through a bunch of options to turn off as much processing as possible). I have another machine running zoneminder which processes my streams which is why I don't mind forgoing motion detection.

2. Use MJPEG instead of YUV
If you want multiple webcams on a single USB bus this is basically a necessity. Even if you don't it means a lot less data to process. This is the default in mjpg_streamer, in motion set: "v4l2_palette 2" in motion.conf

3. Get a webcam with known support
Some webcams have a problem where the request a lot more bandwidth than they need and this means you can't use two at the same time. There is a hack to get around this in YUV mode, but not MJPEG which isn't much of a help. If you are up for hacking the driver yourself it should be possible to skip the BW check and make these work anyway, but that is quite a bit of work.

Cameras that work simultaneously (no bandwidth bug):
-Logitech C120
-Logitech C160
-Logitech B500
-Logitech Quickcam E 3500
-Logitech Quickcam Messenger
-Microsoft HD-3000
-Microsoft HD-5000
-Rocketfish HD Webcam Pro

Cameras that do not work in multiples (bandwidth bug?):
-Logitech C110
-Logitech C310
-Creative Live! Cam Video IM Ultra
-HP 2-Megapixel Webcam (RZ406AA)

My current recommendation is probably the HD-3000. It is 720p and can be found for about $20. It does NOT have autofocus which I think is good for a webcam you leave running 24/7. I tried the HD-5000 and it spends a lot of time refocusing. I'm afraid it would break after a few weeks. The C160 is currently the cheapest, about $8 shipped on ebay. Meritline sometimes sells it for $6. The irritating thing about the c120/c160 is that they have a focusing ring you have to adjust. For a security camera I would prefer fixed focus. I buy any webcam I can get at a firesale so I'll keep trying more - I would appreciate results from anyone else as well.

EDIT: Added a few more cameras
« Last Edit: August 24, 2012, 04:23:47 pm by radarengineer »

Offline radarengineer

  • Sr. Member
  • ****
  • Posts: 402
  • Karma: +4/-0
Re: Using a USB webcam with Vera
« Reply #19 on: August 18, 2012, 02:02:18 pm »
It turns out you can disable autofocus on UVC supported webcams like this:

v4l2-ctl --verbose --set-ctrl=focus_auto=0

At least it works for me on all the AF cameras I have to test (Microsoft & Rocketfish).

Not only is this a good idea for camera longevity (I would think so at least) it helps prevents false motion alarms.

Offline HouseBot

  • Full Member
  • ***
  • Posts: 210
  • Karma: +1/-1
Re: Using a USB webcam with Vera
« Reply #20 on: September 22, 2012, 01:43:28 pm »
How do I configure motion or mjpg_streamer so it's supported by Vera?

In motion I have used the /lastsnap.jpg but it seems to not be supported, except when in the phase where you configure the standard ip camera in Vera. After that vera don't seem to recognize any video stream.
Any hints would be very useful...
« Last Edit: September 23, 2012, 06:38:02 am by HouseBot »

Offline radarengineer

  • Sr. Member
  • ****
  • Posts: 402
  • Karma: +4/-0
Re: Using a USB webcam with Vera
« Reply #21 on: September 23, 2012, 01:42:15 pm »
@HouseBot, are you able to see the stream correctly in your web browser? I have not had much luck with motion's mjpg stream on Vera, just static images. I think mjpg_streamer worked for me.

I actually have a slightly more confusing setup, I run zoneminder on a virtual machine and that monitors my mjpg_streamer cameras. I then point Vera at zoneminder. I'll try to do a test were I have Vera stream directly from mjpg_streamer and see what settings work, but it might be a few days. I'm redoing quite a bit of my home network so they are all currently offline.

Offline HouseBot

  • Full Member
  • ***
  • Posts: 210
  • Karma: +1/-1
Re: Using a USB webcam with Vera
« Reply #22 on: September 23, 2012, 03:18:44 pm »
@HouseBot, are you able to see the stream correctly in your web browser? I have not had much luck with motion's mjpg stream on Vera, just static images. I think mjpg_streamer worked for me.

Maybe definition question if last snap is really a stream or not. But I don't know which of the outputs from motion that is supported.
But there seems to be some development still needed on the raspberry pie or the drivers since as soon as I bump up the quality it crashes. I know there is several supported USB cameras but unfortunately, for me, I did not have any of them around.
« Last Edit: September 24, 2012, 08:09:56 am by HouseBot »

Offline radarengineer

  • Sr. Member
  • ****
  • Posts: 402
  • Karma: +4/-0
Re: Using a USB webcam with Vera
« Reply #23 on: September 24, 2012, 10:13:05 am »
@HouseBot, lastsnap.jpg is not a stream. It is just a still frame capture. Does that help?

Offline HouseBot

  • Full Member
  • ***
  • Posts: 210
  • Karma: +1/-1
Re: Using a USB webcam with Vera
« Reply #24 on: September 25, 2012, 03:45:44 am »
@radarengineer, but how to configure motion so it produces the correct stream for vera?

Offline HouseBot

  • Full Member
  • ***
  • Posts: 210
  • Karma: +1/-1
Re: Using a USB webcam with Vera
« Reply #25 on: September 26, 2012, 05:29:18 am »
I installed the webcam v4l-conf that reliable works on the Raspberry Pi with my cameras.  ;D
And now I also got it successfully added to Vera  8)
The final step was to add the this to the URL field webcam.jpg?Quality=Standard on the Panasonic IP camera plug in. I have not tested the general IP camera plug in yet.




« Last Edit: September 26, 2012, 02:16:42 pm by HouseBot »

Offline rearden

  • Sr. Newbie
  • *
  • Posts: 48
  • Karma: +0/-0
Re: Using a USB webcam with Vera
« Reply #26 on: November 19, 2012, 01:23:38 pm »
Does anyone have a howto on getting a usb camera working on a vera lite? 

I have a couple laying around I would like to put into use without having to waste the electricity of turning on another computer.

I think this would be a nice additional selling point for the vera if it were to be enabled by default in the software.  An inexpensive webcam will additionally turn your vera into a motion sensing ipcam.

rearden

Offline HouseBot

  • Full Member
  • ***
  • Posts: 210
  • Karma: +1/-1
Re: Using a USB webcam with Vera
« Reply #27 on: November 21, 2012, 01:33:15 pm »
I'm not sure if Vera can power a USB cam or if there is drivers around. Would be nice if it worked. Rasp Pi required a powered USB hub to do it.

Offline radarengineer

  • Sr. Member
  • ****
  • Posts: 402
  • Karma: +4/-0
Re: Using a USB webcam with Vera
« Reply #28 on: November 25, 2012, 10:41:45 pm »
@rearden, Using a webcam off the vera directly is probably a bad idea, I'm not sure Vera has enough spare cycles available. For some reason people really hate the idea of using a separate device / computer but it makes configuration a lot easier and you don't have to worry about slowing down / breaking your Vera.

The Pogoplus classics I use to run my webcams draw 4 watts of power. This weekend they were selling for $13 shipped from buy.com. They are regularly selling for less than $20 with shipping. Raspberry Pis should also work well.


Offline coachclass

  • Newbie
  • *
  • Posts: 13
  • Karma: +0/-0
Re: Using a USB webcam with Vera
« Reply #29 on: February 26, 2013, 05:53:15 pm »
In the interim I wanted to chip in with some experiences I have using USB webcams with Vera. I attached mine to Pogoplugs running Archlinux ARM.

radar, do you have a guide somewhere on how to install mjpg_streamer on the pogoplug?

I have the same setup:  Pogoplug v2, installed with ArchLinux.  I'd like to use it as a dog webcam, but using a Logitech C310, I have't had any luck with it.

I'm not used to Linux, so I just managed to install Linux by following the detail guides.  But all the google results I've been able to find about mjpg_streamer seems to assume you know what what you're doing.

I have mjpg_streamer installed, and depending on the run command it runs, but I don't know where it's putting the images.  I'm not even sure if mjpg_streamer simply puts the image into a user specified directory, or if it has a webserver built in that allow you to serve the image too?

I've tried starting the program several ways...I forget which method at least turns on the LED on the webcam.

Quote
/usr/bin/mjpg_streamer  -i "input_uvc.so -d /dev/video0 -f 1 -r 960x720"\
-o "output_http.so -p 80 -w /mnt/back1/webstreamer"\
-b

Quote
/usr/bin/mjpg_streamer -i "input_uvc.so -d /dev/video0 -y" -o "output_http.so -p 8080 -w /mnt/back1/webstreamer"

The /mnt/back1/webstreamer folder is a folder on a USB drive where I want it to put the images, although I'd much rather webstreame put the images in RAM rather than the flash drive, I just don't know how to do that.

Thanks for any hints!