onvif

package module
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: May 20, 2023 License: MIT Imports: 18 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

func CheckAuthorizedError

func CheckAuthorizedError(msg string) bool

kiem tra co phai loi chung thuc hay khong

func DiscoveryDevice

func DiscoveryDevice(interfaceName string, duration int) string

func DiscoveryDeviceByIp

func DiscoveryDeviceByIp(ip string, duration int) string

func GetMediaInformation

func GetMediaInformation(host, username, password string) string

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

func PtzGoToHome

func PtzGoToHome(host, username, password string) string

func PtzStart

func PtzStart(host, username, password string, x, y, z float64) string

func PtzStop

func PtzStop(host, username, password string) string

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 AudioEncoderConfigurationOption

type AudioEncoderConfigurationOption struct {
	Encoding       string // 'G711', 'G726', 'AAC'
	BitrateList    int
	SampleRateList int
}

type AudioSource

type AudioSource struct {
	Token    string
	Channels int //1: mono, 2: stereo
}

type AudioSourceConfiguration

type AudioSourceConfiguration struct {
	Token       string
	Name        string
	SourceToken string
}

type BacklightCompensation

type BacklightCompensation struct {
	Mode  string // 'ON' 'OFF'
	Level float64
}

type Bound

type Bound struct {
	Min int `json:"min"`
	Max int `json:"max"`
}

type CameraDevice

type CameraDevice struct {
	Name         string `json:"name"`
	Manufacturer string `json:"manufacturer"`
	Model        string `json:"model"`
	Serial       string `json:"serial"`
	Mac          string `json:"mac"`
	HardwareID   string `json:"hardwareId"`
	XAddr        string `json:"xadd"`
	User         string `json:"user"`
	Password     string `json:"password"`
	Proto        string `json:"proto"`
}

type CameraProfile

type CameraProfile struct {
	CameraDevice
	Authorize bool     `json:"authorize"`
	Streams   []Stream `json:"streams"`
	LastError string   `json:"lastError"`
}

type CameraProfileCommandResponse

type CameraProfileCommandResponse struct {
	Result string        `json:"result"`
	Data   CameraProfile `json:"data"`
}

type CapabilitiesService

type CapabilitiesService struct {
	Name         string // PTZ, media, device, imaging, events
	Capabilities interface{}
}

type CreatePullPointSubscriptionResponse

type CreatePullPointSubscriptionResponse struct {
	SubscriptionReference SubscriptionReference
	CurrentTime           string
	TerminationTime       string
}

type DNSInformation

type DNSInformation struct {
	FromDHCP     bool
	SearchDomain string
	DNSAddress   []IPAddress // IPAddress of DNSFromDHCP if FromDHCP is true, else of DNSManual
}

type Date

type Date struct {
	Year  int
	Month int
	Day   int
}

type Device

type Device struct {
	ID       string `json:"id"`
	Name     string `json:"name"`
	XAddr    string `json:"xAddr"`
	User     string `json:"user"`
	Password string `json:"password"`
}

Device contains data of ONVIF camera

func StartDiscovery

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

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

func StartDiscoveryOn

func StartDiscoveryOn(interfaceName string, duration time.Duration) ([]Device, error)

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

func (Device) AbsoluteMove

func (device Device) AbsoluteMove(profileToken string, position PTZVector) error

func (Device) AddScopes

func (device Device) AddScopes(listScopes []string) error

func (Device) ContinuousMove

func (device Device) ContinuousMove(profileToken string, velocity PTZVector) error

func (Device) CreateMask

func (device Device) CreateMask(configurationToken string, pointStart, pointEnd Point) (string, error)

func (Device) CreateProfile

func (device Device) CreateProfile(profileName string, profileToken string) (MediaProfile, error)

func (Device) CreatePullPointSubscription

func (device Device) CreatePullPointSubscription() (CreatePullPointSubscriptionResponse, error)

func (Device) CreateUsers

func (device Device) CreateUsers(users []User) error

func (Device) DeleteMask

func (device Device) DeleteMask(maskToken string) error

func (Device) DeleteProfile

func (device Device) DeleteProfile(profileToken string) error

func (Device) DeleteUsers

