This is very raw library, feel free to use it and send pull requests and make it suitable for NPM
Supported events:
- AlarmLocal - Local IO alarm
- VideoMotion - Capture Video motion event
- LineDetection - Capture Line crossing event
- VideoLoss - Capture Video loss event
- VideoBlind - Capture video blind event
- start - Recording start event
- stop - Recording stop event
Emits
- Hikvision alarms
- Connection errors
- On connect event
- Clone repo
- Copy config.json.example to config.json
cp config.json.example config.json
npm install
node index.js
npm install -g typescript
- run command
tsc
this will compile your code to dist directory
const { CameraEventHandler } = require('./dist/cameraEventHandler');
const Events = require("events");
const config = require("./config.json");
const cam = new CameraEventHandler(config.host, config.port, config.user, config.password);
cam.on("error", function(err){
console.log("error", err);
})
cam.on("connect", function(){
console.log("connected")
})
cam.on("alarm", function(code, action, index){
console.log("alarm tirggered", [code, action, index]);
})