I finally got around to looking into rigging up some security cameras around my home so I can find out what damn neighbors have been letting their dogs do their business in front of my gate! I actually caught one woman and her dog and when I pointed out nicely that there was a tree only 20 feet down the sidewalk, she said her dog wants to urinate where it wants, so she lets it because it pulls the leash. Yeah, well, that’s why you are the HUMAN and the master to the animal. Ah, don’t get me started, that is a whole other blog post.
Anyway, where were we? Oh, right! IP cameras! I decided upon the Vivotek IB8369 since, well, it’s awesome. Works at night, great resolution, nice range, can be outdoors, uses POE, and a bunch of other stuff, check the website, what am I, a sales guy?
OK, next step, I wanted to rig this up using my Linux box, not Windows. So I decided to use Motion to capture AVI video when there is motion detected. It will do so, AND store individual JPG frames so you can pick one that is a nice shot and then post it all around your neighborhood with a caption that says “BAD DOG OWNER”. Your needs may differ.
Getting Motion working was a bit of a hassle, here are a few things I did that could help you if you are trying to set this up also.
First, the camera itself, you should set a static IP on it using it’s web interface, and then I had to go into Configuration->Media->Video and set stream 1 to use JPEG. You will also need to set the “Frame size” to something where the width/height are divisible by 16, otherwise you will see messages like below from the Motion logs:
 [CRT] [NET] [Aug 27 18:45:01] netcam_start: netcam image height (1080) is not modulo 16
And here is a screenshot of the webcam settings page:
The next thing is to make sure your /etc/motion.conf has good settings. If you haven’t, you could see messages in the log like:
 [NTC] [STR] [Aug 27 18:49:06] http_bindsock: motion-stream testing : IPV4 addr: 127.0.0.1 port: 8081
 [CRT] [STR] [Aug 27 18:49:06] http_bindsock: motion-stream bind() failed, retrying:
 [ERR] [STR] [Aug 27 18:49:06] http_bindsock: motion-stream socket failed, retrying:
 [CRT] [STR] [Aug 27 18:49:06] http_bindsock: motion-stream creating socket/bind ERROR:
 [ERR] [ALL] [Aug 27 18:49:06] motion_init: Problem enabling motion-stream server in port 8081:
Most are okay from the defaults, here are the ones I changed to make things work:
And then finally the commands to run Motion:
chown motion /var/motion/
service motion start
tail -f /var/log/motion.log
The error log is your friend, and once you have things working nicely, change the log level in the conf file to something more reasonable.