Dubhghaill
Posts: 2
Joined: Fri Oct 11, 2013 12:09 pm

Raspberry Pi and Motion

Fri Oct 11, 2013 12:19 pm

I'm using a Raspberry Pi for motion using an old HP webcam that I had lying around. I use it as a cheap security camera that keeps an eye on my front garden.

It has some issues, and I'm not sure if they are related to the processing power of the Pi.

Top says this:

Code: Select all

  PID USER      PR  NI  VIRT  RES  SHR S  %CPU %MEM    TIME+  COMMAND
14374 motion    20   0 99492  39m  10m S  95.4 21.6   4981:13 motion
One issue is the framerate is normally quite bad. It captures an AVI file, but it's very juddery. So if someone walks past sometimes it misses them entirely. I've tried lowering the frame size, but it makes no difference if it's 300px or 1280px.

Secondly the picture becomes corrupt quite often. This obviously makes motion thing something is happening on the camera and it starts capturing.

The server rsyncs the generated AVI files to another more powerful linux machine which extracts the frames and creates a gif. Here's an example of one that has been generated:
Image

So, maybe I should get something more powerful for this job and use this Pi for something else. Or maybe there's something I can do to improve this?

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

Re: Raspberry Pi and Motion

Fri Oct 11, 2013 12:57 pm

You could try overclocking the Pi.
Do you know if the HP webcam can output mjpeg frames ? if it can, then it will save a lot of cpu cycles.
If it can't then get a cheap webcam that can, and try again
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

Dubhghaill
Posts: 2
Joined: Fri Oct 11, 2013 12:09 pm

Re: Raspberry Pi and Motion

Fri Oct 11, 2013 1:31 pm

It was indeed using YUYV, so I changed it to MJPEG.

It's still using the same amount of CPU, but the output is much smoother.

Thanks for your help!

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

Re: Raspberry Pi and Motion

Fri Oct 11, 2013 3:19 pm

No problems :)
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

Return to “General discussion”