muelli
Posts: 56
Joined: Sat Jul 21, 2012 12:16 pm

video surveillance (USB webcam, IP cam...) enough power?

Sat Jul 21, 2012 12:20 pm

Hi everybody,

I want to implement a surveillance application at a remote site with solar power.
As surveillance IP cams are quite expensive, does the raspberry pi have enough cpu power to do the motion detection using usb webcams (one or more, maybe via usb hub)?
I browsed the wiki and there seem to be some supported usb webcams that might work with "motion" (http://www.lavrsen.dk/foswiki/bin/view/Motion/WebHome).

Does anyone have information on this or even wants to try it with a webcam or two?

thanks!
Stefan

User avatar
alexeames
Forum Moderator
Forum Moderator
Posts: 2807
Joined: Sat Mar 03, 2012 11:57 am
Location: UK
Contact: Website

Re: video surveillance (USB webcam, IP cam...) enough power?

Sat Jul 21, 2012 1:00 pm

There's a thread somewhere in projects about this subject. Although I don't think anyone's got it done yet. I'll see if I can find the thread. I used to follow it before the forum move. :D

This was the thread,
http://www.raspberrypi.org/phpBB3/viewt ... =41&t=2380
but it doesn't seem to have gone anywhere since people actually received their Pi's.
I've very little doubt that once the official camera package - utilising the GPU is released, we'll see a raft of threads about this, but until then, we're limited to what the ARM can do.
Alex Eames RasPi.TV, RasP.iO

muelli
Posts: 56
Joined: Sat Jul 21, 2012 12:16 pm

Re: video surveillance (USB webcam, IP cam...) enough power?

Sat Jul 21, 2012 2:27 pm

thanks for the info!

SirLagz
Posts: 1705
Joined: Mon Feb 20, 2012 8:53 am
Location: Perth, Australia
Contact: Website

Re: video surveillance (USB webcam, IP cam...) enough power?

Sat Jul 21, 2012 2:31 pm

The Pi easily has enough power to stream a webcam...Though I haven't tried motion yet, it is on my list of things to try out.
I used ffmpeg to stream to my mobile as I was using the Pi as a babycam for a little while.
My Blog - http://www.sirlagz.net
Visit my blog for Tips, Tricks, Guides and More !
WiFi Issues ? Have a look at this post ! http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=44044

User avatar
mikerr
Posts: 2454
Joined: Thu Jan 12, 2012 12:46 pm
Location: Up north , UK
Contact: Website

Re: video surveillance (USB webcam, IP cam...) enough power?

Sat Jul 21, 2012 2:55 pm

Yep, I have one of my Pies dedicated to motion running on debian wheezy, saving pictures when it sees movement,
running on a logitech pro 9000 webcam directly powered from the Pi's USB socket.

see here:
http://www.raspberrypi.org/phpBB3/viewt ... 78#p115578

Most of the time was spent fiddling with motion's config file
Android app - Raspi Card Imager - download and image SD cards - No PC required !

tekmanro
Posts: 14
Joined: Tue Jul 17, 2012 9:57 pm

Re: video surveillance (USB webcam, IP cam...) enough power?

Tue Jul 24, 2012 11:34 pm

For streaming, what resolution are you getting (does it do 720p 30fps, or is it more like 640x480 10fps), and what codec are you using (H264, Mpeg4, or something more mundane like MJPEG)?

Thanks!

SirLagz
Posts: 1705
Joined: Mon Feb 20, 2012 8:53 am
Location: Perth, Australia
Contact: Website

Re: video surveillance (USB webcam, IP cam...) enough power?

Wed Jul 25, 2012 1:46 am

MJPEG, 320x240 at 10 fps I think it was.
My Blog - http://www.sirlagz.net
Visit my blog for Tips, Tricks, Guides and More !
WiFi Issues ? Have a look at this post ! http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=44044

SoftSpot
Posts: 3
Joined: Wed Jul 25, 2012 11:29 pm

Re: video surveillance (USB webcam, IP cam...) enough power?

Wed Jul 25, 2012 11:38 pm

I have just received my Pi, and plan to use it as a surveillance-computer with 2 IP-camera's. Intention is to have 2 small IPcamera's connected to the Pi through Powerline-network modules, and using zoneminder to monitor the 2 cams. (according to docs I found so far that program is included in the Debian-package for the Pi?) Both cams operate at VGA-resolution (640x480).
If it all turns out fine a 3rd camera may be added to the system as well.
I will report on how things turn out, but don't push me for I am a newbie when it comes to Linux.

User avatar
AndrewS
Posts: 3625
Joined: Sun Apr 22, 2012 4:50 pm
Location: Cambridge, UK
Contact: Website

Re: video surveillance (USB webcam, IP cam...) enough power?

Thu Jul 26, 2012 11:32 am

This sounds quite similar to the EyesPI project by London Zoo that was talked about at the recent Cambridge Raspberry Jam https://docs.google.com/presentation/pu ... ide=id.p13

But I think they were using PIR-type sensors (like you get on security-lights) to trigger photos, rather than watching the webcam stream for "changes".

There's quite a few topics discussing the "motion" package: http://www.raspberrypi.org/phpBB3/searc ... rds=motion

Shdwdrgn
Posts: 9
Joined: Sun Jul 29, 2012 3:13 am

Re: video surveillance (USB webcam, IP cam...) enough power?

Thu Aug 02, 2012 4:52 am

Has anyone gotten 'motion' to work with more than one camera on the pi? I have my thread files set up for two cameras, running at a minimal 320x240 @ 2fps, but every time I run motion, one camera or the other will fail with the following:

[2] Error selecting input 0 VIDIOC_S_INPUT: Device or resource busy

Since I seem to have no trouble running a single cameras at 320x240 @ 30fps, I would have to assume there is plenty of USB bandwidth to handle two cameras running at the much lower speed? Any suggestions would be appreciated.

kermitas
Posts: 108
Joined: Thu Jan 26, 2012 11:49 am

Re: video surveillance (USB webcam, IP cam...) enough power?

Sat Aug 11, 2012 4:20 pm

I am working on my security system for few weeks (I have build a NAS based on rpi and I am working to get cams work stable with rpi, Picasa photos are somewhere on this forum).

'Motion' eats all CPU (I prefer resolutions like 1280x720, not less). After week or tow I decided to disable motion detection and simply capture one frame per second. That works better, it was good decision. If you can handle ~200kb jpg files created every second (from one camera) I would suggest this way for you.

Now I am experimenting with v4l4j and spekaing with Gilles (the creator) at v4l4j google group. Using this library inside my java program I can get 1920x1080 @ 1 fps / 2 fps (MJPEG to JPEG files) and CPU usage is ... 12% - 15% !! :D :D

So if there is so much free power on CPU next week I am planning to do tests with two webcams.

Thanks,
Arthur.

SoftSpot
Posts: 3
Joined: Wed Jul 25, 2012 11:29 pm

Re: video surveillance (USB webcam, IP cam...) enough power?

Mon Aug 13, 2012 12:49 pm

Well, my Raspberry has arrived, and as promised my first results.

Getting the Pi running was not much of a problem, it is fairly straightforward, and with some old knowledge of MS-DOS commandline way back in the past it was not completely "running in the dark" for me. :)
The videosources I want to use (and which I have installed) are 2 IP-cam's, so to start with I thought it could be easy to start with trying to reach those cams through a browser. And indeed, after building up a stand-alone network with the pi and one cam (Apexis APM-J011-WS) and configuring the pi wirth the ifconfig-command I could ping the camera.
Starting the standard Midoribrowser and choosing a "non-active-x browser" gave me the full camera-controlpanel but no video-overlay.
Starting the Midoribrowser and choosing for "mobile viewing" gave me a video-overlay of 320*240 which is, on a fullscale HDMI-televisionset, a very uncomfortable small picture. But the mobile view has no setup-facilities to upscale the video so... open a second browserwindow with the controlpanel allowed me to reselect a videosettings of 640*480, which had effect on the "mobile"window as well. Then I closed the "settings"browser to reduce cpu load, for that went up to ... very high...

