joelpurra / node-uvc

Node.js library for USB Video Class (UVC) devices. Used to write software for webcams, camcorders, etcetera.
https://joelpurra.com/projects/node-uvc/
GNU Lesser General Public License v3.0
17 stars 1 forks source link

Node.js library for USB Video Class (UVC) devices (node-uvc)

Node.js library for USB Video Class (UVC) devices. Used to write software for webcams, camcorders, etcetera.

UVC-compliant devices include webcams, digital camcorders, transcoders, analog video converters and still-image cameras.

Features

Functional:

Technical:

Installation

Requires Node.js (node and npm commands). Published on npm as uvc.

npm install --save uvc

Usage

See ./examples/ for ready-to-run code.

const { Context, Device, DeviceHandle, LibUvc } = require("uvc");

const libuvc = new LibUvc();
await libuvc.initialize();

const context = new Context(libuvc);
await context.initialize();

const device = await context.findDevice();
await device.initialize();

const deviceHandle = await device.open();
await deviceHandle.initialize();

// NOTE: use the UVC device here, for example using the Controls and FrameStreamer classes.

await deviceHandle.uninitialize();
await device.uninitialize();
await context.uninitialize();
await libuvc.uninitialize();

Development

# Make sure git-flow is initialized.
git flow init -d

npm run --silent test

See also


node-uvc Copyright © 2020, 2021 Joel Purra. Released under GNU Lesser General Public License version 3.0 (LGPL-3.0). Your donations are appreciated!