Simple management IP-devices cameras that honor the ONVIF Protocol protocol.
The present repository is a fork of goonvif that quickly evolved. Because of the need for quickly merged changes, the link to the upstream has been cut.
For the convenience and testing purposes, a CLI tool ships with the repository to help discovering and fetching information from devices.
onvif-cli COMMAND [SUBCOMAND] [ARGUMENTS...]
COMMAND:
discover perform a web-service discovery on the local networks and
reports one line (IP:PORT CRLF) per device that responded
dump SUBCOMMAND IP:PORT Prints a single JSON object with a configuration dump
for the given camera
SUBCOMMAND:
all Prints the full configuration dump, all sections included
media Prints only the media section
event ...
ptz ...
device ...
A High Level go package aims at fetching information from the devices:
Low-Level go packages implement the OnVIF unitary SOAP calls. For each call :
- github.com/jfsmig/onvif/device
- github.com/jfsmig/onvif/event
- github.com/jfsmig/onvif/ptz
- github.com/jfsmig/onvif/Imaging
- github.com/jfsmig/onvif/media
Helpers:
- github.com/jfsmig/onvif/networking implements the low-level SOAP connectivity
- github.com/jfsmig/onvif/ws-discovery
implements the probing of the LAN network interfaces. Please refer to the CLI tools
onvif-cli discover NIC
params := networking.ClientParams{
Xaddr: "",
Username: os.Getenv("ONVIF_USERNAME"),
Password: os.Getenv("ONVIF_PASSWORD"),
HttpClient: nil,
}
sdkDev, err := sdk.NewDevice(params)
if err != nil { /* Not a reachable OnVif device */ }
The low level packages provide one function per OnVIF SOAP method.
Their purpose is to ease the persing and unpacking of the replies.
The problem was the requirement to name the reply field as the reply expected reply type.
But Golang's generics do not provide any sophisticated way to generate the name of a type instead of a type, as the
#
modifier does with cpp
. That's why they have all been generated instead of replying on templated functions.
References
Go
- https://github.com/jfsmig/onvif
- https://github.com/use-go/onvif
- https://github.com/yakovlevdmv/goonvif
Python
C
- https://github.com/mpromonet/v4l2onvif
- https://github.com/RichardoMrMu/gsoap-onvif
- https://github.com/torturelabs/monvif
- https://github.com/Quedale/OnvifDeviceManager
Rust
Swift
- https://github.com/ms2138/ONVIFDiscovery
- https://github.com/ms2138/DahuaEvents
- https://github.com/rvi/ONVIFCamera
Javascript
- https://github.com/patrickmichalina/onvif-rx
- https://github.com/ampretia/onvif-mqtt
- https://github.com/snow-tree/camera-probe
PHP