func (device Device) DeleteUsers(usernames []string) error

func (Device) FindEvents

func (device Device) FindEvents(startPoint string) (string, error)

func (Device) FindRecordings

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

func (Device) GetAudioEncoderConfiguration

func (device Device) GetAudioEncoderConfiguration(configurationToken string) (AudioEncoderConfig, error)

func (Device) GetAudioEncoderConfigurationOptions

func (device Device) GetAudioEncoderConfigurationOptions(configurationToken string, profileToken string) ([]AudioEncoderConfigurationOption, error)

truyen vao mot trong 2 tham so

func (Device) GetAudioEncoderConfigurations

func (device Device) GetAudioEncoderConfigurations() ([]AudioEncoderConfig, error)

func (Device) GetAudioSourceConfiguration

func (device Device) GetAudioSourceConfiguration(configurationToken string) (AudioSourceConfiguration, error)

func (Device) GetAudioSourceConfigurationOptions

func (device Device) GetAudioSourceConfigurationOptions(configurationToken string, profileToken string) (string, error)

fetch input tokens available truyen vao mot trong 2 tham so

func (Device) GetAudioSourceConfigurations

func (device Device) GetAudioSourceConfigurations() ([]AudioSourceConfiguration, error)

func (Device) GetAudioSources

func (device Device) GetAudioSources() ([]AudioSource, error)

func (Device) GetCapabilities

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

GetCapabilities fetch info of ONVIF camera's capabilities

func (Device) GetCompatibleAudioEncoderConfigurations

func (device Device) GetCompatibleAudioEncoderConfigurations(profileToken string) ([]AudioEncoderConfig, error)

func (Device) GetCompatibleAudioSourceConfigurations

func (device Device) GetCompatibleAudioSourceConfigurations(profileToken string) ([]AudioSourceConfiguration, error)

func (Device) GetCompatibleMetadataConfigurations

func (device Device) GetCompatibleMetadataConfigurations(profileToken string) ([]MetadataConfiguration, error)

func (Device) GetCompatibleVideoEncoderConfigurations

func (device Device) GetCompatibleVideoEncoderConfigurations(profileToken string) ([]VideoEncoderConfig, error)

func (Device) GetCompatibleVideoSourceConfigurations

func (device Device) GetCompatibleVideoSourceConfigurations(profileToken string) ([]VideoSourceConfiguration, error)

func (Device) GetConfiguration

func (device Device) GetConfiguration(ptzConfigurationToken string) (PTZConfiguration, error)

func (Device) GetConfigurationOptions

func (device Device) GetConfigurationOptions(configurationToken string) (PTZConfigurationOptions, error)

func (Device) GetConfigurations

func (device Device) GetConfigurations() ([]PTZConfiguration, error)

func (Device) GetDNS

func (device Device) GetDNS() (DNSInformation, error)

func (Device) GetDiscoveryMode

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

GetDiscoveryMode fetch network discovery mode of an ONVIF camera

func (Device) GetDynamicDNS

func (device Device) GetDynamicDNS() (DynamicDNSInformation, error)

func (Device) GetEventProperties

func (device Device) GetEventProperties() (interface{}, error)

return url for unsubscribe

func (Device) GetEventSearchResults

func (device Device) GetEventSearchResults(searchToken string) (ResultList, error)

func (Device) GetGuaranteedNumberOfVideoEncoderInstances

func (device Device) GetGuaranteedNumberOfVideoEncoderInstances(configurationToken string) (GuaranteedNumberOfVideoEncoderInstances, error)

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) GetMasks

func (device Device) GetMasks(configurationToken string) ([]Mask, error)

func (Device) GetMediaAttributes

func (device Device) GetMediaAttributes(time string) ([]MediaAttributes, error)

func (Device) GetMetadataConfiguration

func (device Device) GetMetadataConfiguration(configurationToken string) (MetadataConfiguration, error)

func (Device) GetMetadataConfigurationOptions

func (device Device) GetMetadataConfigurationOptions(configurationToken string, profileToken string) (MetadataConfigurationOptions, error)

truyen vao mot trong 2 tham so

func (Device) GetMetadataConfigurations

func (device Device) GetMetadataConfigurations() ([]MetadataConfiguration, error)

