node-cam
Version:
A node js module for controlling ip based cameras
99 lines (82 loc) • 2.15 kB
Markdown
Node-cam is a node js library for controlling ip cameras. This library is still in development and should not be used in its current form.
0.0.1 (pre-release)
```
$ npm install node-cam
```
Node-cam works with a wide variety of cameras and supports a limitless number of cameras.
To use Node-cam with a single camera, you can use the following code:
```
var nodecam = require("node-cam");
var camera_config = require('./path/to/camera/config/file');
var cam = nodecam.createCamera(camera_config);
cam.snapshot('./path/to/snapshot/directory');
```
To use Node-cam with a multiple cameras, you can use the following code:
```
var nodecam = require("node-cam");
var camera_config = require('./path/to/camera/config/file');
var cameras = [];
for(c in camera_config){
cameras.push(nodecam.createCamera(camera_config[c]));
}
cam[0].snapshot('./path/to/snapshot/directory');
cam[1].snapshot('./path/to/snapshot/directory');
```
Single camera:
```
{
"type":"foscam_hd",
"name":"my_ip_camera",
"host":"192.168.0.1",
"port":"88",
"user":"admin",
"pass":"",
"directories":{
"images":"./my_ip_camera/image",
"videos":"./my_ip_camera/video"
}
}
```
Multiple cameras:
```
{
"cameras": [
{
"type":"foscam_hd",
"name":"camera1",
"host":"192.168.0.1",
"port":"88",
"user":"admin",
"pass":"",
"directories":{
"images":"./camera1/image",
"videos":"./camera1/video"
}
},{
"name":"camera2",
"host":"192.168.0.2",
"port":"88",
"user":"admin",
"pass":"",
"directories":{
"images":"./camera2/image",
"videos":"./camera2/video"
}
}
]
}
```
Node-cam is built to allow a wide assortment of ip cams. To add support for a new type of camera, you only need to create a new camera definition file (see ./cameras/example_camera.js).
Feel free to contribute to the overall project or submit your own camera definitions to be added to the project. *All contributed code must fall under the MIT license.*
### Todo's
* Finish initial codebase.
* Finish foscam HD and MJPEG
License
----
MIT