Aftr some time the pi started to react very sluggish, and the cpu became really hot... the loadindicator on the taskbar showed that the cpu was constantly fully loaded, which is not really healthy, so I closed the last browserwindow as well, which immediately gave a dramatic decrease in cpuload.
First conclusion: the pi is not really equipped to handle streaming video. Maybe I can do something with reducing the framerate but I fear that, when I try to add the second camera, this tiny boy will appear to be just a bit too small to do what I had in mind...
But then.... who still believes in miracles?

kermitas
Posts: 108
Joined: Thu Jan 26, 2012 11:49 am

Re: video surveillance (USB webcam, IP cam...) enough power?

Thu Aug 16, 2012 12:39 am

SoftSpot wrote:First conclusion: the pi is not really equipped to handle streaming video. Maybe I can do something with reducing the framerate but I fear that, when I try to add the second camera, this tiny boy will appear to be just a bit too small to do what I had in mind...
But then.... who still believes in miracles?
I can confirm that rpi can be used as "frame grabber" for usb webcam.
I can get capture up to 4 fps using 1280x720.

FrozenFirestorm
Posts: 8
Joined: Mon Mar 05, 2012 9:49 am

Re: video surveillance (USB webcam, IP cam...) enough power?

Thu Aug 16, 2012 7:51 pm

Hey ok so motion works with the pi? i streamed my video feed, 360x240 at 1fps, and i have a delay between 3 to 14 seconds!!!! its a bit insane!! my cpu usage is like 7% or so, and if i use iftop to see the data rate that im transmitting its like 7kB/s. The video feed is not at all usable at the moment for the robot om controlling! im switching up my sd card from class 4 to 10, and going to test other webcams. using Logitech C160 at the moment. motion detection and saving of images have been turned off. im still wondering where the problem could be with the feed? its way to slow!! could it be that usb drivers are struggling with data rate? Running Raspbian. :) any ideas?

kermitas
Posts: 108
Joined: Thu Jan 26, 2012 11:49 am

Re: video surveillance (USB webcam, IP cam...) enough power?

Thu Aug 16, 2012 7:56 pm

FrozenFirestorm wrote:Hey ok so motion works with the pi? i streamed my video feed, 360x240 at 1fps, and i have a delay between 3 to 14 seconds!!!! its a bit insane!! my cpu usage is like 7% or so, and if i use iftop to see the data rate that im transmitting its like 7kB/s. The video feed is not at all usable at the moment for the robot om controlling! im switching up my sd card from class 4 to 10, and going to test other webcams. using Logitech C160 at the moment. motion detection and saving of images have been turned off. im still wondering where the problem could be with the feed? its way to slow!! could it be that usb drivers are struggling with data rate? Running Raspbian. :) any ideas?
I don't know how much you are familiar with usb problems... this is my today post http://www.raspberrypi.org/phpBB3/viewt ... 93#p151493 but you should read this thread from the beginning.

deliveryman
Posts: 1
Joined: Sun Nov 10, 2013 1:37 pm

Re: video surveillance (USB webcam, IP cam...) enough power?

Sun Nov 10, 2013 3:39 pm

Hi all,

video surveillance using RPI(wheezy)/motion/USB-cam is exactly what I'm currently working on as well!