func (Device) GetNTP

func (device Device) GetNTP() (NTPInformation, error)

func (Device) GetNetworkDefaultGateway

func (device Device) GetNetworkDefaultGateway() (NetworkGateway, error)

func (Device) GetNetworkInterfaces

func (device Device) GetNetworkInterfaces() ([]NetworkInterface, error)

GetInformation fetch information of ONVIF camera

func (Device) GetNetworkProtocols

func (device Device) GetNetworkProtocols() ([]NetworkProtocol, error)

func (Device) GetNode

func (device Device) GetNode(nodeToken string) (PTZNode, error)

func (Device) GetNodes

func (device Device) GetNodes() ([]PTZNode, error)

func (Device) GetPresets

func (device Device) GetPresets(profileToken string) ([]PTZPreset, error)

func (Device) GetProfileMedia

func (device Device) GetProfileMedia(profileToken string) (MediaProfile, error)

func (Device) GetProfiles

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

GetProfiles fetch available media profiles of ONVIF camera

func (Device) GetRecordingConfiguration

func (device Device) GetRecordingConfiguration(recordingToken string) (interface{}, error)

func (Device) GetRecordingSearchResults

func (device Device) GetRecordingSearchResults(searchToken string) (ResultList, error)

func (Device) GetRecordingSummary

func (device Device) GetRecordingSummary() ([]RecordingSummary, error)

func (Device) GetRelayOutputs

func (device Device) GetRelayOutputs() (RelayOutput, error)

func (Device) GetReplayConfiguration

func (device Device) GetReplayConfiguration() (interface{}, error)

func (Device) GetReplayServiceCapabilities

func (device Device) GetReplayServiceCapabilities() (interface{}, error)

func (Device) GetReplayUri

func (device Device) GetReplayUri(recordingToken string) (string, error)

func (Device) GetScopes

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

GetScopes fetch scopes of an ONVIF camera

func (Device) GetServiceCapabilities

func (device Device) GetServiceCapabilities() ([]Service, error)

func (Device) GetServices

func (device Device) GetServices() ([]Service, error)

func (Device) GetSnapshot

func (device Device) GetSnapshot(profileToken string) (string, error)

GetSnapshot fetch snapshot URI of a media profile.

func (Device) GetStatus

func (device Device) GetStatus(profileToken string) (PTZStatus, error)

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

func (Device) GetSystemDateAndTime

func (device Device) GetSystemDateAndTime() (SystemDateAndTime, error)

func (Device) GetUsers

func (device Device) GetUsers() ([]User, error)

func (Device) GetVideoEncoderConfigurationOptions

func (device Device) GetVideoEncoderConfigurationOptions(configurationToken string, profileToken string) (VideoEncoderConfigurationOptions, error)

truyen vao mot trong 2 tham so

func (Device) GetVideoEncoderConfigurations

func (device Device) GetVideoEncoderConfigurations() ([]VideoEncoderConfig, error)

func (Device) GetVideoSourceConfiguration

func (device Device) GetVideoSourceConfiguration(configurationToken string) (VideoSourceConfiguration, error)

func (Device) GetVideoSourceConfigurationOptions

func (device Device) GetVideoSourceConfigurationOptions(configurationToken string, profileToken string) (VideoSourceConfigurationOption, error)

truyen vao mot trong 2 tham so

func (Device) GetVideoSourceConfigurations

func (device Device) GetVideoSourceConfigurations() ([]VideoSourceConfiguration, error)

func (Device) GetVideoSources

func (device Device) GetVideoSources() ([]VideoSource, error)

func (Device) GetZeroConfiguration

func (device Device) GetZeroConfiguration() (NetworkZeroConfiguration, error)

func (Device) GotoHomePosition

func (device Device) GotoHomePosition(profileToken string) error

func (Device) GotoPreset

func (device Device) GotoPreset(profileToken string, presetToken string) error

func (Device) PullMessages

func (device Device) PullMessages(address string) ([]NotificationMessage, error)

return url for unsubscribe

func (Device) ReNew

func (device Device) ReNew(address string) (CreatePullPointSubscriptionResponse, error)

func (Device) RelativeMove

