Jump to content
jasauders

Any "Motion" (+ Linux) users here?

Recommended Posts

I've recently been toying with ZoneMinder. Great platform, but I wanted to tinker with some other ones too. Being a Linux fan, and already having a Linux server running 247, it made sense to stay in the 'Nix arena for now. I heard of Motion before, which seemed completely braindead easy to configure (at least for integrated webcams in laptops and whatnot). But I heard it can incorporate network cameras, so naturally, I was curious.

 

I have an IP network camera and I have the correct URL for the mjpg stream (VLC verifies it works). The way the program works is it's all config file/terminal based, however it seems rather straight forward.

 

motion.conf = main config file. This is where your single camera is set up. If you have multiple cameras, this config file operates as the global config, which passes responsibility onto the thread config files.

thread1.conf = thread1 config file, for camera 1.

thread2.conf = thread2 config file, for camera 2.

 

etc...

 

So I hooked it up as such, with motion.conf commenting /dev/video0 (so my integrated webcam wasn't used) and uncommented thread1.conf at the bottom, so thread1.conf could be used. Then within thread1.conf, I put in the info for the IP camera I want to use. Here are my pastebins:

 

motion.conf

http://pastebin.com/yVU7wqrm

 

thread1.conf

http://pastebin.com/dayF0jph

 

I'm not sure what I'm doing wrong, but each time I run Motion, it simply turns on my integrated webcam now, which baffles me since I have it commented out in motion.conf...

 

I figured this may be a long shot, as most people on the forums tend to go for dedicated DVRs or higher end Windows based software, but I figured I'd try it. Motion looks like it 'could' (once I get over whatever issue I'm facing) be super braindead easy to use with minimal fuss and overhead. Plus, it sounds like it can export actual AVI video files instead of a blast of mjpg streams, but we'll cross that bridge when we get there.

 

EDIT - I think I found a lead to my issue. Within the motion.conf section, there's a netcam_url entry. If anything is in that entry, it takes priority over /dev/video0, which is the system default otherwise. So here's where my confusion comes in... if I'm using multiple cameras, I should be using (from what I understand) the thread1.conf, thread2.conf, etc files for each camera. Okay, fine. But motion.conf defaults to /dev/video0 if nothing is there. So what am I to put there in order to keep motion from using /dev/video0? Should I put the URL of EACH network camera there? I have a feeling this is where my snag is happening...

Share this post


Link to post
Share on other sites

Well, a quick update. I noticed the config file REFUSED to be acknowledged when I ran Motion, which I only realized when I ran it in some sort of debug mode (motion -c config or something?). I just got a slew of permissions denied errors. Turns out the motion.conf file had permissions of 600. I set them to 644, and suddenly everything worked. (owner read/write, group read, all others read)

 

