Build Status npm badge npm dependencies NPM Downloads MIT badge

Huddly Software Development Kit (SDK)

Prerequisites

Huddly SDK supportes the following node versions:

  • 8.9.4
  • 10.12.0
  • 11.5.0

We recommend using nvm as your node version manager (https://github.com/creationix/nvm).

After you've setup nvm run

  nvm use 8.9.4

Get started

Then you can install and start using the huddly sdk you need first install it and the transport

  npm install @huddly/sdk @huddly/device-api-usb

Start by creating the sdk and the transport

const HuddlyDeviceAPIUSB = require('@huddly/device-api-usb').default;
const HuddlySdk = require('@huddly/sdk').default;

// Create instances of device-apis you want to use
const usbApi = new HuddlyDeviceAPIUSB();

// Create an instance of the SDK
const sdk = new HuddlySdk(usbApi);

setup camera attached subscriber, this will give you a camera than has been attached.

// Create a instance that will represent the `IDeviceManager` interface
let cameraManager;
sdk.on('ATTACH', (d) => {
  cameraManager = d;
});

then initialize it

sdk.init();

Then you should be good to go. All the actions on the cameraManager are done after the attach event. For example, to get the camera information, call getInfo when the camera is attached.

sdk.on('ATTACH', (d) => {
  cameraManager = d;
  cameraManager.getInfo().then(console.log);
});

Issues

If you have a question or found a bug please open an issue. Thank you

Documentation

For more details on the rest of the functionality to the sdk check out the documentation for the sdk class and the cameraManager (IDeviceManager) interface.

Repo

Check out the sdk code on github (https://github.com/Huddly/sdk)

FAQ

I'm not getting any detections:

Make sure that you're streaming from the camera, pick any video application and select HUDDLY IQ, you should start getting in detections.

My detections are not matching what I see in the stream:

Internally the camera always sees full field of view, the coordinates are relative to full field of view by deafault. If you want the coordinates to be be absolute to the current framing, you can specify this when you get the detector.

    cameraManager.getDetector({ convertDetections: 'FRAMING' });

This makes it easy to draw these bbox directly on top of the main stream.

How can i disable autoframing and still get detection information from camera?

Another available detector configuration is the shouldAutoFrame option which when set to false, it allows you to configure Genius Framing to send detection data without autoframing.

    cameraManager.getDetector({ shouldAutoFrame: false });

By default, the detector is configured to run autoframing and generate detection information.

The camera is never attached, or throwing an Error

Make sure that no other application such as the Huddly app or another sdk instance is running and using the camera.

result-matching ""

    No results matching ""