func (device Device) RelativeMove(profileToken string, translation PTZVector) error

/ PTZ Control RPC x: positive => go to right || negative => go to left y: positive => go to up || negative => go to down z: positive => zoom in || negative => zoom out

func (Device) RemovePreset

func (device Device) RemovePreset(profileToken string, presetToken string) error

func (Device) RemoveScopes

func (device Device) RemoveScopes(listScopes []string) ([]string, error)

func (Device) SetDNS

func (device Device) SetDNS(dnsInformation DNSInformation) error

func (Device) SetHomePosition

func (device Device) SetHomePosition(profileToken string) error

func (Device) SetHostName

func (device Device) SetHostName(nameToken string) error

func (Device) SetNTP

func (device Device) SetNTP(ntpInformation NTPInformation) error

func (Device) SetNetworkDefaultGateway

func (device Device) SetNetworkDefaultGateway(defaultGateway NetworkGateway) error

func (Device) SetNetworkInterfaces

func (device Device) SetNetworkInterfaces(networkInterface NetworkInterface) error

func (Device) SetNetworkProtocols

func (device Device) SetNetworkProtocols(protocols []NetworkProtocol) error

func (Device) SetPreset

func (device Device) SetPreset(profileToken string, presetName string) (string, error)

return preset token of new preset

func (Device) SetScopes

func (device Device) SetScopes(listScopes []string) error

func (Device) SetSystemDateAndTime

func (device Device) SetSystemDateAndTime(systemDT SystemDateAndTime) error

func (Device) SetUser

func (device Device) SetUser(user User) error

func (Device) SetVideoEncoderConfiguration

func (device Device) SetVideoEncoderConfiguration(videoEncoderConfig VideoEncoderConfig) error

func (Device) SetVideoSourceConfiguration

func (device Device) SetVideoSourceConfiguration(videoSourceConfig VideoSourceConfiguration) error

func (Device) Stop

func (device Device) Stop(profileToken string) error

func (Device) Subscribe

func (device Device) Subscribe(address string) (string, error)

return url for unsubscribe

func (Device) SystemReboot

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

func (Device) UnSubscribe

func (device Device) UnSubscribe(address string) error

func (Device) UpdateMask

func (device Device) UpdateMask(maskToken, configurationToken string, pointStart, pointEnd Point, enable bool) error

type DeviceCapabilities