Some reading of the documentation suggests that once netcam_url is in use, whether in the motion.conf file or within thread1.conf, etc., then /dev/video0 becomes unused. So by default, Motion seeks out /dev/video0 to use. If you have one camera, that is to be configured within motion.conf. If it's a network camera, adding the camera's URL (netcam_url http://192.168.1.10/video4.mjpg or whichever your's may be for your specific camera) will thereby make video0 inactive. The same is true if you have multiple cameras and begin adding more netcam_url entries (for each camera) in each thread1.conf, thread2.conf, etc.

 

In short:

 

motion.conf = for global settings that will effect all cameras OR for a single camera.

thread1.conf = for camera 1 in a multi camera environment

thread2.conf = for camera 2 in a multi camera environment

etc...

 

My server is a low end quad core, however it barely shows any movement as the camera is recording under 1280x800 res @ 5 fps. I'm really, REALLY digging Motion so far. It seems daunting at first since the entire thing is based on a config file and no real GUI, but realistically if you just read the config file, it's crazy easy. All of the juicy info is in comment tags in the file, so you just have to read and adjust whatever options you want. Really the only things I changed were I added in the URL of my camera stream so the program could find that feed, I ramped up the fps from 2 to 5, and increased the resolution. I also changed the target_dir so it was saving the files in a directory that wasn't a tmp directory, which it's set to by default.

 

Other than that, seems pretty nice so far. Very quick program, low overhead, and feels a lot like a "no BS" solution. Like I said, at first it seemed kind of like a low end program with rather little to offer versus something like ZoneMinder, but it really isn't bad at all. Just have to RTM, or in this case, RTCF (read the config file). I assume the lower processing requirements (so it seems) is due to it not needing a MySQL database and whatnot, since it really just saves continual snapshots when something moves to the directory you specify. So far, I'm a fan. But hey, I suppose further time with the program will tell.

 

Just wanted to post my findings in case anybody down the road would run into these issues or if someone is curious enough to try it out.

Share this post


Link to post
Share on other sites

Just to update, I've been running Motion for a few weeks now. To say I'm happy with it would be an understatement. It's extremely configurable, easy to work with, and it was incredibly easy for me to pick up and use since I already had a Linux server running... just had to install and run with it.

 

A buddy of mine (one of those situations where you haven't talked in a long time, but you're still friends on Facebook) brought up some video surveillance conversation the other day when he saw I posted a link about Motion. It turns out these days he does installs for a lot of businesses in the city a few miles away, and a lot of them use Motion and love it. Nice!

 

 

Here's my screencast going over some of the basics:

 

 

Edited by Guest

Share this post


Link to post
Share on other sites

My apologies on the late response. Been busy with some bathroom renovations and a last second vacation! Motion can do 247 recording if you set it up as such. It's meant to be motion based out of the box, though. I have it set up for dual streams right now, where I have a 247 stream @ 1 fps and another @ 10 fps that is based on motion detection. You can really manage it any way you want, though the initial kickstart the recording will have to be motion based to get things rolling since that's what the software is designed to do.

 

As far as PTZ controls, I do recall seeing them in the config, but I haven't touched them since I'm not a big PTZ user.

 

In regard to ZoneMinder, I'm actually very fond of that software, but I've had continued issues with it recently. My feeds would work and then magically stop, populating my syslog with a ton of errors that seemed to only lead to dead ends. I also found ZoneMinder to be much heavier than Motion. This was never an issue as I have a quad core server to work from, but it was definitely some food for thought if I would ever add more cameras. Overall, I decided for a security system, I needed something reliable. ZM working for 15 hours and magically stopping, requiring me to fix/tweak it, then to break 5 hours later and repeat wasn't acceptable to me. Once I got hooked up with Motion, I haven't had a single issue with it. It just kind of... runs.

Share this post


Link to post
Share on other sites

I use both, but Zoneminder is the one to use for a true security install. Motion is great for a single camera, but the UI just isn't anywhere near ZM.

Share this post


Link to post
Share on other sites
I use both, but Zoneminder is the one to use for a true security install. Motion is great for a single camera, but the UI just isn't anywhere near ZM.

 

I'm crazy behind here with this follow up, but I'd have to somewhat disagree on some points here. I love ZoneMinder and the team I spoke to is absolutely awesome, but that program has had some quality issues lately that I'm hoping get rectified when/if a new update comes about. Last I used it, it would stop recording every few hours. I could never make sense of the logs and nobody seemed to have an idea on where I could go with it. Since I wanted my surveillance system to be as bullet proof as possible, I explored alternatives. Motion, while not as elaborate as ZoneMinder in terms of GUI, is absolutely rock solid in terms of functionality. I've had, literally, zero issues with it since I've set it up. Doesn't matter if I lose power, if I reboot the box, kernel updates, whatever. It magically starts working each time the system comes back online.

 

I assume you suggesting Motion isn't that great for a multi camera setup is in regard to its lack of UI, which I'd absolutely agree with, but Motion *can* scale out very nicely with the addition of more thread*.conf files for each camera in use.

 

While I love the setup I have, I'm beginning to wonder if I can get a little more accurate with it. I'm beginning to question how with Motion (or any Linux based applications) I could rig up a thermal sensor so it detects moving heated bodies vs anything at all to trigger motion detection. That way when it's fall and leaves are blowing everywhere, it's not triggering it continuously, but only triggering with Mr. UPS guy comes to the door to deliver a new laptop or whatever. If you or anybody else have any idea on that front, I'm all ears...

Share this post


Link to post
Share on other sites

Sucks that you had so many issue with Zoneminder v1.24.2 for 2 years now. Zero issues with its reliablity, only complaint is the motion detection, but I believe that is more due to my craptastic cameras. That said, I got a real DVR and haven't looked back. Though I do miss the works with any browser aspect.

Share this post


Link to post
Share on other sites

Also a Linux person here.

 

Motion is obviously software. What kind of card do you need to use it on a Linux Box?

Share this post


Link to post
Share on other sites

I'm using MJPEG cams but if you look at either the motion or Zoneminder docs, they list supported cards, the range is pretty broad for both.

Share this post


Link to post
Share on other sites

I can't comment on support, as (being an IT guy) my mind defaults to a network based solution utilizing my already-running-247 server as my DVR... hence why Motion and ZoneMinder were solid contenders to use. I just never give analog lines a thought because it's easier for me to run cat5e where I need to, crimp ends, and plug it right into my switch. Assign an IP, bingo bango done. Just my 2c though.

 

The Motion mailing list has a lot of good people on it. You could try that if you can't find anything through their documentation. Here's their web site which may contain a lead: http://www.lavrsen.dk/foswiki/bin/view/Motion/WebHome

 

@ yakky - About ZoneMinder, I ran it for quite a while using a cheap 640x480 camera with no issues. Processor wise, it was pretty taxing on my server, but having only 1 camera I tolerated it at the time. My current camera is 1280x800. The developer I spoke to said it's likely due to the fact that ZoneMinder's support kind of stalled, while cameras and everything else advanced with higher resolutions, which adds some complexity to the table. Using my camera with ZoneMinder was explained to me as if it's like using XP with an absolutely brand new printer and wondering why it doesn't work. Sure, XP's not THAT old - but it's old enough that brand spankin new gear can sometimes be a bit more painful than it is with something like Windows 7. As far as ZM issues, I had used 1.23, 1.24, and 1.25. I think I only used 1.23 for a few days before I realized an update was around - 24 and 25 were the same deal.

 

I understand one of the devs (the 2nd highest guy, I'd assume) is working on a complete rebuild of ZoneMinder, and making fantastic process... but there's only so much he can do while Phil (the guy who started ZoneMinder) is currently "mia." Perhaps in time as it gets more eyes on the code things will pick up, but so far I'm not so sure. I do understand that some companies have forked the ZoneMinder code and utilized it for their own name branded software, such as Ubiquity Networks, but I haven't used it or seen it in the wild to comment further on it.

Share this post


Link to post
Share on other sites

Hello,

 

i recently bought a IP Webcam (dahua hfw2100) and like it alot. It's a nice piece of hardware but

the software is cr*p. The motion detection of this cam is unusable and unreliable.

 

I then discovered the software 'Motion' and that was the solution for me. So here is my setup:

 

- running Motion on a Mac Mini 2011 together with other server applications

- on motion detect call a script which optimize the snapshots for email

- sending email with 5 snapshot pictures and push a notification to my ios device

using 'Pushover' (which is really nice)

- trigger a 'record'-script which records the video to HDD in best quality delivered by the cam (720P, 25 FPS)

- transfering the video to my NAS where i can watch the videos wireless on my ios device using AirVideo (also

a very nice product, no i'm not working for them )

 

This setup is running very stable ever since. I do reboot the camera once a day during the night though.

I'm thinking about putting this setup on a lower powered raspberry pi as easy appliance since not much

CPU is needed for this (even with 720P resolution).

 

 

@jasauders

How are you using the dual stream in your setup? Can you actually use those two streams in Motion?

Are there any options which i'm missing?

 

While I love the setup I have, I'm beginning to wonder if I can get a little more accurate with it. I'm beginning to question how with Motion (or any Linux based applications) I could rig up a thermal sensor so it detects moving heated bodies vs anything at all to trigger motion detection. That way when it's fall and leaves are blowing everywhere, it's not triggering it continuously, but only triggering with Mr. UPS guy comes to the door to deliver a new laptop or whatever. If you or anybody else have any idea on that front, I'm all ears...

 

I also thought about it before. Is there a way to trigger an alarm manually with motion? This way PIR sensor could be

connected via wire or even wireless to the server and trigger the event.

 

BTW: I'm also a Linux guy.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×