Repository navigation
onvif v1.1.0
Minor release: stack SOAP XML parser (~4x vs 1.0.0), leaner runtime, Profile D
docs, NAT URI helpers, and video encoder update sugar. Requires Node.js 18+.
Highlights
SOAP XML performance
- Stack ONVIF SOAP XML parser -- zero runtime XML dependencies; single-pass
stack walk (indexOf/charCodeAt), cheap entities, name cache, lean
finalize, one-passrawXMLdual trees. Same public response shapes as
1.0.0(camelCase + leaf coerce;xsanyunchanged). - About ~4x faster SOAP XML parse vs
onvif@1.0.0on representative ONVIF
workloads (device / media / events / large NVR-style envelopes). - Codec / acronym tags --
H264,G711DecOptions,UTCDateTime, and
similar keep their casing when the second character is not a lowercase
letter. - Safe integer coerce -- long digit-only serials / tokens stay strings
instead of losing precision viaparseFloat. xs:dateTimein parse -- ISO UTC leaves stay strings; services use
toDatewhere typed asDate.
Runtime and packaging
- Zero production dependencies -- own builder/parser; no
fast-xml-parser
(or other) runtime XML library. - Lazy-loaded service modules -- small core; services load on first use.
- Node.js
>= 18with one build covering CommonJS, ESMimport, and
TypeScript (.d.ts).
Media / NAT helpers
Onvif.rewriteUri-- rewrite host / port / protocol / credentials on
Media stream and snapshot URI strings (NAT / port-forward). Complements
preserveAddressfor SOAP XAddrs.- Encoder update sugar --
media.updateVideoEncoderConfiguration/
media2.updateVideoEncoderConfiguration: Get -> merge patch -> Set.
Codec switch uses GetVideoEncoderConfigurationOptions (Media1 bags rebuilt
from device lists; no hardcoded Main/SP). Token defaults from
activeMediaProfile.
Protocol breadth (unchanged from 1.0, still a differentiator)
- Typed WSDL interfaces and Profiles S / T / G / M / C / A / D.
- Auth -- WS-Security PasswordDigest + HTTP Digest with strongest
algorithm preference (SHA-512-256 > SHA-256 > SHA-1 > MD5). - WS-Discovery -- IPv4 + IPv6, multi-NIC, directed Probe, scopes/types,
RelatesTo matching (access-only C/A/D ->defaultMedia: false). - Events -- pull-point and WS-BaseNotification, topic filters, renew /
reconnect, typedeventError(includes AccessControl Request topics for D). - Vendor XML --
xs:any/xs:anyAttributeviaxsanywith round-trip
serialization (unknown vendor fields are not dropped). - 0.x compatibility --
onvif/compatibilityand
onvif/compatibility/promisesfor classicCamcallers.
Profile D (docs / recipes)
Access peripherals use the same AccessControl / DoorControl / Credential
modules as C / A. Documented client flow: Request events -> app decision ->
externalAuthorization (+ optional feedback, whitelist/blacklist, door
pulse). See README Beyond cameras, innerDocs/guides.md, and
examples/access.externalAuthorization.js.
Positioning
For a general-purpose Node.js ONVIF client, this project focuses on:
- Lightweight core — zero runtime dependencies and optimized SOAP XML processing
- Efficient architecture — lazy-loaded services, lightweight event handling,
and careful resource management - Broad device coverage — cameras, NVRs, recording systems, access control (Profiles C/A/D), and analytics
- Practical compatibility — Node.js 18+, CommonJS and ESM support, and workarounds for real-world vendor quirks
Specialized alternatives may provide deeper support for particular use cases (e.g. RTSP audio backchannel).
The goal here is broad ONVIF coverage and a balanced implementation rather than optimizing for a single niche.
SOAP XML parsing throughput is approximately 4x higher than in 1.0.0 on the same workloads.
This is an internal before/after measurement, not a head-to-head benchmark against other packages.
See performance.md for methodology and details.
Docs
- CHANGELOG.md
- innerDocs/soap-xml.md
- innerDocs/performance.md
- innerDocs/vendor-extensions.md
- innerDocs/auth.md
- innerDocs/events.md
- innerDocs/guides.md (incl. Profile D access request)
- innerDocs/connection.md (
rewriteUri/ NAT)
Upgrade from 1.0.0
Drop-in for normal service calls. No API break intended for parse trees. If
you asserted exact property names for digit-led codec tags that were
incorrectly lowercased in a pre-release build, prefer the ONVIF forms
(H264, not h264). Long digit serials that used to become imprecise numbers
now stay strings -- compare with String(...) if you need a stable form.
Date fields on typed service responses still use Date via service-side
toDate; raw parseXml leaves remain ISO strings.