THIS REPOSITORY HAS MOVED TO FantasticFiasco/axis-js
A Node.js library written in TypeScript capable of getting snapshots from Axis Communication cameras.
import { writeFileSync } from 'fs';
import { Connection, Protocol, Snapshot } from 'axis-snapshot';
const connection = new Connection(Protocol.Http, '192.168.1.102', 80, 'root', '32naJzkJdZ!7*HK&Dz');
const snapshot = new Snapshot(connection);
snapshot.jpeg({ compression: 20, rotation: 180 })
.then((image: Buffer) => writeFileSync('snapshot.jpeg', image));
npm install axis-snapshot
# or
yarn add axis-snapshot
The following NPM packages have been created to provide a smooth experience with devices from Axis Communications.
- axis-discovery - A Node.js client library written in TypeScript capable of searching for Axis Communication cameras using Bonjour and SSDP (UPnP).
- axis-discovery-bonjour - A Node.js Bonjour client library written in TypeScript capable of searching for Axis Communication cameras.
- axis-discovery-ssdp - A Node.js SSDP (UPnP) client library written in TypeScript capable of searching for Axis Communication cameras.
- axis-configuration - A Node.js library written in TypeScript capable of configuring Axis Communication cameras.
- axis-maintenance - A Node.js library written in TypeScript capable of running maintenance operations on cameras from Axis Communication.
axis-snapshot
- This package
The Snapshot
class is the main class in the package. With it you take BMP and JPEG snapshots given that the operations are supported by the camera.
class Snapshot {
/**
* Takes a {link https://wikipedia.org/wiki/BMP_file_format|BMP} snapshot from the camera.
* @throws {UnauthorizedError} User is not authorized to perform operation.
* @throws {RequestError} Request failed.
*/
bmp(options?: SnapshotOptions): Promise<Buffer>;
/**
* Takes a {link https://en.wikipedia.org/wiki/JPEG|JPEG} snapshot from the camera.
* @throws {UnauthorizedError} User is not authorized to perform operation.
* @throws {RequestError} Request failed.
*/
jpeg(options?: SnapshotOptions): Promise<Buffer>;
}
Thank you JetBrains for your important initiative to support the open source community with free licenses to your products.