Documentation
¶
Overview ¶
Package onvif provides a modern, performant Go library for communicating with ONVIF-compliant IP cameras.
This package implements the ONVIF (Open Network Video Interface Forum) specification, providing a simple and type-safe API for controlling IP cameras and video devices.
Features ¶
- Device Management: Get device information, capabilities, system settings
- Media Services: Access video streams, snapshots, and encoder configurations
- PTZ Control: Pan, tilt, and zoom control with presets
- Imaging: Adjust brightness, contrast, exposure, focus, and other image settings
- Discovery: Automatic device discovery via WS-Discovery
- Security: WS-Security authentication with password digest
Basic Usage ¶
Create a client and connect to a camera:
client, err := onvif.NewClient(
"http://192.168.1.100/onvif/device_service",
onvif.WithCredentials("admin", "password"),
onvif.WithTimeout(30*time.Second),
)
if err != nil {
log.Fatal(err)
}
ctx := context.Background()
// Get device information
info, err := client.GetDeviceInformation(ctx)
if err != nil {
log.Fatal(err)
}
fmt.Printf("Camera: %s %s\n", info.Manufacturer, info.Model)
Discovery ¶
Discover ONVIF devices on the network:
devices, err := discovery.Discover(ctx, 5*time.Second)
for _, device := range devices {
fmt.Printf("Found: %s at %s\n",
device.GetName(),
device.GetDeviceEndpoint())
}
Media Streaming ¶
Get stream URIs for video playback:
profiles, err := client.GetProfiles(ctx)
if len(profiles) > 0 {
streamURI, err := client.GetStreamURI(ctx, profiles[0].Token)
fmt.Printf("RTSP Stream: %s\n", streamURI.URI)
}
PTZ Control ¶
Control camera movement:
// Continuous movement
velocity := &onvif.PTZSpeed{
PanTilt: &onvif.Vector2D{X: 0.5, Y: 0.0},
}
timeout := "PT2S"
client.ContinuousMove(ctx, profileToken, velocity, &timeout)
// Go to preset
presets, _ := client.GetPresets(ctx, profileToken)
client.GotoPreset(ctx, profileToken, presets[0].Token, nil)
Imaging Settings ¶
Adjust camera image settings:
settings, err := client.GetImagingSettings(ctx, videoSourceToken) brightness := 60.0 settings.Brightness = &brightness client.SetImagingSettings(ctx, videoSourceToken, settings, true)
For more examples, see the examples directory in the repository.
Index ¶
- Variables
- func IsONVIFError(err error) bool
- type AbsoluteFocusOptions
- type AnalyticsCapabilities
- type AudioEncoderConfiguration
- type AudioOutput
- type AudioSource
- type AudioSourceConfiguration
- type BacklightCompensation
- type BacklightCompensationOptions
- type Capabilities
- type CapabilitiesExtension
- type Client
- func (c *Client) AbsoluteMove(ctx context.Context, profileToken string, position *PTZVector, speed *PTZSpeed) error
- func (c *Client) ContinuousMove(ctx context.Context, profileToken string, velocity *PTZSpeed, timeout *string) error
- func (c *Client) CreateProfile(ctx context.Context, name, token string) (*Profile, error)
- func (c *Client) CreateUsers(ctx context.Context, users []*User) error
- func (c *Client) DeleteProfile(ctx context.Context, profileToken string) error
- func (c *Client) DeleteUsers(ctx context.Context, usernames []string) error
- func (c *Client) Endpoint() string
- func (c *Client) GetAudioOutputs(ctx context.Context) ([]*AudioOutput, error)
- func (c *Client) GetAudioSources(ctx context.Context) ([]*AudioSource, error)
- func (c *Client) GetCapabilities(ctx context.Context) (*Capabilities, error)
- func (c *Client) GetConfiguration(ctx context.Context, configurationToken string) (*PTZConfiguration, error)
- func (c *Client) GetConfigurations(ctx context.Context) ([]*PTZConfiguration, error)
- func (c *Client) GetCredentials() (string, string)
- func (c *Client) GetDNS(ctx context.Context) (*DNSInformation, error)
- func (c *Client) GetDeviceInformation(ctx context.Context) (*DeviceInformation, error)
- func (c *Client) GetHostname(ctx context.Context) (*HostnameInformation, error)
- func (c *Client) GetImagingSettings(ctx context.Context, videoSourceToken string) (*ImagingSettings, error)
- func (c *Client) GetImagingStatus(ctx context.Context, videoSourceToken string) (*ImagingStatus, error)
- func (c *Client) GetMoveOptions(ctx context.Context, videoSourceToken string) (*MoveOptions, error)
- func (c *Client) GetNTP(ctx context.Context) (*NTPInformation, error)
- func (c *Client) GetNetworkInterfaces(ctx context.Context) ([]*NetworkInterface, error)
- func (c *Client) GetOptions(ctx context.Context, videoSourceToken string) (*ImagingOptions, error)
- func (c *Client) GetPresets(ctx context.Context, profileToken string) ([]*PTZPreset, error)
- func (c *Client) GetProfiles(ctx context.Context) ([]*Profile, error)
- func (c *Client) GetScopes(ctx context.Context) ([]*Scope, error)
- func (c *Client) GetSnapshotURI(ctx context.Context, profileToken string) (*MediaURI, error)
- func (c *Client) GetStatus(ctx context.Context, profileToken string) (*PTZStatus, error)
- func (c *Client) GetStreamURI(ctx context.Context, profileToken string) (*MediaURI, error)
- func (c *Client) GetSystemDateAndTime(ctx context.Context) (interface{}, error)
- func (c *Client) GetUsers(ctx context.Context) ([]*User, error)
- func (c *Client) GetVideoEncoderConfiguration(ctx context.Context, configurationToken string) (*VideoEncoderConfiguration, error)
- func (c *Client) GetVideoSources(ctx context.Context) ([]*VideoSource, error)
- func (c *Client) GotoHomePosition(ctx context.Context, profileToken string, speed *PTZSpeed) error
- func (c *Client) GotoPreset(ctx context.Context, profileToken, presetToken string, speed *PTZSpeed) error
- func (c *Client) Initialize(ctx context.Context) error
- func (c *Client) Move(ctx context.Context, videoSourceToken string, focus *FocusMove) error
- func (c *Client) RelativeMove(ctx context.Context, profileToken string, translation *PTZVector, ...) error
- func (c *Client) RemovePreset(ctx context.Context, profileToken, presetToken string) error
- func (c *Client) SetCredentials(username, password string)
- func (c *Client) SetHomePosition(ctx context.Context, profileToken string) error
- func (c *Client) SetHostname(ctx context.Context, name string) error
- func (c *Client) SetImagingSettings(ctx context.Context, videoSourceToken string, settings *ImagingSettings, ...) error
- func (c *Client) SetPreset(ctx context.Context, profileToken, presetName, presetToken string) (string, error)
- func (c *Client) SetUser(ctx context.Context, user *User) error
- func (c *Client) SetVideoEncoderConfiguration(ctx context.Context, config *VideoEncoderConfiguration, forcePersistence bool) error
- func (c *Client) Stop(ctx context.Context, profileToken string, panTilt, zoom bool) error
- func (c *Client) StopFocus(ctx context.Context, videoSourceToken string) error
- func (c *Client) SystemReboot(ctx context.Context) (string, error)
- type ClientOption
- type ContinuousFocusOptions
- type DNSInformation
- type DeviceCapabilities
- type DeviceInformation
- type EventCapabilities
- type EventSubscription
- type Exposure
- type ExposureOptions
- type FilterType
- type FloatRange
- type FocusConfiguration
- type FocusMove
- type FocusOptions
- type FocusStatus
- type H264Configuration
- type HostnameInformation
- type IOCapabilities
- type IOCapabilitiesExtension
- type IPAddress
- type IPv4Configuration
- type IPv4NetworkInterface
- type IPv6Configuration
- type IPv6NetworkInterface
- type ImagingCapabilities
- type ImagingOptions
- type ImagingSettings
- type ImagingSettingsExtension
- type ImagingStatus
- type IntRectangle
- type MPEG4Configuration
- type MediaCapabilities
- type MediaURI
- type MetadataConfiguration
- type MoveOptions
- type MulticastConfiguration
- type NTPInformation
- type NetworkCapabilities
- type NetworkCapabilitiesExtension
- type NetworkHost
- type NetworkInterface
- type NetworkInterfaceInfo
- type ONVIFError
- type PTZCapabilities
- type PTZConfiguration
- type PTZFilter
- type PTZMoveStatus
- type PTZPreset
- type PTZSpeed
- type PTZStatus
- type PTZVector
- type PanTiltLimits
- type PrefixedIPv4Address
- type PrefixedIPv6Address
- type Profile
- type ProfileExtension
- type RelativeFocusOptions
- type Scope
- type SecurityCapabilities
- type SecurityCapabilitiesExtension
- type Space1DDescription
- type Space2DDescription
- type StreamSetup
- type StreamingCapabilities
- type StreamingCapabilitiesExtension
- type SystemCapabilities
- type SystemCapabilitiesExtension
- type Transport
- type Tunnel
- type User
- type Vector1D
- type Vector2D
- type VideoEncoderConfiguration
- type VideoRateControl
- type VideoResolution
- type VideoSource
- type VideoSourceConfiguration
- type WhiteBalance
- type WhiteBalanceOptions
- type WideDynamicRange
- type WideDynamicRangeOptions
- type ZoomLimits
Examples ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrInvalidEndpoint is returned when the endpoint is invalid ErrInvalidEndpoint = errors.New("invalid endpoint") // ErrAuthenticationRequired is returned when authentication is required but not provided ErrAuthenticationRequired = errors.New("authentication required") // ErrAuthenticationFailed is returned when authentication fails ErrAuthenticationFailed = errors.New("authentication failed") // ErrServiceNotSupported is returned when a service is not supported by the device ErrServiceNotSupported = errors.New("service not supported") // ErrInvalidResponse is returned when the response is invalid ErrInvalidResponse = errors.New("invalid response") // ErrTimeout is returned when a request times out ErrTimeout = errors.New("request timeout") // ErrConnectionFailed is returned when connection to the device fails ErrConnectionFailed = errors.New("connection failed") // ErrInvalidParameter is returned when a parameter is invalid ErrInvalidParameter = errors.New("invalid parameter") // ErrNotInitialized is returned when the client is not initialized ErrNotInitialized = errors.New("client not initialized") )
Functions ¶
func IsONVIFError ¶
IsONVIFError checks if an error is an ONVIF error
Types ¶
type AbsoluteFocusOptions ¶
type AbsoluteFocusOptions struct {
Position FloatRange
Speed FloatRange
}
AbsoluteFocusOptions represents absolute focus options
type AnalyticsCapabilities ¶
AnalyticsCapabilities represents analytics service capabilities
type AudioEncoderConfiguration ¶
type AudioEncoderConfiguration struct {
Token string
Name string
UseCount int
Encoding string // G711, G726, AAC
Bitrate int
SampleRate int
Multicast *MulticastConfiguration
SessionTimeout time.Duration
}
AudioEncoderConfiguration represents audio encoder configuration
type AudioSource ¶
AudioSource represents an audio source
type AudioSourceConfiguration ¶
AudioSourceConfiguration represents audio source configuration
type BacklightCompensation ¶
BacklightCompensation represents backlight compensation
type BacklightCompensationOptions ¶
type BacklightCompensationOptions struct {
Mode []string
Level *FloatRange
}
BacklightCompensationOptions represents backlight compensation options
type Capabilities ¶
type Capabilities struct {
Analytics *AnalyticsCapabilities
Device *DeviceCapabilities
Events *EventCapabilities
Imaging *ImagingCapabilities
Media *MediaCapabilities
PTZ *PTZCapabilities
Extension *CapabilitiesExtension
}
Capabilities represents the device capabilities
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client represents an ONVIF client for communicating with IP cameras
func NewClient ¶
func NewClient(endpoint string, opts ...ClientOption) (*Client, error)
NewClient creates a new ONVIF client
func (*Client) AbsoluteMove ¶
func (c *Client) AbsoluteMove(ctx context.Context, profileToken string, position *PTZVector, speed *PTZSpeed) error
AbsoluteMove moves PTZ to an absolute position
func (*Client) ContinuousMove ¶
func (c *Client) ContinuousMove(ctx context.Context, profileToken string, velocity *PTZSpeed, timeout *string) error
ContinuousMove starts continuous PTZ movement
func (*Client) CreateProfile ¶
CreateProfile creates a new media profile
func (*Client) CreateUsers ¶
CreateUsers creates new user accounts
func (*Client) DeleteProfile ¶
DeleteProfile deletes a media profile
func (*Client) DeleteUsers ¶
DeleteUsers deletes user accounts
func (*Client) GetAudioOutputs ¶
func (c *Client) GetAudioOutputs(ctx context.Context) ([]*AudioOutput, error)
GetAudioOutputs retrieves all audio outputs
func (*Client) GetAudioSources ¶
func (c *Client) GetAudioSources(ctx context.Context) ([]*AudioSource, error)
GetAudioSources retrieves all audio sources
func (*Client) GetCapabilities ¶
func (c *Client) GetCapabilities(ctx context.Context) (*Capabilities, error)
GetCapabilities retrieves device capabilities
func (*Client) GetConfiguration ¶
func (c *Client) GetConfiguration(ctx context.Context, configurationToken string) (*PTZConfiguration, error)
GetConfiguration retrieves PTZ configuration
func (*Client) GetConfigurations ¶
func (c *Client) GetConfigurations(ctx context.Context) ([]*PTZConfiguration, error)
GetConfigurations retrieves all PTZ configurations
func (*Client) GetCredentials ¶
GetCredentials returns the current credentials
func (*Client) GetDNS ¶
func (c *Client) GetDNS(ctx context.Context) (*DNSInformation, error)
GetDNS retrieves DNS configuration
func (*Client) GetDeviceInformation ¶
func (c *Client) GetDeviceInformation(ctx context.Context) (*DeviceInformation, error)
GetDeviceInformation retrieves device information
Example ¶
Example test
// Create client
client, err := NewClient(
"http://192.168.1.100/onvif/device_service",
WithCredentials("admin", "password"),
WithTimeout(30*time.Second),
)
if err != nil {
panic(err)
}
// Get device information
ctx := context.Background()
info, err := client.GetDeviceInformation(ctx)
if err != nil {
panic(err)
}
fmt.Printf("Camera: %s %s\n", info.Manufacturer, info.Model)
fmt.Printf("Firmware: %s\n", info.FirmwareVersion)
func (*Client) GetHostname ¶
func (c *Client) GetHostname(ctx context.Context) (*HostnameInformation, error)
GetHostname retrieves the device's hostname
func (*Client) GetImagingSettings ¶
func (c *Client) GetImagingSettings(ctx context.Context, videoSourceToken string) (*ImagingSettings, error)
GetImagingSettings retrieves imaging settings for a video source
func (*Client) GetImagingStatus ¶
func (c *Client) GetImagingStatus(ctx context.Context, videoSourceToken string) (*ImagingStatus, error)
GetImagingStatus retrieves imaging status
func (*Client) GetMoveOptions ¶
GetMoveOptions retrieves imaging move options for focus
func (*Client) GetNTP ¶
func (c *Client) GetNTP(ctx context.Context) (*NTPInformation, error)
GetNTP retrieves NTP configuration
func (*Client) GetNetworkInterfaces ¶
func (c *Client) GetNetworkInterfaces(ctx context.Context) ([]*NetworkInterface, error)
GetNetworkInterfaces retrieves network interface configuration
func (*Client) GetOptions ¶
GetOptions retrieves imaging options for a video source
func (*Client) GetPresets ¶
GetPresets retrieves PTZ presets
func (*Client) GetProfiles ¶
GetProfiles retrieves all media profiles
func (*Client) GetSnapshotURI ¶
GetSnapshotURI retrieves the snapshot URI for a profile
func (*Client) GetStreamURI ¶
GetStreamURI retrieves the stream URI for a profile
func (*Client) GetSystemDateAndTime ¶
GetSystemDateAndTime retrieves the device's system date and time
func (*Client) GetVideoEncoderConfiguration ¶
func (c *Client) GetVideoEncoderConfiguration(ctx context.Context, configurationToken string) (*VideoEncoderConfiguration, error)
GetVideoEncoderConfiguration retrieves video encoder configuration
func (*Client) GetVideoSources ¶
func (c *Client) GetVideoSources(ctx context.Context) ([]*VideoSource, error)
GetVideoSources retrieves all video sources
func (*Client) GotoHomePosition ¶
GotoHomePosition moves PTZ to home position
func (*Client) GotoPreset ¶
func (c *Client) GotoPreset(ctx context.Context, profileToken, presetToken string, speed *PTZSpeed) error
GotoPreset moves PTZ to a preset position
func (*Client) Initialize ¶
Initialize discovers and initializes service endpoints
func (*Client) RelativeMove ¶
func (c *Client) RelativeMove(ctx context.Context, profileToken string, translation *PTZVector, speed *PTZSpeed) error
RelativeMove moves PTZ relative to current position
func (*Client) RemovePreset ¶
RemovePreset removes a preset
func (*Client) SetCredentials ¶
SetCredentials updates the authentication credentials
func (*Client) SetHomePosition ¶
SetHomePosition sets the current position as home position
func (*Client) SetHostname ¶
SetHostname sets the device's hostname
func (*Client) SetImagingSettings ¶
func (c *Client) SetImagingSettings(ctx context.Context, videoSourceToken string, settings *ImagingSettings, forcePersistence bool) error
SetImagingSettings sets imaging settings for a video source
func (*Client) SetPreset ¶
func (c *Client) SetPreset(ctx context.Context, profileToken, presetName, presetToken string) (string, error)
SetPreset sets a preset position
func (*Client) SetVideoEncoderConfiguration ¶
func (c *Client) SetVideoEncoderConfiguration(ctx context.Context, config *VideoEncoderConfiguration, forcePersistence bool) error
SetVideoEncoderConfiguration sets video encoder configuration
type ClientOption ¶
type ClientOption func(*Client)
ClientOption is a functional option for configuring the Client
func WithCredentials ¶
func WithCredentials(username, password string) ClientOption
WithCredentials sets the authentication credentials
func WithHTTPClient ¶
func WithHTTPClient(httpClient *http.Client) ClientOption
WithHTTPClient sets a custom HTTP client
func WithTimeout ¶
func WithTimeout(timeout time.Duration) ClientOption
WithTimeout sets the HTTP client timeout
type ContinuousFocusOptions ¶
type ContinuousFocusOptions struct {
Speed FloatRange
}
ContinuousFocusOptions represents continuous focus options
type DNSInformation ¶
type DNSInformation struct {
FromDHCP bool
SearchDomain []string
DNSFromDHCP []IPAddress
DNSManual []IPAddress
}
DNSInformation represents DNS configuration
type DeviceCapabilities ¶
type DeviceCapabilities struct {
XAddr string
Network *NetworkCapabilities
System *SystemCapabilities
IO *IOCapabilities
Security *SecurityCapabilities
}
DeviceCapabilities represents device service capabilities
type DeviceInformation ¶
type DeviceInformation struct {
Manufacturer string
Model string
FirmwareVersion string
SerialNumber string
HardwareID string
}
DeviceInformation contains basic device information
type EventCapabilities ¶
type EventCapabilities struct {
XAddr string
WSSubscriptionPolicySupport bool
WSPullPointSupport bool
WSPausableSubscriptionSupport bool
}
EventCapabilities represents event service capabilities
type EventSubscription ¶
type EventSubscription struct {
Filter *FilterType
}
EventSubscription represents event subscription
type Exposure ¶
type Exposure struct {
Mode string // AUTO, MANUAL
Priority string // LowNoise, FrameRate
MinExposureTime float64
MaxExposureTime float64
MinGain float64
MaxGain float64
MinIris float64
MaxIris float64
ExposureTime float64
Gain float64
Iris float64
}
Exposure represents exposure settings
type ExposureOptions ¶
type ExposureOptions struct {
Mode []string
Priority []string
MinExposureTime *FloatRange
MaxExposureTime *FloatRange
MinGain *FloatRange
MaxGain *FloatRange
MinIris *FloatRange
MaxIris *FloatRange
ExposureTime *FloatRange
Gain *FloatRange
Iris *FloatRange
}
ExposureOptions represents exposure options
type FloatRange ¶
FloatRange represents a float range
type FocusConfiguration ¶
type FocusConfiguration struct {
AutoFocusMode string // AUTO, MANUAL
DefaultSpeed float64
NearLimit float64
FarLimit float64
}
FocusConfiguration represents focus configuration
type FocusMove ¶
type FocusMove struct {
}
FocusMove represents a focus move operation (placeholder for focus move types)
type FocusOptions ¶
type FocusOptions struct {
AutoFocusModes []string
DefaultSpeed *FloatRange
NearLimit *FloatRange
FarLimit *FloatRange
}
FocusOptions represents focus options
type FocusStatus ¶
FocusStatus represents focus status
type H264Configuration ¶
H264Configuration represents H264 configuration
type HostnameInformation ¶
HostnameInformation represents hostname configuration
type IOCapabilities ¶
type IOCapabilities struct {
InputConnectors int
RelayOutputs int
Extension *IOCapabilitiesExtension
}
IOCapabilities represents I/O capabilities
type IOCapabilitiesExtension ¶
type IOCapabilitiesExtension struct{}
type IPAddress ¶
type IPAddress struct {
Type string // IPv4 or IPv6
Address string
IPv4Address string
IPv6Address string
}
IPAddress represents an IP address
type IPv4Configuration ¶
type IPv4Configuration struct {
Manual []PrefixedIPv4Address
DHCP bool
}
IPv4Configuration represents IPv4 configuration
type IPv4NetworkInterface ¶
type IPv4NetworkInterface struct {
Enabled bool
Config IPv4Configuration
}
IPv4NetworkInterface represents IPv4 configuration
type IPv6Configuration ¶
type IPv6Configuration struct {
Manual []PrefixedIPv6Address
DHCP bool
}
IPv6Configuration represents IPv6 configuration
type IPv6NetworkInterface ¶
type IPv6NetworkInterface struct {
Enabled bool
Config IPv6Configuration
}
IPv6NetworkInterface represents IPv6 configuration
type ImagingCapabilities ¶
type ImagingCapabilities struct {
XAddr string
}
ImagingCapabilities represents imaging service capabilities
type ImagingOptions ¶
type ImagingOptions struct {
BacklightCompensation *BacklightCompensationOptions
Brightness *FloatRange
ColorSaturation *FloatRange
Contrast *FloatRange
Exposure *ExposureOptions
Focus *FocusOptions
IrCutFilterModes []string
Sharpness *FloatRange
WideDynamicRange *WideDynamicRangeOptions
WhiteBalance *WhiteBalanceOptions
}
ImagingOptions represents available imaging options
type ImagingSettings ¶
type ImagingSettings struct {
BacklightCompensation *BacklightCompensation
Brightness *float64
ColorSaturation *float64
Contrast *float64
Exposure *Exposure
Focus *FocusConfiguration
IrCutFilter *string
Sharpness *float64
WideDynamicRange *WideDynamicRange
WhiteBalance *WhiteBalance
Extension *ImagingSettingsExtension
}
ImagingSettings represents imaging settings
type ImagingSettingsExtension ¶
type ImagingSettingsExtension struct{}
ImagingSettingsExtension represents imaging settings extension
type ImagingStatus ¶
type ImagingStatus struct {
FocusStatus *FocusStatus
}
ImagingStatus represents imaging status
type IntRectangle ¶
IntRectangle represents a rectangle with integer coordinates
type MPEG4Configuration ¶
MPEG4Configuration represents MPEG4 configuration
type MediaCapabilities ¶
type MediaCapabilities struct {
XAddr string
StreamingCapabilities *StreamingCapabilities
}
MediaCapabilities represents media service capabilities
type MediaURI ¶
type MediaURI struct {
URI string
InvalidAfterConnect bool
InvalidAfterReboot bool
Timeout time.Duration
}
MediaURI represents a media URI
type MetadataConfiguration ¶
type MetadataConfiguration struct {
Token string
Name string
UseCount int
PTZStatus *PTZFilter
Events *EventSubscription
Analytics bool
Multicast *MulticastConfiguration
SessionTimeout time.Duration
}
MetadataConfiguration represents metadata configuration
type MoveOptions ¶
type MoveOptions struct {
Absolute *AbsoluteFocusOptions
Relative *RelativeFocusOptions
Continuous *ContinuousFocusOptions
}
MoveOptions represents imaging move options
type MulticastConfiguration ¶
MulticastConfiguration represents multicast configuration
type NTPInformation ¶
type NTPInformation struct {
FromDHCP bool
NTPFromDHCP []NetworkHost
NTPManual []NetworkHost
}
NTPInformation represents NTP configuration
type NetworkCapabilities ¶
type NetworkCapabilities struct {
IPFilter bool
ZeroConfiguration bool
IPVersion6 bool
DynDNS bool
Extension *NetworkCapabilitiesExtension
}
NetworkCapabilities represents network capabilities
type NetworkCapabilitiesExtension ¶
type NetworkCapabilitiesExtension struct{}
type NetworkHost ¶
type NetworkHost struct {
Type string // IPv4, IPv6, DNS
IPv4Address string
IPv6Address string
DNSname string
}
NetworkHost represents a network host
type NetworkInterface ¶
type NetworkInterface struct {
Token string
Enabled bool
Info NetworkInterfaceInfo
IPv4 *IPv4NetworkInterface
IPv6 *IPv6NetworkInterface
}
NetworkInterface represents a network interface
type NetworkInterfaceInfo ¶
NetworkInterfaceInfo represents network interface info
type ONVIFError ¶
ONVIFError represents an ONVIF-specific error
func NewONVIFError ¶
func NewONVIFError(code, reason, message string) *ONVIFError
NewONVIFError creates a new ONVIF error
type PTZCapabilities ¶
type PTZCapabilities struct {
XAddr string
}
PTZCapabilities represents PTZ service capabilities
type PTZConfiguration ¶
type PTZConfiguration struct {
Token string
Name string
UseCount int
NodeToken string
DefaultAbsolutePantTiltPositionSpace string
DefaultAbsoluteZoomPositionSpace string
DefaultRelativePanTiltTranslationSpace string
DefaultRelativeZoomTranslationSpace string
DefaultContinuousPanTiltVelocitySpace string
DefaultContinuousZoomVelocitySpace string
DefaultPTZSpeed *PTZSpeed
DefaultPTZTimeout time.Duration
PanTiltLimits *PanTiltLimits
ZoomLimits *ZoomLimits
}
PTZConfiguration represents PTZ configuration
type PTZMoveStatus ¶
type PTZMoveStatus struct {
PanTilt string // IDLE, MOVING, UNKNOWN
Zoom string // IDLE, MOVING, UNKNOWN
}
PTZMoveStatus represents PTZ movement status
type PTZStatus ¶
type PTZStatus struct {
Position *PTZVector
MoveStatus *PTZMoveStatus
Error string
UTCTime time.Time
}
PTZStatus represents PTZ status
type PanTiltLimits ¶
type PanTiltLimits struct {
Range *Space2DDescription
}
PanTiltLimits represents pan/tilt limits
type PrefixedIPv4Address ¶
PrefixedIPv4Address represents an IPv4 address with prefix
type PrefixedIPv6Address ¶
PrefixedIPv6Address represents an IPv6 address with prefix
type Profile ¶
type Profile struct {
Token string
Name string
VideoSourceConfiguration *VideoSourceConfiguration
AudioSourceConfiguration *AudioSourceConfiguration
VideoEncoderConfiguration *VideoEncoderConfiguration
AudioEncoderConfiguration *AudioEncoderConfiguration
PTZConfiguration *PTZConfiguration
MetadataConfiguration *MetadataConfiguration
Extension *ProfileExtension
}
Profile represents a media profile
type ProfileExtension ¶
type ProfileExtension struct{}
ProfileExtension represents profile extension
type RelativeFocusOptions ¶
type RelativeFocusOptions struct {
Distance FloatRange
Speed FloatRange
}
RelativeFocusOptions represents relative focus options
type SecurityCapabilities ¶
type SecurityCapabilities struct {
TLS11 bool
TLS12 bool
OnboardKeyGeneration bool
AccessPolicyConfig bool
X509Token bool
SAMLToken bool
KerberosToken bool
RELToken bool
Extension *SecurityCapabilitiesExtension
}
SecurityCapabilities represents security capabilities
type SecurityCapabilitiesExtension ¶
type SecurityCapabilitiesExtension struct{}
type Space1DDescription ¶
type Space1DDescription struct {
URI string
XRange *FloatRange
}
Space1DDescription represents 1D space description
type Space2DDescription ¶
type Space2DDescription struct {
URI string
XRange *FloatRange
YRange *FloatRange
}
Space2DDescription represents 2D space description
type StreamSetup ¶
StreamSetup represents stream setup parameters
type StreamingCapabilities ¶
type StreamingCapabilities struct {
RTPMulticast bool
RTP_TCP bool
RTP_RTSP_TCP bool
Extension *StreamingCapabilitiesExtension
}
StreamingCapabilities represents streaming capabilities
type StreamingCapabilitiesExtension ¶
type StreamingCapabilitiesExtension struct{}
type SystemCapabilities ¶
type SystemCapabilities struct {
DiscoveryResolve bool
DiscoveryBye bool
RemoteDiscovery bool
SystemBackup bool
SystemLogging bool
FirmwareUpgrade bool
SupportedVersions []string
Extension *SystemCapabilitiesExtension
}
SystemCapabilities represents system capabilities
type SystemCapabilitiesExtension ¶
type SystemCapabilitiesExtension struct{}
type User ¶
type User struct {
Username string
Password string
UserLevel string // Administrator, Operator, User
}
User represents a user account
type VideoEncoderConfiguration ¶
type VideoEncoderConfiguration struct {
Token string
Name string
UseCount int
Encoding string // JPEG, MPEG4, H264
Resolution *VideoResolution
Quality float64
RateControl *VideoRateControl
MPEG4 *MPEG4Configuration
H264 *H264Configuration
Multicast *MulticastConfiguration
SessionTimeout time.Duration
}
VideoEncoderConfiguration represents video encoder configuration
type VideoRateControl ¶
VideoRateControl represents video rate control
type VideoResolution ¶
VideoResolution represents video resolution
type VideoSource ¶
type VideoSource struct {
Token string
Framerate float64
Resolution *VideoResolution
Imaging *ImagingSettings
}
VideoSource represents a video source
type VideoSourceConfiguration ¶
type VideoSourceConfiguration struct {
Token string
Name string
UseCount int
SourceToken string
Bounds *IntRectangle
}
VideoSourceConfiguration represents video source configuration
type WhiteBalance ¶
WhiteBalance represents white balance settings
type WhiteBalanceOptions ¶
type WhiteBalanceOptions struct {
Mode []string
YrGain *FloatRange
YbGain *FloatRange
}
WhiteBalanceOptions represents white balance options
type WideDynamicRange ¶
WideDynamicRange represents WDR settings
type WideDynamicRangeOptions ¶
type WideDynamicRangeOptions struct {
Mode []string
Level *FloatRange
}
WideDynamicRangeOptions represents WDR options
type ZoomLimits ¶
type ZoomLimits struct {
Range *Space1DDescription
}
ZoomLimits represents zoom limits
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
onvif-cli
command
|
|
|
onvif-quick
command
|
|
|
onvif-server
command
|
|
|
examples
|
|
|
complete-demo
command
|
|
|
comprehensive-test
command
|
|
|
debug-soap
command
|
|
|
debug-streamuri
command
|
|
|
device-info
command
|
|
|
discover-and-test
command
|
|
|
discover-real-camera
command
|
|
|
discovery
command
|
|
|
imaging-settings
command
|
|
|
manual-soap-test
command
|
|
|
onvif-server
command
|
|
|
ptz-control
command
|
|
|
simple-server
command
|
|
|
test-new-features
command
|
|
|
test-real-camera
command
|
|
|
test-server
command
|
|