ai.natml.natdevice

High-performance, cross-platform media device streaming for Unity Engine.

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
ai.natml.natdevice
1311.2.54 days ago3 months agoMinified + gzip package size for ai.natml.natdevice in KB

Readme

NatDevice
NatDevice is a high performance, cross-platform camera and microphone API for Unity Engine. To start, discover available media devices:
// Create a media device query for a camera device
var filter = MediaDeviceCriteria.CameraDevice;
var query = new MediaDeviceQuery(filter);
// Get the first camera device
var device = query.current as CameraDevice;

Then stream camera images or audio buffers from the device:
// Start streaming camera images
device.StartRunning(OnCameraImage);

void OnCameraImage (CameraImage image) {
    // Do stuff
    ...
}

From here, you can utilize extensive functionality provided by the API to build your interactive applications. Features include:
  • Ultra-low Latency. Stream the camera preview and microphone audio into Unity with extremely small overhead.

  • Ultra-high Resolution. NatDevice supports high resolution camera previews, at full HD and higher on devices that support it.

  • Extensive Camera Control. Set the camera exposure mode, exposure point, exposure duration, focus mode, focus point, flash mode, white balance mode, torch mode, zoom, and more.

  • Granular Microphone Control. Configure the microphone sample rate, channel count, and echo cancellation mode on devices that support it.

  • Machine Learning Integration. NatDevice tightly integrates with NatML for building machine learning and computer vision apps.

  • Video Recording Integration. NatDevice tightly integrates with NatCorder for enabling user-generated content.

See the online docs to learn more about NatDevice.

Installing NatDevice

Using NatDevice requires an active NatML Cloud subscription. First, add the following items to your Unity project's Packages/manifest.json:
{
  "scopedRegistries": [
    {
      "name": "NatML",
      "url": "https://registry.npmjs.com",
      "scopes": ["ai.natml"]
    }
  ],
  "dependencies": {
    "ai.natml.natdevice": "1.2.5"
  }
}
Then retrieve your access key from NatML Hub and add it to your Project Settings:
Specifying your access key

Requirements

  • Unity 2021.2+

Supported Platforms

  • Android API Level 24+
  • iOS 13+
  • macOS 10.15+ (Apple Silicon and Intel)
  • Windows 10+ (64-bit only)
  • WebGL:
- Chrome 91+ - Firefox 90+

Resources