Socket
Socket
Sign inDemoInstall

onvif-snapshot

Package Overview
Dependencies
47
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    onvif-snapshot

Include this library to take a snapshot of a camera with the onvif library


Version published
Maintainers
1
Install size
3.70 MB
Created

Readme

Source

onvif-snapshot

Include this library to take a snapshot of a camera with the onvif library.

Installation

npm install --save onvif onvif-snapshot

Returns an object:

{
	mimeType: 'jpg|png',
	rawImage: <Node.JS Buffer>
}

Examples

Promise

const Onvif = require('onvif');
require('onvif-snapshot');

const Cam = new Onvif.Cam({
	hostname: process.env.HOSTNAME,
	username: process.env.USER,
	password: process.env.PASSWORD
}, async function(err){
	if(err) throw err;


	try{
		var data = await this.getSnapshot();
	}catch(e){
		return console.error(e);
	}

	console.log(data);
}); 

Callback

const Onvif = require('onvif');
require('onvif-snapshot');

const Cam = new Onvif.Cam({
	hostname: process.env.HOSTNAME,
	username: process.env.USER,
	password: process.env.PASSWORD
}, function(err){
	if(err) throw err;

	this.getSnapshot((err, data) => {
		if(err) throw err;

		console.log(data);
	});
}); 

Keywords

FAQs

Last updated on 16 Dec 2019

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc