User avatar
cowpat
Posts: 90
Joined: Sat Apr 14, 2012 12:13 pm
Location: London
Contact: Website

Motion

Wed May 30, 2012 12:30 pm

I've been fiddling about with motion using the archlinux SD image and a microsoft lifecam cinema.

The only changes being; 224/32 arm/gpu split, installed motion, ffmpeg, vsftpd and samba.

I don't need a fabulous framerate and initial results are promising - but i'm struggling to get the images out of the SD card. The idea was to share the partition and pull the images out over the network port.

I have a partition on the card that i've tried sharing over SMB, and FTP. Trouble is, when motion is running ssh and ftp to the RPi seem to crawl to a stand still. Close the motion daemon and they spring into life.

The motion webservices are, just about, running ok - the config and image feed both seem slow. I disabled the latter to see if that would help. Didn't appear to make much difference. I've reduced the image size to 352x288 <i>at a glance</i> it doesn't seem to affect performance.

is this application simply too much for the RPi? I see anecdotal evidence of systems around 500MHz running it. I feel something else is afoot, but i'll be honest - i don't really know what i'm doing.

Over the sluggish ssh, i had a look at "top", and the memory/cpu usage of motion and vsftpd seem 'reasonable' (11-15%).

I know that drawing too much juice from the usb ports can have adverse effects on the network port... could that be the issue?

is SD card speed an issue?


...or would it be simpler to just stick usb flash drive somewhere accessible, and be happy with what i've got!?

jebowenag79
Posts: 1
Joined: Wed May 30, 2012 9:10 pm

Re: Motion

Wed May 30, 2012 9:24 pm

Sorry I don't know the answers, but I must say I, and probably many others, are thinking of taking pictures and sending them elsewhere for further use and processing.

I don't have my RPi yet, but the list of software you mentioned looks pretty familiar. For a security cam application on a typical high end Linux box, I note Zoneminder is quite common. For more resource-restrained environments, the motion app seems highly recommended. I'm hoping motion is a good choice.

One other thing I can think of, again not having the actual hardware yet, is that we'd like to use the "Class 10" SD cards for speed reasons, but some notes I've seen say Class 4 is a better choice for compatibility/stability reasons. So basically, between CPU, RAM, network and "hard drive" (the SD card), the limiting bottleneck might be the SD card. If the images could be sent directly across the network, the whole thing might be faster. Just a guess; your mileage may vary :o

--John

User avatar
cowpat
Posts: 90
Joined: Sat Apr 14, 2012 12:13 pm
Location: London
Contact: Website

Re: Motion

Wed May 30, 2012 10:28 pm

Thanks John, the system will be implemented remotely, on lead acid batteries. The luxury of network storage will compromise my battery life. I have thought about 3G modems, but I'd like to get the basics running first.

The motion analysis does seem to be working. I haven't tested it very thoroughly yet, but it doesn't throw errors and it takes pictures. I didn't try Zoneminder as it seems to do far more than I need.

I'm using the basic blue Sandisk cards so I've just treated myself to a class 10 card on amazon and we'll see if that helps.

I noticed there are some subtle differences in /etc/motion/motion.conf between the debian and arch linux distributions. I don't know if there's anything in there that might make a difference - all my pre-pi testing was on an old laptop running squeeze. As an aside I also noticed today the saturation option in the arch linux motion.conf doesn't seem to be working - at saturation 1, everything is still very pink.... maybe a clue to something not right?

User avatar
cowpat
Posts: 90
Joined: Sat Apr 14, 2012 12:13 pm
Location: London
Contact: Website

Re: Motion

Fri Jun 01, 2012 4:31 pm

My class 10 card has been dispatched by amazon... meanwhile, I have tried the hexxeh-rc3 raspbian image from http://www.raspbian.org/HexxehImages and everything seemed to work okay... At least my original issues are resolved.


It has been running from 16:44:52 to 17:18:22, but now appears unresponsive. Not sure what is issues is, it appears the RPi has crashed and i'll have to go and turn it on and off again. I've been dumped from the ssh shell, and I get "Request timeout for icmp_seq 0" when I try to ping it.

I can see that the LEDs are on at least... I suppose i'll have to get out of this chair now

User avatar
ScoobyDoo
Posts: 111
Joined: Wed Apr 04, 2012 2:52 pm
Location: Staffordshire, UK

Re: Motion

Fri Jun 01, 2012 8:16 pm

Try running motion on Raspbian.

Motion uses hardfloat calculations alot and with soft float there is somewhat poor performance.

Motion is working fine under Raspbian as hardfloat so the performance increase should be noticable.

I shall be using motion for my cctv setup under Raspbian but havent had the time yet to load it and have a play.

User avatar
cowpat
Posts: 90
Joined: Sat Apr 14, 2012 12:13 pm
Location: London
Contact: Website

Re: Motion

Sat Jun 02, 2012 6:09 am

Hexxeh-rc3 is raspbian, isn't it?

As above, performance is much better. I think there's a RAM issue. Since it crashed horribly I reduced the image size to 352 x 288 and left it running overnight and it's still running. I noticed with larger (640 x 480) frames the image would get chopped up - this is still happening at 352x288, but less frequently. I don't think it's a camera/driver issue - the mpeg timelapse looks fine. I've tried decreasing the framerate and it was still happening at 10 seconds/frame.

Image
Image
Image
Image
Image

you get the idea...

PS no newts were harmed in the making of this production, they're made of sculpy.

User avatar
cowpat
Posts: 90
Joined: Sat Apr 14, 2012 12:13 pm
Location: London
Contact: Website

Re: Motion

Sat Jun 02, 2012 1:36 pm

