1.1.3 • Published 7 years ago
pi-motion-detection v1.1.3
pi-motion-detection
A software based detection module for the Raspberry Pi camera using the Pi-Camera module.
Wanna Contribute or Help Out?
Feel free to head over to the GitHub page for pi-motion-detection and submit comments, issues, pulls, and whatever else you'd like. I plan on adding features as I need them for my own projects so if something isn't happening fast enough for you why not fix it? (:
Installation
// NPM 5
npm install pi-motion-detection
// Older NPM versions
npm install pi-motion-detection --save
Basic usage
const path = require('path');
const MotionDetectionModule = require('pi-motion-detection');
const motionDetector = new MotionDetectionModule({
captureDirectory: path.resolve(__dirname, 'captures'),
});
motionDetector.on('motion', () => {
console.log('motion!');
});
motionDetector.on('error', (error) => {
console.log(error);
});
motionDetector.watch();
Constructor Options
const motionDetector = new MotionDetectionModule({
// Required
captureDirectory: foo, // Directory to store tmp photos and video captures. Those will be written into
// captureDirectory/images and captureDirectory/videos respectively
// Optional
continueAfterMotion: false, // Defaults to false
// Flag to control if motion detection will continue after detection
captureVideoOnMotion: false, // Defaults to false
// Flag to control video capture on motion detection
});