High-performance ONVIF client for TypeScript with no runtime dependencies.
Warning
2.0 is in alpha. The API can still change. The 1.0.0-beta releases on npm are the old implementation and are no longer maintained.
@2bad/onvif: connect to a camera and call device operations@2bad/onvif-events: event subscriptions and motion detection@2bad/onvif-media: profiles, snapshots and stream URLs
import { Device, DeviceManagement } from '@2bad/onvif'
const device = await Device.connect({ hostname: '192.0.2.10', username: 'admin', password: 'secret' })
const info = await device.call(DeviceManagement.GetDeviceInformation)
console.log(info.manufacturer, info.model)Compared with onvif 0.8.3 and 1.0.0-rc.3 on the same machine:
@2bad/onvif |
onvif |
||
|---|---|---|---|
| Event responses decoded per second | 11,400 | 3,500 | 3.3x faster |
| Time for a burst of 5,000 events | 194 ms | 1,315 ms | 6.8x faster |
| CPU time for 5,000 events | 281 ms | 892 ms | 3.2x less |
Snapshots are up to 2.6x faster than plain fetch.
- Credentials are never exposed
- TLS certificate pinning
- No runtime dependencies
MIT