Idea for FOSCAM camera binding

My code is kind of a mess, it’s bodged together from numerous projects, so there’s lots of left over stuff in it (and the comments sometimes don’t make sense).

My low level motion detector is here My Dropbox Stuff. This is a self contained openhab motion detection interface for HD foscams (only works on HD Foscams). Uses python 2.7 and has a command line explanation (of sorts).

This is derived from some code I found on github ages ago, and is hacked out of a monster facial recognition system I have for my Porch Foscam (which almost works - if it didn’t keep picking up shadows on the driveway as me, or car wheels as my daughter…). You can glean the low level protocol principals from it though.

I’ll zip up my motion code for you to look at as well (in the same place). You have to compile libcurl in with motion, so the Makefile is hacked to include it, as I use curl to control the pan and tilt for motion tracking. You need to include FFMPEG as well, as I use the libraries for decoding the raw H.264 feed from the camera. I added some new options to the .conf file for low level foscam protocol (because there aren’t enough already).

In python I use a small hook into libavdecoder to decode raw H.264 frames (not in the motion detector code example), which is how you get video and snapshots etc.

Let me know if you get it working, or find it useful.

Regards.

1 Like