All Projects → use-go → onvif

use-go / onvif

Licence: MIT license
full and enhanced onvif protocol stack in golang.

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to onvif

reosploit
A Tool that Finds, Enumerates, and Exploits Reolink Cameras.
Stars: ✭ 89 (-64.54%)
Mutual labels:  ip-cameras
ONVIF-Java
A Java client library to discover, control and manage ONVIF-supported devices.
Stars: ✭ 94 (-62.55%)
Mutual labels:  onvif
onvif-discovery
C# .NetStandard 2.0 library to discover ONVIF compliant devices
Stars: ✭ 29 (-88.45%)
Mutual labels:  onvif
onvif-viewer
Onvif Viewer capable of a rudimentary HMI/SCADA interface
Stars: ✭ 27 (-89.24%)
Mutual labels:  onvif
onvif-nvt
ONVIF library for NVT (Network Video Transmitter) devices.
Stars: ✭ 62 (-75.3%)
Mutual labels:  onvif
onvif-client-php
ONVIF PHP client
Stars: ✭ 19 (-92.43%)
Mutual labels:  onvif
xsd-parser-rs
A xsd/wsdl => rust code generator written in rust
Stars: ✭ 45 (-82.07%)
Mutual labels:  onvif
wsdd
wsdd is Linux daemon for ONVIF WS-Discovery service (server side)
Stars: ✭ 41 (-83.67%)
Mutual labels:  onvif
onvif-django-client
Django(Python) app to connect to onvif cameras (onvif django client)
Stars: ✭ 66 (-73.71%)
Mutual labels:  onvif
v4l2onvif
ONVIF server for V4L2 Devices
Stars: ✭ 83 (-66.93%)
Mutual labels:  onvif
libONVIF
Yet another ONVIF library
Stars: ✭ 96 (-61.75%)
Mutual labels:  onvif
rrtsp client
Rust high level RTSP client
Stars: ✭ 12 (-95.22%)
Mutual labels:  onvif
HomeAssistant-Tapo-Control
Control for Tapo cameras as a Home Assistant component
Stars: ✭ 327 (+30.28%)
Mutual labels:  ptz
rtsp-samsung-tv
Display RTSP streams from IP Cameras on Samsung Smart TV (Tizen TV)
Stars: ✭ 40 (-84.06%)
Mutual labels:  ip-cameras

onvif protocol

Simple management of onvif IP-devices cameras. onvif is an implementation of ONVIF protocol for managing onvif IP devices. The purpose of this library is convenient and easy management of IP cameras and other devices that support ONVIF standard.

Installation

To install the library, use go get:

go get github.com/use-go/onvif

Supported services

The following services are implemented:

  • Device
  • Media
  • PTZ
  • Imaging
  • Event
  • Discovery
  • Auth(More Options)
  • Soap

Using

General concept

  1. Connecting to the device
  2. Authentication (if necessary)
  3. Defining Data Types
  4. Carrying out the required method

Connecting to the device

If there is a device on the network at the address 192.168.13.42, and its ONVIF services use the 1234 port, then you can connect to the device in the following way:

dev, err := onvif.NewDevice(onvif.DeviceParams{Xaddr: "192.168.13.42:1234"})

The ONVIF port may differ depending on the device , to find out which port to use, you can go to the web interface of the device. Usually this is 80 port.

Authentication

If any function of the ONVIF services requires authentication, you must use the Authenticate method.

device := onvif.NewDevice(onvif.DeviceParams{Xaddr: "192.168.13.42:1234", Username: "username", Password: password})

Defining Data Types

Each ONVIF service in this library has its own package, in which all data types of this service are defined, and the package name is identical to the service name and begins with a capital letter. onvif defines the structures for each function of each ONVIF service supported by this library. Define the data type of the GetCapabilities function of the Device service. This is done as follows:

capabilities := device.GetCapabilities{Category:"All"}

Why does the GetCapabilities structure have the Category field and why is the value of this field All?

The figure below shows the documentation for the GetCapabilities. It can be seen that the function takes one Category parameter and its value should be one of the following: 'All', 'Analytics',' Device ',' Events', 'Imaging', 'Media' or 'PTZ'`.

Device GetCapabilities

An example of defining the data type of GetServiceCapabilities function in PTZ:

ptzCapabilities := ptz.GetServiceCapabilities{}

The figure below shows that GetServiceCapabilities does not accept any arguments.

PTZ GetServiceCapabilities

Common data types are in the xsd/onvif package. The types of data (structures) that can be shared by all services are defined in the onvif package.

An example of how to define the data type of the CreateUsers function in Devicemgmt:

createUsers := device.CreateUsers{User: onvif.User{Username:"admin", Password:"qwerty", UserLevel:"User"}}

The figure below shows that ,in this example, the CreateUsers structure field must be a User whose data type is the User structure containing the Username, Password, UserLevel, and optional Extension fields. The User structure is in the onvif package.

Device CreateUsers

Carrying out the required method

To perform any function of one of the ONVIF services whose structure has been defined, you must use the CallMethod of the device object.

createUsers := device.CreateUsers{User: onvif.User{Username:"admin", Password:"qwerty", UserLevel:"User"}}
device := onvif.NewDevice(onvif.DeviceParams{Xaddr: "192.168.13.42:1234", Username: "username", Password: password})
device.Authenticate("username", "password")
resp, err := dev.CallMethod(createUsers)

Great Thanks

Enhanced and Improved from: goonvif

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].