Skip to content

vladfolts/Web-Motion-Detector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Detect motion using web camera and display notification

How to use

Run server.py. You can add "--help" parameter to see possible options (HTTP port number, threshold (sensitivity) and SSL if needed).

server.py -p 8000 -s 100000

Open html page in a browser specifying the host where the server runs and the port number:

http://localhost:8000/index.html

Notification should be shown (message box on Windows or console output on other platforms) when camera captures any motion.

How it works

Html page + JavaScript captures video frames from the camera. Each video frame is compared against the previous one and difference is calculated as a number (greater difference makes greater number). Those numbers are sent (using WebSocket connection) to the server which serves the page itself. The server analyzes received numbers and if some number is greater than specified threshold then a notification is displayed.

Server is implemented in python using standard python libraries. Supported platforms - any with modern browser (for client side) and any with python installed (for server side). Tested on Windows/OSX/linux/android and python 2.7.

Regards

Thanks to Benjamin Horn for this article and code.

About

Detect motion using web camera and display notification.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published