I think I have managed to reproduce that error, or created a new one, by reverting back to 640x480. This time I had a screen on the RPi, and it is spewing forth;

Code: Select all

NYET/NAK/ACK/other in non-error case, 0x00000002

WPsites
Posts: 17
Joined: Sun Jun 10, 2012 11:05 am
Location: Southport, Merseyside, UK
Contact: Website

Re: Motion

Wed Jul 04, 2012 2:09 pm

I'm seeing a similar horizontal break up of the webcam image. The only way I can stop this is if I reduce the image size down to the minimum supported by the webcam (160x120 or something) and then the picture is perfect if not very small.

I'm wondering if I need to purchase a powered hub but I'm not allowed to keep buying stuff.

User avatar
cowpat
Posts: 90
Joined: Sat Apr 14, 2012 12:13 pm
Location: London
Contact: Website

Re: Motion

Wed Jul 04, 2012 3:54 pm

Well, I didn't find a powered hub helped. Lowering the quality of the palette used (number 1 i think i tried) did increase the image size i could get away with, but it looked awful.

That resolution sounds low though, i can use 320 x 240 with an easycap DC-60

WPsites
Posts: 17
Joined: Sun Jun 10, 2012 11:05 am
Location: Southport, Merseyside, UK
Contact: Website

Re: Motion

Wed Jul 04, 2012 10:30 pm

Well I'm having a go at using Raspbian. Hopefully have better luck with this...

WPsites
Posts: 17
Joined: Sun Jun 10, 2012 11:05 am
Location: Southport, Merseyside, UK
Contact: Website

Re: Motion

Thu Jul 05, 2012 12:04 am

No exactly the same problem even when using Raspbien updated to current firmware.

Camera detected right away but image only any good at 160x120px. Cam works fine on a Mac at all resolutions.
Screen-Shot-2012-07-05-at-00.58.jpg
My webcam image all over the place.
Screen-Shot-2012-07-05-at-00.58.jpg (16.76 KiB) Viewed 19718 times

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

Re: Motion

Thu Jul 05, 2012 4:58 am

I'm suspecting it's more of a cpu grunt issue there.
I'm just trying to stream a webcam via ffmpeg and it's very slow, but I do get full frames.
It's slow enough that at one point, the picture from the webcam was an hour behind real time.
Have you tried Overclocking the RPi at all and see if it improves ?
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
cowpat
Posts: 90
Joined: Sat Apr 14, 2012 12:13 pm
Location: London
Contact: Website

Re: Motion

Thu Jul 05, 2012 11:05 am

I think it might be hardware - but cpu usage according to top is consistently low, mine is streaming at 5.6% at present. That suggests to me a problem with data throughput?... however, I'm out of my depth at the hardware level.

I got my hopes up when I read ffmpeg is streaming whole frames, and wondered if you could point motion at the ffmpeg stream locally - effectively treating it as a network camera? Of course being an hour behind realtime put a swift end to those hopes!

There's another webcam/motion thread - in which greater success have been enjoyed with then wheezy beta image. I think there are some tweaks on that image which have helped - but there is a swapfile on that installation too, and I think that might have a part to play in improving results.

User avatar
cowpat
Posts: 90
Joined: Sat Apr 14, 2012 12:13 pm
Location: London
Contact: Website

Re: Motion

Thu Jul 05, 2012 11:07 am

PS I didn't find overclocking made much odds... I certainly didn't notice any difference.

Jim Ford
Posts: 17
Joined: Fri Jul 06, 2012 3:43 pm

Re: Motion

Fri Jul 06, 2012 3:58 pm

I've run 'motion' on and off for a few years, but not for a few months.

I used an old desktop with a couple of video cards fitted and two cameras. It worked well, but the electricity consumption with it running 24/7 led to to abandon it.

On the motion site http://www.lavrsen.dk/foswiki/bin/view/Motion/WebHome it's stated that:

"A USB camera uses all the bandwidth a USB1.1 controller can give. Even at low framerates the camera reserves more than half the 11 Mb/s"

Maybe this is where the data throughput problem arises?

I may start tinkering with motion on the raspberry, now I've received one.

Jim

User avatar
cowpat
Posts: 90
Joined: Sat Apr 14, 2012 12:13 pm
Location: London
Contact: Website

Re: Motion

Fri Jul 06, 2012 7:05 pm

I've had a look at the motion website myself. I had assumed the Raspberry pi ports were 2.0 - and should have a bandwidth of 480Mbs. Moreover, I have experimented with framerates as low as one frame every ten seconds... it will be good to have more input on this once you get tinkering though.

I think that some of the support requests are worth a look on that website. Particularly I remember an issue arising with a beagleboard that sounds like what we are seeing. (ignore the one about green screens on easycap on the pi - that was me, before i found the patch!)

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

Re: Motion

Thu Jul 12, 2012 9:46 am

The Raspi's USB ports are USB 2.0, but (as mentioned in another thread) the current Linux drivers for the Synopsys USB controller in the BCM2835 are a bit cr**, and use up 20% of the CPU just when idle (and I think they might also be to blame for the 'sticking keys' issue?), which might explain some of the problems you're seeing? :?

kelvinmead
Posts: 44
Joined: Tue Feb 05, 2013 9:19 pm
Location: Bristol, UK

Re: Motion

Fri Feb 15, 2013 11:45 pm

rumpy pumpy bumpy...

having got motion all nice and working, how the heck do i stop it?

i plug the webcam in and it just takes millions of photos, streaming like mad, but now ive got the camera working i want to use a different program...

do i have to uninstall motion to free up the camera?

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

Re: Motion

Sat Feb 16, 2013 7:35 am

On Rasbpian - /etc/init.d/motion stop
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”