But my approach and the direction I come from may be a bit different...
A while ago I've tried a WiFi attached cam (1280x720) with motorised pan/tilt - was about 140EUR.
It lasted a mere week and I brought it back - was lame (picture quality was below standards, the need to use ActiveX for activation/configuration and use was out of question, the reaction time of my wife's flowers in the sun was faster - all in all complete BS).

Then I stumbled over RPI - and had known a bit about motion before - and thought: hey - a RPI, a web cam and a bit of slim Linux is always faster and less expensive than the BS I tried before! ...

My need for surveillance lies in watching over our property, rather my wife's roadster and my bike standing in the driveway.
We've had issues of people trying to steal the bike navigation system (failed - left it behind because of a SW pin lock - LOL) and somebody letting the air out of the tires on one of the cars...


That means I'm looking for motion detection ("motion" does that very well!), clear crisp pictures - preferably wide-angled (no mushy video streams), infrared (IR) sensitivity and the possibility to configure and harden the setup to my personal gusto.

My current setup is a RPI running on a current stable wheezy with "motion", a Logitech C270 (IR modded)* @1280x720 and a USB WiFi plug for WPA2 communication within our home network.
I've played with the motion stream opt @2fps, but deactivated it again - jumpy frames and high network/CPU loads opted that out for me (not sure about the bottleneck - I believe network related).
I configured motion to provide a "lastsnap" every second (overwrite mode) and to capture images @2fps only if movement is detected.
I can definitly confirm that "motion" hogs 100% CPU!
It seems to make no difference how heavy I load the config with activated opts - but I have no clear proof from testing yet...

IR modded)*
The C270 (Logitech) is a cheap cam (19EUR) - but as well easy to open and manipulate: I've opened it and removed the IR filter to enable the near IR sensitivity.
It works - more or less. Given you have flooded the area with IR light (850-940nm) it will produce an adequatly clear image - enough to make out a face within 3-5 yards.
The light sensitivity in general is poor - images are fuzzy, dark and there is a lot of noise (I presume heat from hot pixels).
The problem is the focus - the very short lense system (fix focus) is made and set for visible (day) light and not for the added wavelength of near IR.
That means either daylight images are halfway sharp with a slight fringe (due to the removed IR filter) or IR night images are sharp - thus rendering the daylight images a bit mushy. That is using the stock lense as is.
Another problem with this cam is the USB device access on SW restart - when I restart the motion service the image access fails.
When I replug the USB the image access fails.
Only a reboot cures the problem (strange enough the cam can remain plugged under power in the USB hub).
Any ideas on this one?

The box says it supports 1280x720 (HD 720p), yet under Linux 1280×960 are possible. I have not explored that further due to slight stability issues right from the start (cam quit on me during 1280×960 stream - 1280×720 was stable though).

The other problem is the missing "wideangledness" needed for typical surveillance. (it's a web cam for video chat - duh)
I might invest some time to mod another (they were so cheap I bought two more - LOL) - I want to try to put a proper wide angle glass lense to it and see if focus and view angle change positivly...

Currently my goal is to stick with the RPI, but maybe change the USB cam to one with a better quality.
I want to mount the camera (and maybe even the RPI itself) in a DIY aluminum case (with acrylic window and weather proofing) outside on the house wall (elevated and out of normal reach). I want to include high powered wide angle IR LEDs for night vision.
I will be using the mask option (already gaining positive experience in tests - easy to configure!) to NOT capture unwanted street movement - thus generating unneeded image data.

If I can't solve the wide angle issue I'll resort to one of two approaches:
Either use two "good" cams on one RPI (not load tested yet - any experience out there?) or mount the cam reverse, looking into a wide angled mirror and then reversing the image in "motion".

Hope this helpes somebody.
I'll be glad to share further details if requested!

And I'm happy about any feedback concerning a cam with a good lense that will allow removal of the IR filter for near IR night vision?!?
Anybody got a good IR LED light source running yet?

May the PI be with you ;)

dman

Torna
Posts: 40
Joined: Thu Nov 24, 2011 8:59 pm

Re: video surveillance (USB webcam, IP cam...) enough power?

Mon Feb 10, 2014 2:07 pm

I think using Motion for a home video surveillance system is not the best option :/

Here is a complete implementation of the home video surveillance system using multiple Raspberry Pi cameras : http://www.magdiblog.fr/domotique/syste ... pberry-pi/

Torna
Posts: 40
Joined: Thu Nov 24, 2011 8:59 pm

Re: video surveillance (USB webcam, IP cam...) enough power?

Mon Feb 10, 2014 2:08 pm

deliveryman wrote: And I'm happy about any feedback concerning a cam with a good lense that will allow removal of the IR filter for near IR night vision?!?
Anybody got a good IR LED light source running yet?

May the PI be with you ;)

dman
I'm using an IR projector that works perfectly with the Pi Camera NoIR : http://www.selectronic.fr/projecteur-in ... e-50m.html

More info here : http://www.magdiblog.fr/domotique/syste ... pberry-pi/

Return to “General discussion”

Who is online

Users browsing this forum: 6by9 and 62 guests