onvif

package module
v0.0.0-...-509c717 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 24, 2017 License: MIT Imports: 15 Imported by: 0

README

Go-ONVIF

Go-ONVIF is a Go package for communicating with network camera which supports the ONVIF specifications. ONVIF (Open Network Video Interface) is an open industry forum promoting and developing global standards for interfaces of IP-based physical security products such as network cameras. Recently, almost all network cameras support ONVIF specifications, especially network camera that made in China, which usually can bought with cheap price.

Progress

This package is still in develoment following guide from ONVIF, with several features already available.

License

Go-ONVIF is distributed using MIT license, which means you can use it however you want as long as you preserve copyright and license notices of this package.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AudioEncoderConfig

type AudioEncoderConfig struct {
	Name           string
	Token          string
	Encoding       string
	Bitrate        int
	SampleRate     int
	SessionTimeout string
}

AudioEncoderConfig contains configuration of an audio encoder

type Device

type Device struct {
	ID       string
	Name     string
	XAddr    string
	User     string
	Password string
}

Device contains data of ONVIF camera

func StartDiscovery

func StartDiscovery(duration time.Duration) ([]Device, error)

StartDiscovery send a WS-Discovery message and wait for all matching device to respond

func (Device) GetCapabilities

func (device Device) GetCapabilities() (DeviceCapabilities, error)

GetCapabilities fetch info of ONVIF camera's capabilities

func (Device) GetDiscoveryMode

func (device Device) GetDiscoveryMode() (string, error)

GetDiscoveryMode fetch network discovery mode of an ONVIF camera

func (Device) GetHostname

func (device Device) GetHostname() (HostnameInformation, error)

GetHostname fetch hostname of an ONVIF camera

func (Device) GetInformation

func (device Device) GetInformation() (DeviceInformation, error)

GetInformation fetch information of ONVIF camera

func (Device) GetProfiles

func (device Device) GetProfiles() ([]MediaProfile, error)

GetProfiles fetch available media profiles of ONVIF camera

func (Device) GetScopes

func (device Device) GetScopes() ([]string, error)

GetScopes fetch scopes of an ONVIF camera

func (Device) GetStreamURI

func (device Device) GetStreamURI(profileToken, protocol string) (MediaURI, error)

GetStreamURI fetch stream URI of a media profile. Possible protocol is UDP, HTTP or RTSP

type DeviceCapabilities

type DeviceCapabilities struct {
	Network   NetworkCapabilities
	Events    map[string]bool
	Streaming map[string]bool
}

DeviceCapabilities contains capabilities of an ONVIF camera

type DeviceInformation

type DeviceInformation struct {
	FirmwareVersion string
	HardwareID      string
	Manufacturer    string
	Model           string
	SerialNumber    string
}

DeviceInformation contains information of ONVIF camera

type HostnameInformation

type HostnameInformation struct {
	Name     string
	FromDHCP bool
}

HostnameInformation contains hostname info of an ONVIF camera

type MediaBounds

type MediaBounds struct {
	Height int
	Width  int
}

MediaBounds contains resolution of a video media

type MediaProfile

type MediaProfile struct {
	Name               string
	Token              string
	VideoSourceConfig  MediaSourceConfig
	VideoEncoderConfig VideoEncoderConfig
	AudioSourceConfig  MediaSourceConfig
	AudioEncoderConfig AudioEncoderConfig
	PTZConfig          PTZConfig
}

MediaProfile contains media profile of an ONVIF camera

type MediaSourceConfig

type MediaSourceConfig struct {
	Name        string
	Token       string
	SourceToken string
	Bounds      MediaBounds
}

MediaSourceConfig contains configuration of a media source

type MediaURI

type MediaURI struct {
	URI                 string
	Timeout             string
	InvalidAfterConnect bool
	InvalidAfterReboot  bool
}

MediaURI contains streaming URI of an ONVIF camera

type NetworkCapabilities

type NetworkCapabilities struct {
	DynDNS     bool
	IPFilter   bool
	IPVersion6 bool
	ZeroConfig bool
}

NetworkCapabilities contains networking capabilities of ONVIF camera

type PTZConfig

type PTZConfig struct {
	Name      string
	Token     string
	NodeToken string
}

PTZConfig contains configuration of a PTZ control in camera

type SOAP

type SOAP struct {
	Body     string
	XMLNs    []string
	User     string
	Password string
	TokenAge time.Duration
}

SOAP contains data for SOAP request

func (SOAP) SendRequest

func (soap SOAP) SendRequest(xaddr string) (mxj.Map, error)

SendRequest sends SOAP request to xAddr

type VideoEncoderConfig

type VideoEncoderConfig struct {
	Name           string
	Token          string
	Encoding       string
	Quality        int
	RateControl    VideoRateControl
	Resolution     MediaBounds
	SessionTimeout string
}

VideoEncoderConfig contains configuration of a video encoder

type VideoRateControl

type VideoRateControl struct {
	BitrateLimit     int
	EncodingInterval int
	FrameRateLimit   int
}

VideoRateControl contains rate control of a video

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL