npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

vapix

v0.7.1

Published

VAPIX is Axis’ own open API, implemented in Node.js

Downloads

17

Readme

node-vapix

node-vapix is a Node.js implementation of VAPIX®, an HTTP-based API to interface with Axis cameras.

What is VAPIX?

VAPIX® is Axis’ own open API (Application Programming Interface). It makes Axis network video solutions costefficient, flexible, scalable, future-proof and easy to integrate with other systems.

All Axis network cameras and video servers have an HTTP-based application programming interface. VAPIX® provides functionality for requesting images, controlling network camera functions (PTZ, relays etc.) and setting/retrieving internal parameter values. The purpose of the API is to make it easier for developers to build applications that support Axis video products.

For more details, and the source of the above quote, see Axis' page on the API.

http://www.axis.com/techsup/cam_servers/dev/cam_http_api_index.php

Install and usage

Install from npm:

$ npm install vapix

And to use...

var vapix = require('vapix');

Methods

camera.createVideoSream(options)

Returns a video stream. Each data event is a full frame. Parameters to be set as an object in options are outlined in the VAPIX® Video Streaming API document.

var options = {
	resolution: '640x480',
	compression: 25,
	duration: 10,
	fps: 30
}

var mjpg = camera.createVideoStream(options);

mjpg.on('data', function(data) {
	// do something with the frame here
});

mjpg.on('end', function() {
	console.log('Finished.');
});

camera.requestImage([options], callback)

Grab an image. Parameters to be set as an object in options are outlined in the VAPIX® Video Streaming API document.

var fs = require('fs');

var options = {
	resolution: '640x480',
	compression: 30,
	rotation: 0
}

camera.requestImage(options, function(err, data) {
	if (err) throw err;

	fs.writeFile("out.jpg", data, function(err) {
		if (err) throw err;
	});
});

camera.getImageResolution()

Returns an object containing the width and height of the camera's image resolution setting.

camera.getImageResolution(function(err, data) {
	if (err) throw err;

	console.log(data); // { width: '640', height: '480' }
});

License

node-vapix is written under the MIT License

Status

0.7.1

  • Updated mjpeg-consumer dependency

0.7

  • Reimplemented using request from npm

0.6

  • Provide createCamera utility method.
  • Remove ability to directly create new camera object (API change)

0.4

  • More API documentation
  • requestImage() now supports optional options argument
  • Private method request() now takes 1 path string instead of as an object

0.3

  • Added createVideoStream()
  • Created method for generating HTTP GET queries

0.2

  • Added getImageResolution()
  • Reworked two request methods to use a common request template

0.1

2-22-13: requestImage() now complete. Correctly throws error.
1-22-13: Basic image download refined, no longer need to concatenate chunks on frontend. Moving from alpha status to beta.
1-21-13: Only a basic image download works.