Spent a fair amount of time tweaking settings this weekend and looking to see if there was some software panacea available that would do all I want with the Birdcam. I initially started out with taking snaps of the feeder at regular intervals, but that adds has a little too much of a slot machine aspect to actually seeing activity on the feeder. So I thought I’d investigate getting motion set up. If I got motion detection to work, I then wanted to show a recent history of motion-activated snaps of activty at the feeder. Hopefully, some notes here may help someone else trying to set up something similar.
I’ve found that part of the challenge in running a site like this is that there are a number of wonderful widgets and interesting javascript bits available that allow you to do interesting things with webcams, slideshows and the like. Unfortunately, most of those things cannot be imbedded in a blog post. WordPress, where this blog is hosted, forbids the use of most, if not all, of the fun stuff because of the security threat that malicious code could pose. I could hardly blame them, but it makes doing somethings more difficult.
After downloading and trying about six or seven different packages, I came back to ConquerCam. It really is amazing how awkward, annoying and/or buggy so many of these are. And that’s when their not loaded with adware. At the end of the day, it looks like ConquerCam is quick, clean, easy and stable. The documentation is very light (almost non-existent) but there are many helpful posts on their forum. I discovered a few things which were helpful (and in hindsight should have been obvious but took quite a bit of poking around to confirm):
- motion detection periods can be scheduled during regular periods;
- motion detection can be limited to a user defined mask of the camera image;
- ConquerCam can keep track of and upload a series of recent history files; and
- ConquerCam will always keep the filename of the current (most recent) snap the same when using iterative file names.
The last point was key for putting these captures on a blog. Without javascript, the current image must just point at a fixed name jpeg hosted somewhere. With ConquerCam, I was able to have it save up to five total shots naming each capture{cnt}.jpg where {cnt} is a number between 0-4 which is inserted by the program. The file with the “0″ in its filename is always the current image. Mission accomplished.
Motion detection is a bit more of a challenge. I found a very helpful post on the ConquerCam site that seemed to be key. Everytime I turned on motion detection, it seemed to slow down or lock up the computer. The poster suggested setting the framerate down to 1 fps if your only using the webcam to take snapshots rather than streaming video. This dramatically reduces the load on the CPU to monitor changes to the image.
Likewise, they also suggested setting a mask for the portion of the image to monitor, further reducing the load on the CPU and making sure that extraneous activity doesn’t set off the camera. The program comes with a few random examples of a mask, but no indication of how to actually make one. Again, a helpful post on the forum suggested simply taking recent shot from your camera and editing it in your favorite program like Photoshop, Paint Shop Pro, or even MS Paint. Here’s the trick:
- paint everything you don’t want to monitor absolute black (0, 0, 0);
- paint everything you want to monitor absolute white (255, 255, 255); then
- save it as a .gif file.
When you configure the motion detection, tell ConquerCam to use the mask you created. In preview you should now see the masked area being monitored.
Detection senstivity is tough. Two main concepts to consider here. What’s the right triggering threshold (the amount of motion above which the camera will take a picture) and then what’s the right cooldown period (the time period after detection that the camera should not take a picture). Just to make it obvious, here was my initial problem: set the trigger low and when a bird came to the feeder, a picture was taken and uploaded. Of course, as soon as it left, it detected that motion too and took a picture when the bird left, leaving the current image as a shot of where the bird just left. Set the cooldown to a reasonable period 15-30 seconds and you can mitigate this a bit. Its a lot of trial and error.
I’ve run into one potentially fatal flaw with my current set up though which I’ll likely address soon. The feeder is suspended from the roof by a hook. When birds land or take off from the feeder, they send it swinging back and forth like a pendulum which continues to set off the motion detection after the birds have left. Same problem when its windy. The only solution I can come up with is to pole-mount the feeder so its motion is minimized. Another weekend project.
In the mean time, I’m experimenting with different thresholds for motion detection and it looks like its working most of the time now with the occasional false positives. More tweaks to come!