type DeviceCapabilities struct {
	Network         NetworkCapabilities
	Media           MediaCapabilities
	Recording       ExtensionCapabilities
	SearchRecording ExtensionCapabilities
	Replay          ExtensionCapabilities
	Ptz             PTZCapabilities
	EventsCap       EventsCapabilities
	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 DeviceNetworkCapabilitiesService

type DeviceNetworkCapabilitiesService struct {
	NTP               int
	DynDNS            bool
	IPVersion6        bool
	ZeroConfiguration bool
	IPFilter          bool
}

type DeviceSecurityCapabilitiesService

type DeviceSecurityCapabilitiesService struct {
	RemoteUserHandling   bool
	Dot1X                bool
	AccesssPolicyConfig  bool
	OnboardKeyGeneration bool
	HttpDigest           bool
	X509Token            bool
	DefaultAccessPolicy  bool
	RELToken             bool
	KerberosToken        bool
	TLS12                bool
	TLS11                bool
	TLS10                bool
	UsernameToken        bool
	SAMLToken            bool
}

Service Device

type DeviceSystemCapabilitiesService

type DeviceSystemCapabilitiesService struct {
	DiscoveryBye     bool
	DiscoveryResolve bool
	FirmwareUpgrade  bool
	SystemLogging    bool
	SystemBackup     bool
	RemoteDiscovery  bool
}

type DurationRange

type DurationRange struct {
	Min string
	Max string
}

type DynamicDNSInformation

type DynamicDNSInformation struct {
	Type string // 'NoUpdate', 'ClientUpdates', 'ServerUpdates'
	Name string
	TTL  string
}

DynamicDNSInformation

type EventsCapabilities

type EventsCapabilities struct {
	Events map[string]bool
	XAddr  string `json:"xAddr"`
}

type EventsCapabilitiesService

type EventsCapabilitiesService struct {
	MaxNotificationProducers                      int
	WSPausableSubscriptionManagerInterfaceSupport bool
	WSPullPointSupport                            bool
	WSSubscriptionPolicySupport                   bool
	PersistentNotificationStorage                 bool
	MaxPullPoints                                 int
}

Service Events

type Exposure

type Exposure struct {
	Mode            string // 'AUTO', 'MANUAL'
	Priority        string //  'LowNoise', 'FrameRate'
	Window          Rectangle
	MinExposureTime float64
	MaxExposureTime float64
	MinGain         float64
	MaxGain         float64
	MinIris         float64
	MaxIris         float64
	ExposureTime    float64
	Gain            float64
	Iris            float64
}

type ExtensionCapabilities

type ExtensionCapabilities struct {
	XAddr string `json:"xAddr"`
}

type FloatRange

type FloatRange struct {
	Min float64
	Max float64
}

type FocusConfiguration

type FocusConfiguration struct {
	AutoFocusMode string //  'AUTO', 'MANUAL'
	DefaultSpeed  float64
	NearLimit     float64
	FarLimit      float64
}

type GuaranteedNumberOfVideoEncoderInstances

type GuaranteedNumberOfVideoEncoderInstances struct {
	TotalNumber int
	H264        int
}

GuaranteedNumberOfVideoEncoderInstances

type H264Configuration

type H264Configuration struct {
	GovLength   int
	H264Profile string //'Baseline', 'Main', 'Extended', 'High'
}

VideoEncoderConfig contains configuration of a video encoder

type H264Options

type H264Options struct {
	ResolutionsAvailable  []MediaBounds
	GovLengthRange        IntRange
	FrameRateRange        IntRange
	EncodingIntervalRange IntRange
	BitrateRange          IntRange
	H264ProfilesSupported []string // 'Baseline', 'Main', 'Extended', 'High'
}

type HostnameInformation

type HostnameInformation struct {
	Name     string
	FromDHCP bool
}

HostnameInformation contains hostname info of an ONVIF camera

type IPAddress

type IPAddress struct {
	Type        string
	IPv4Address string
}

DNS Information struct

type IPv4Configuration

type IPv4Configuration struct {
	Manual    PrefixedIPAdress
	LinkLocal PrefixedIPAdress
	FromDHCP  PrefixedIPAdress
	DHCP      bool
}

type IPv4NetworkInterface

type IPv4NetworkInterface struct {
	Enabled bool
	Config  IPv4Configuration
}

type ImagingCapabilitiesService

type ImagingCapabilitiesService struct {
	ImageStabilization bool
}

Service Imaging

type ImagingSettings

type ImagingSettings struct {
	BacklightCompensation BacklightCompensation
	Brightness            float64
	ColorSaturation       float64
	Contrast              float64
	Exposure              Exposure
	Focus                 FocusConfiguration
	IrCutFilter           string //  'ON', 'OFF', 'AUTO'
	Sharpness             float64
	WideDynamicRange      WideDynamicRange
	WhiteBalance          WhiteBalance
}

type IntRange

type IntRange struct {
	Min int
	Max int
}

VideoEncoderConfigurationOptions

type IntRectangle

type IntRectangle struct {
	X      int
	Y      int
	Width  int
	Height int
}

type IntRectangleRange

type IntRectangleRange struct {
	XRange      IntRange
	YRange      IntRange
	WidthRange  IntRange
	HeightRange IntRange
}

type Mask

type Mask struct {
	Token              string
	ConfigurationToken string
	Polygon            []Point
	Type               string
	Enabled            bool
}

type MediaAttributes

type MediaAttributes struct {
	RecordingToken string
	From           string
	Until          string
}

type MediaBounds

type MediaBounds struct {
	Height int
	Width  int
}

MediaBounds contains resolution of a video media

type MediaCapabilities

type MediaCapabilities struct {
	XAddr string `json:"xAddr"`
}

MediaCapabilities contains media capabilities of ONVIF camera

type MediaCapabilitiesService

type MediaCapabilitiesService struct {
	OSD                   bool
	VideoSourceMode       bool
	Rotation              bool
	SnapshotUri           bool
	ProfileCapabilities   MediaProfileCapabilitiesService
	StreamingCapabilities MediaStreamingCapabilitiesService
}

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 MediaProfileCapabilitiesService

type MediaProfileCapabilitiesService struct {
	MaximumNumberOfProfiles int
}

Service Media

type MediaSourceConfig

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

MediaSourceConfig contains configuration of a media source

type MediaStreamingCapabilitiesService

type MediaStreamingCapabilitiesService struct {
	RTP_RTSP_TCP        bool
	RTP_TCP             bool
	RTPMulticast        bool
	NoRTSPStreaming     bool
	NonAggregateControl bool
}

type MediaURI

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

MediaURI contains streaming URI of an ONVIF camera

type MessageData

type MessageData struct {
	Name  string
	Value string
}

type MetadataConfiguration

type MetadataConfiguration struct {
	Token          string
	Name           string
	SessionTimeout string
	Multicast      Multicast
}

type MetadataConfigurationOptions

type MetadataConfigurationOptions struct {
	GeoLocation            bool
	PTZStatusFilterOptions PTZStatusFilterOptions
}

type MoveStatus

type MoveStatus struct {
	PanTilt string
	Zoom    string
}

type Multicast

type Multicast struct {
	Address   IPAddress
	Port      int
	TTL       int
	AutoStart bool
}

type NTPInformation

type NTPInformation struct {
	FromDHCP       bool
	NTPNetworkHost []NetworkHost // NetworkHost of NTPFromDHCP if FromDHCP is true, else of NTPManual
}

type NetworkCapabilities

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

NetworkCapabilities contains networking capabilities of ONVIF camera

type NetworkGateway

type NetworkGateway struct {
	IPv4Address string
}

Network GateWay

type NetworkHost

type NetworkHost struct {
	Type        string
	IPv4Address string
	DNSname     string
}

NTP information struct

type NetworkInterface

type NetworkInterface struct {
	Token   string
	Enabled bool
	Info    NetworkInterfaceInfo
	Link    NetworkInterfaceLink
	IPv4    IPv4NetworkInterface
}

type NetworkInterfaceConnectionSetting

type NetworkInterfaceConnectionSetting struct {
	AutoNegotiation bool
	Speed           int
	Duplex          string // "Full" || "Half"
}

type NetworkInterfaceInfo

type NetworkInterfaceInfo struct {
	Name      string
	HwAddress string
	MTU       int
}

NetWork Interface

type NetworkInterfaceLink struct {
	AdminSettings NetworkInterfaceConnectionSetting
	OperSettings  NetworkInterfaceConnectionSetting
	InterfaceType string
}

type NetworkProtocol

type NetworkProtocol struct {
	Name    string // 'HTTP' 'HTTPS' 'RTSP'
	Enabled bool
	Port    int
}

NetWork Protocols

type NetworkZeroConfiguration

type NetworkZeroConfiguration struct {
	InterfaceToken string
	Enabled        bool
	Addresses      []string
}

NetworkZeroConfiguration

type NotificationMessage

type NotificationMessage struct {
	Topic   string
	UtcTime string
	Data    []MessageData
	Source  []MessageData
}

type OnvifData

type OnvifData struct {
	Error string
	Data  interface{}
}

type OnvifVersion

type OnvifVersion struct {
	Major int
	Minor int
}

type OnvifXAddress

type OnvifXAddress struct {
	MediaXAddress string
	PtzXAddress   string
	EventXAddress string
}

func GetXAddress

func GetXAddress(od Device) (OnvifXAddress, error)

type Options

type Options struct {
	Mode string
}

type PTControlDirection

type PTControlDirection struct {
	EFlip   Options // 'OFF', 'ON', 'Extended'
	Reverse Options // 'OFF', 'ON', 'AUTO', 'Extended'
}

type PTZCapabilities

type PTZCapabilities struct {
	XAddr string `json:"xAddr"`
}

type PTZCapabilitiesService

type PTZCapabilitiesService struct {
	GetCompatibleConfigurations bool
	Reverse                     bool
	EFlip                       bool
}

Service PTZ

type PTZConfig

type PTZConfig struct {
	Name      string
	Token     string
	NodeToken string
}

PTZConfig contains configuration of a PTZ control in camera

type PTZConfiguration

type PTZConfiguration struct {
	Token                                  string
	Name                                   string
	MoveRamp                               int
	PresetRamp                             int
	PresetTourRamp                         int
	NodeToken                              string
	DefaultAbsolutePantTiltPositionSpace   string
	DefaultAbsoluteZoomPositionSpace       string
	DefaultRelativePanTiltTranslationSpace string
	DefaultRelativeZoomTranslationSpace    string
	DefaultContinuousPanTiltVelocitySpace  string
	DefaultContinuousZoomVelocitySpace     string
	DefaultPTZSpeed                        PTZVector
	DefaultPTZTimeout                      string
	PanTiltLimits                          PanTiltLimits
	ZoomLimits                             ZoomLimits
}

type PTZConfigurationOptions

type PTZConfigurationOptions struct {
	Spaces             PTZSpaces
	PTZTimeout         DurationRange
	PTControlDirection PTControlDirection
}

type PTZNode

type PTZNode struct {
	Token                  string
	FixedHomePosition      bool
	GeoMove                bool
	Name                   string
	SupportedPTZSpaces     PTZSpaces
	MaximumNumberOfPresets int
	HomeSupported          bool
}

type PTZPreset

type PTZPreset struct {
	Token       string
	Name        string
	PTZPosition PTZVector
}

type PTZSpaces

type PTZSpaces struct {
	AbsolutePanTiltPositionSpace    Space2DDescription
	AbsoluteZoomPositionSpace       Space1DDescription
	RelativePanTiltTranslationSpace Space2DDescription
	RelativeZoomTranslationSpace    Space1DDescription
	ContinuousPanTiltVelocitySpace  Space2DDescription
	ContinuousZoomVelocitySpace     Space1DDescription
	PanTiltSpeedSpace               Space1DDescription
	ZoomSpeedSpace                  Space1DDescription
}

type PTZStatus

type PTZStatus struct {
	Position   PTZVector
	MoveStatus MoveStatus
	UtcTime    string
}

type PTZStatusFilterOptions

type PTZStatusFilterOptions struct {
	PanTiltStatusSupported   bool
	ZoomStatusSupported      bool
	PanTiltPositionSupported bool
	ZoomPositionSupported    bool
}

type PTZVector

type PTZVector struct {
	PanTilt Vector2D `json:"panTilt"`
	Zoom    Vector1D `json:"zoom"`
}

type PanTiltLimits

type PanTiltLimits struct {
	Range Space2DDescription
}

type Point

type Point struct {
	X int
	Y int
}

type PrefixedIPAdress

type PrefixedIPAdress struct {
	Address      string
	PrefixLength int
}

type ProfileSupport

type ProfileSupport struct {
	ResolutionsAvailable []Resolution `json:"resolutionsAvailable"`
	FpsRange             Bound        `json:"fpsRange"`
	GovLength            Bound        `json:"govLength"`
}

type RateControl

type RateControl struct {
	BitRate          int `json:"bitrate"`
	Fps              int `json:"fps"`
	EncodingInterval int `json:"encodinginterval"`
}

type RecordingInformation

type RecordingInformation struct {
	RecordingToken    string
	EarliestRecording string
	LatestRecording   string
	Track             []Track
	RecordingStatus   string
}

type RecordingSummary

type RecordingSummary struct {
	DataFrom         string
	DataUntil        string
	NumberRecordings int
}

type Rectangle

type Rectangle struct {
	Top    int
	Bottom int
	Left   int
	Right  int
}

type RelayOutput

type RelayOutput struct {
	Token      string
	Properties RelayOutputSettings
}

type RelayOutputSettings

type RelayOutputSettings struct {
	Mode      string // 'Bistable', 'Monostable'
	DelayTime string
	IdleState string // 'closed', 'open'
}

RelayOutput

type Resolution

type Resolution struct {
	Height int `json:"height"`
	Width  int `json:"width"`
}

type ResultList

type ResultList struct {
	SearchState          string
	RecordingInformation []RecordingInformation
}

type SOAP

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

SOAP contains data for SOAP request

func (SOAP) SendRequest

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

SendRequest sends SOAP request to xAddr with digest authenticate

type Scope

type Scope struct {
	ScopeDes  string // 'Fixed' 'Configurabale'
	ScopeItem string
}

Scope

type Service

type Service struct {
	Namespace    string
	XAddr        string
	Capabilities CapabilitiesService
	Version      OnvifVersion
}

type Space1DDescription

type Space1DDescription struct {
	URI    string
	XRange FloatRange
}

type Space2DDescription

type Space2DDescription struct {
	URI    string
	XRange FloatRange
	YRange FloatRange
}

type Stream

type Stream struct {
	ProfileToken     string         `json:"profileToken"`
	VideoEncToken    string         `json:"videoEncToken"`
	VideoCodec       string         `json:"videoCodec"`
	StreamURI        string         `json:"streamUri"`
	Resolution       Resolution     `json:"resolution"`
	RateControl      RateControl    `json:"rateControl"`
	ProfileSupport   ProfileSupport `json:"profileSupport"`
	SnapshotURI      string         `json:"snapshotUri"`
	VideoSourceToken string         `json:"videoSourceToken"`
}

type SubscriptionReference

type SubscriptionReference struct {
	Address string
}

type SystemDateAndTime

type SystemDateAndTime struct {
	DateTimeType    string
	DaylightSavings bool
	TimeZone
	UTCDateTime
}

type Time

type Time struct {
	Hour   int
	Minute int
	Second int
}

System Date And Time

type TimeZone

type TimeZone struct {
	TZ string
}

type Track

type Track struct {
	TrackToken  string
	TrackType   string
	Description string
	DataFrom    string
	DataTo      string
}

type UTCDateTime

type UTCDateTime struct {
	Time
	Date
}

type User

type User struct {
	Username  string
	Password  string
	UserLevel string // 'Administrator', 'Operator', 'User', 'Anonymous', 'Extended'
}

User

type Vector1D

type Vector1D struct {
	Space string  `json:"space"`
	X     float64 `json:"x"`
}

type Vector2D

type Vector2D struct {
	Space string  `json:"space"`
	X     float64 `json:"x"`
	Y     float64 `json:"y"`
}

type VideoEncoderConfig

type VideoEncoderConfig struct {
	Name                string
	Token               string
	Encoding            string
	Quality             float64
	RateControl         VideoRateControl
	Resolution          MediaBounds
	SessionTimeout      string
	H264                H264Configuration
	Multicast           Multicast
	GuaranteedFrameRate bool
	UseCount            int
}

type VideoEncoderConfigurationOptions

type VideoEncoderConfigurationOptions struct {
	QualityRange IntRange
	H264         H264Options
}

type VideoRateControl

type VideoRateControl struct {
	BitrateLimit     int
	EncodingInterval int
	FrameRateLimit   int
}

VideoRateControl contains rate control of a video

type VideoSource

type VideoSource struct {
	Token      string
	Framerate  float64
	Resolution MediaBounds
	Imaging    ImagingSettings
}

VideoSource

type VideoSourceConfiguration

type VideoSourceConfiguration struct {
	Token       string
	Name        string
	SourceToken string
	Bounds      IntRectangle
}

Video Source Configuration

type VideoSourceConfigurationOption

type VideoSourceConfigurationOption struct {
	MaximumNumberOfProfiles    int
	BoundsRange                IntRectangleRange
	VideoSourceTokensAvailable string
}

type WhiteBalance

type WhiteBalance struct {
	Mode   string //  'AUTO', 'MANUAL'
	CrGain float64
	CbGain float64
}

type WideDynamicRange

type WideDynamicRange struct {
	Mode  string //  'OFF', 'ON'
	Level float64
}

type ZoomLimits

type ZoomLimits struct {
	Range Space1DDescription
}

Directories

Path Synopsis
The digest package provides an implementation of http.RoundTripper that takes care of HTTP Digest Authentication (http://www.ietf.org/rfc/rfc2617.txt).
The digest package provides an implementation of http.RoundTripper that takes care of HTTP Digest Authentication (http://www.ietf.org/rfc/rfc2617.txt).

Jump to

Keyboard shortcuts

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