server

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2026 License: MIT Imports: 9 Imported by: 0

README

ONVIF Server - Virtual IP Camera Simulator

A complete ONVIF-compliant server implementation that simulates multi-lens IP cameras with full support for Device, Media, PTZ, and Imaging services.

Features

🎥 Multi-Lens Camera Support
  • Multiple Video Profiles: Support for up to 10 independent camera profiles
  • Different Resolutions: From 640x480 to 4K (3840x2160)
  • Configurable Framerates: 25, 30, 60 fps
  • Multiple Encodings: H.264, H.265, MPEG4, JPEG
🎮 PTZ Control
  • Continuous Movement: Smooth pan, tilt, and zoom control
  • Absolute Positioning: Move to specific coordinates
  • Relative Movement: Move relative to current position
  • Preset Positions: Save and recall camera positions
  • Status Monitoring: Real-time PTZ state information
📷 Imaging Control
  • Brightness, Contrast, Saturation: Full color control
  • Exposure Settings: Auto/Manual modes with gain control
  • Focus Control: Auto-focus and manual focus positioning
  • White Balance: Auto/Manual white balance adjustment
  • Wide Dynamic Range (WDR): Enhanced contrast in challenging lighting
  • IR Cut Filter: Day/Night mode control
🌐 ONVIF Services
  • Device Service: Device information, capabilities, system time
  • Media Service: Profiles, stream URIs (RTSP), snapshots
  • PTZ Service: Full PTZ control and preset management
  • Imaging Service: Complete imaging settings control
  • Events Service: (Planned)
🔐 Security
  • WS-Security Authentication: UsernameToken with password digest
  • Configurable Credentials: Custom username/password
  • SOAP Message Security: Nonce and timestamp validation

Installation

# Clone the repository (if not already done)
git clone https://github.com/0x524a/onvif-go
cd onvif-go

# Build the server CLI
go build -o onvif-server ./cmd/onvif-server

# Or install globally
go install ./cmd/onvif-server

Quick Start

Basic Usage

Start the server with default settings (3 camera profiles):

./onvif-server

The server will start on http://0.0.0.0:8080 with:

  • Username: admin
  • Password: admin
  • 3 camera profiles with different resolutions
  • PTZ and Imaging services enabled
Custom Configuration
# Custom credentials and port
./onvif-server -username myuser -password mypass -port 9000

# More camera profiles
./onvif-server -profiles 5

# Disable PTZ
./onvif-server -ptz=false

# Custom device information
./onvif-server -manufacturer "Acme Corp" -model "SuperCam 5000"
Command-Line Options
  -host string
        Server host address (default "0.0.0.0")
  -port int
        Server port (default 8080)
  -username string
        Authentication username (default "admin")
  -password string
        Authentication password (default "admin")
  -manufacturer string
        Device manufacturer (default "onvif-go")
  -model string
        Device model (default "Virtual Multi-Lens Camera")
  -firmware string
        Firmware version (default "1.0.0")
  -serial string
        Serial number (default "SN-12345678")
  -profiles int
        Number of camera profiles (1-10) (default 3)
  -ptz
        Enable PTZ support (default true)
  -imaging
        Enable Imaging support (default true)
  -events
        Enable Events support (default false)
  -info
        Show server info and exit
  -version
        Show version and exit

Using the Server Library

Simple Example
package main

import (
    "context"
    "log"
    "time"

    "github.com/0x524a/onvif-go/server"
)

func main() {
    // Use default configuration
    config := server.DefaultConfig()
    
    // Or customize
    config.Port = 9000
    config.Username = "myuser"
    config.Password = "mypass"

    // Create server
    srv, err := server.New(config)
    if err != nil {
        log.Fatal(err)
    }

    // Start server
    ctx := context.Background()
    if err := srv.Start(ctx); err != nil {
        log.Fatal(err)
    }
}
Custom Multi-Lens Camera
package main

import (
    "context"
    "log"
    "time"

    "github.com/0x524a/onvif-go/server"
)

func main() {
    config := &server.Config{
        Host:     "0.0.0.0",
        Port:     8080,
        BasePath: "/onvif",
        Timeout:  30 * time.Second,
        DeviceInfo: server.DeviceInfo{
            Manufacturer:    "MultiCam Systems",
            Model:           "MC-3000 Pro",
            FirmwareVersion: "2.5.1",
            SerialNumber:    "MC3000-001234",
            HardwareID:      "HW-MC3000",
        },
        Username:       "admin",
        Password:       "SecurePass123",
        SupportPTZ:     true,
        SupportImaging: true,
        SupportEvents:  false,
        Profiles: []server.ProfileConfig{
            {
                Token: "profile_main_4k",
                Name:  "Main Camera 4K",
                VideoSource: server.VideoSourceConfig{
                    Token:      "video_source_main",
                    Name:       "Main Camera",
                    Resolution: server.Resolution{Width: 3840, Height: 2160},
                    Framerate:  30,
                },
                VideoEncoder: server.VideoEncoderConfig{
                    Encoding:   "H264",
                    Resolution: server.Resolution{Width: 3840, Height: 2160},
                    Quality:    90,
                    Framerate:  30,
                    Bitrate:    20480, // 20 Mbps
                    GovLength:  30,
                },
                PTZ: &server.PTZConfig{
                    NodeToken:          "ptz_main",
                    PanRange:           server.Range{Min: -180, Max: 180},
                    TiltRange:          server.Range{Min: -90, Max: 90},
                    ZoomRange:          server.Range{Min: 0, Max: 10},
                    SupportsContinuous: true,
                    SupportsAbsolute:   true,
                    SupportsRelative:   true,
                    Presets: []server.Preset{
                        {Token: "preset_home", Name: "Home", Position: server.PTZPosition{Pan: 0, Tilt: 0, Zoom: 0}},
                        {Token: "preset_entrance", Name: "Entrance", Position: server.PTZPosition{Pan: -45, Tilt: -20, Zoom: 3}},
                    },
                },
                Snapshot: server.SnapshotConfig{
                    Enabled:    true,
                    Resolution: server.Resolution{Width: 3840, Height: 2160},
                    Quality:    95,
                },
            },
            // Add more profiles...
        },
    }

    srv, err := server.New(config)
    if err != nil {
        log.Fatal(err)
    }

    ctx := context.Background()
    if err := srv.Start(ctx); err != nil {
        log.Fatal(err)
    }
}

Testing with ONVIF Client

You can test the server with the included ONVIF client library:

package main

import (
    "context"
    "fmt"
    "log"
    "time"

    "github.com/0x524a/onvif-go"
)

func main() {
    // Connect to the server
    client, err := onvif.NewClient(
        "http://localhost:8080/onvif/device_service",
        onvif.WithCredentials("admin", "admin"),
        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("Device: %s %s\n", info.Manufacturer, info.Model)

    // Initialize to discover services
    if err := client.Initialize(ctx); err != nil {
        log.Fatal(err)
    }

    // Get media profiles
    profiles, err := client.GetProfiles(ctx)
    if err != nil {
        log.Fatal(err)
    }

    fmt.Printf("Found %d profiles:\n", len(profiles))
    for i, profile := range profiles {
        fmt.Printf("  [%d] %s\n", i+1, profile.Name)
        
        // Get stream URI
        streamURI, err := client.GetStreamURI(ctx, profile.Token)
        if err != nil {
            log.Fatal(err)
        }
        fmt.Printf("      Stream: %s\n", streamURI.URI)
    }

    // PTZ control (if available)
    if len(profiles) > 0 && profiles[0].PTZConfiguration != nil {
        profileToken := profiles[0].Token
        
        // Get PTZ status
        status, err := client.GetStatus(ctx, profileToken)
        if err != nil {
            log.Fatal(err)
        }
        fmt.Printf("PTZ Position: Pan=%.2f, Tilt=%.2f, Zoom=%.2f\n",
            status.Position.PanTilt.X,
            status.Position.PanTilt.Y,
            status.Position.Zoom.X)
        
        // Move to home position
        position := &onvif.PTZVector{
            PanTilt: &onvif.Vector2D{X: 0.0, Y: 0.0},
            Zoom:    &onvif.Vector1D{X: 0.0},
        }
        if err := client.AbsoluteMove(ctx, profileToken, position, nil); err != nil {
            log.Fatal(err)
        }
        fmt.Println("Moved to home position")
    }
}

Examples

See the examples/onvif-server directory for a complete multi-lens camera configuration example.

# Run the example
cd examples/onvif-server
go run main.go

This example demonstrates:

  • 4 different camera profiles (4K main, wide-angle, telephoto, low-light)
  • PTZ control with multiple presets
  • Different resolutions and framerates
  • Custom device information

Use Cases

🧪 Testing & Development
  • Test ONVIF client implementations
  • Simulate multi-camera setups
  • Develop video management systems
  • Integration testing without physical cameras
📚 Learning & Education
  • Understand ONVIF protocol
  • Learn SOAP web services
  • Study IP camera architectures
  • Prototype camera systems
🎭 Demonstrations
  • Demo video surveillance solutions
  • Showcase camera management software
  • Present multi-camera scenarios
  • Trade show demonstrations
🔬 Research & Prototyping
  • Computer vision research
  • Video analytics development
  • Stream processing pipelines
  • AI/ML model training

Architecture

The server is built with a modular architecture:

server/
├── types.go           # Core data types and configuration
├── server.go          # Main server implementation
├── device.go          # Device service handlers
├── media.go           # Media service handlers
├── ptz.go             # PTZ service handlers
├── imaging.go         # Imaging service handlers
└── soap/
    └── handler.go     # SOAP message handling
Key Components
  1. Server Core: HTTP server, request routing, lifecycle management
  2. SOAP Handler: SOAP message parsing, authentication, response formatting
  3. Service Handlers: Device, Media, PTZ, Imaging service implementations
  4. State Management: PTZ positions, imaging settings, stream configurations

RTSP Streaming

The server provides RTSP URIs for each profile:

rtsp://localhost:8554/stream0  # Profile 0
rtsp://localhost:8554/stream1  # Profile 1
rtsp://localhost:8554/stream2  # Profile 2
...

Note: The current implementation returns RTSP URIs but does not include an actual RTSP server. To provide real video streams, integrate with:

Roadmap

  • Events Service: Event subscription and notification
  • Recording Service: Recording management
  • Analytics Service: Video analytics support
  • Actual RTSP Streaming: Integrated RTSP server with test patterns
  • Web UI: Browser-based configuration and monitoring
  • Docker Support: Containerized deployment
  • Configuration Files: YAML/JSON configuration support
  • WS-Discovery: Automatic device discovery on network
  • TLS Support: HTTPS and secure RTSP
  • Audio Support: Audio streaming and configuration

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

  • Built on top of the onvif-go client library
  • ONVIF specifications from ONVIF.org
  • Inspired by the need for flexible camera simulation in development workflows

Note: This is a virtual camera server for testing and development. It simulates ONVIF protocol responses but does not capture or stream real video unless integrated with an RTSP server.

Documentation

Overview

Package server provides ONVIF server implementation for testing and simulation.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrVideoSourceNotFound is returned when a video source is not found.
	ErrVideoSourceNotFound = errors.New("video source not found")

	// ErrProfileNotFound is returned when a profile is not found.
	ErrProfileNotFound = errors.New("profile not found")

	// ErrSnapshotNotSupported is returned when snapshot is not supported for a profile.
	ErrSnapshotNotSupported = errors.New("snapshot not supported for profile")

	// ErrPTZNotSupported is returned when PTZ is not supported for a profile.
	ErrPTZNotSupported = errors.New("PTZ not supported for profile")

	// ErrPresetNotFound is returned when a preset is not found.
	ErrPresetNotFound = errors.New("preset not found")
)

Functions

This section is empty.

Types

type AbsoluteFocus

type AbsoluteFocus struct {
	Position float64  `xml:"Position"`
	Speed    *float64 `xml:"Speed,omitempty"`
}

AbsoluteFocus represents absolute focus.

type AbsoluteMoveRequest

type AbsoluteMoveRequest struct {
	XMLName      xml.Name  `xml:"http://www.onvif.org/ver20/ptz/wsdl AbsoluteMove"`
	ProfileToken string    `xml:"ProfileToken"`
	Position     PTZVector `xml:"Position"`
	Speed        PTZVector `xml:"Speed,omitempty"`
}

AbsoluteMoveRequest represents AbsoluteMove request.

type AbsoluteMoveResponse

type AbsoluteMoveResponse struct {
	XMLName xml.Name `xml:"http://www.onvif.org/ver20/ptz/wsdl AbsoluteMoveResponse"`
}

AbsoluteMoveResponse represents AbsoluteMove response.

type AnalyticsCapabilities

type AnalyticsCapabilities struct {
	XAddr                  string `xml:"XAddr"`
	RuleSupport            bool   `xml:"RuleSupport,attr"`
	AnalyticsModuleSupport bool   `xml:"AnalyticsModuleSupport,attr"`
}

AnalyticsCapabilities represents analytics service capabilities.

type AudioEncoderConfig

type AudioEncoderConfig struct {
	Encoding   string // G711, G726, AAC
	Bitrate    int    // Bitrate in kbps
	SampleRate int    // Sample rate in Hz
}

AudioEncoderConfig represents audio encoder configuration.

type AudioEncoderConfiguration

type AudioEncoderConfiguration struct {
	Token          string                  `xml:"token,attr"`
	Name           string                  `xml:"Name"`
	UseCount       int                     `xml:"UseCount"`
	Encoding       string                  `xml:"Encoding"`
	Bitrate        int                     `xml:"Bitrate"`
	SampleRate     int                     `xml:"SampleRate"`
	Multicast      *MulticastConfiguration `xml:"Multicast,omitempty"`
	SessionTimeout string                  `xml:"SessionTimeout"`
}

AudioEncoderConfiguration represents audio encoder configuration.

type AudioSourceConfig

type AudioSourceConfig struct {
	Token      string // Audio source token
	Name       string // Audio source name
	SampleRate int    // Sample rate in Hz (e.g., 8000, 16000, 48000)
	Bitrate    int    // Bitrate in kbps
}

AudioSourceConfig represents audio source configuration.

type AudioSourceConfiguration

type AudioSourceConfiguration struct {
	Token       string `xml:"token,attr"`
	Name        string `xml:"Name"`
	UseCount    int    `xml:"UseCount"`
	SourceToken string `xml:"SourceToken"`
}

AudioSourceConfiguration represents audio source configuration.

type BacklightCompensation

type BacklightCompensation struct {
	Mode  string  // OFF, ON
	Level float64 // 0-100
}

BacklightCompensation represents backlight compensation settings.

type BacklightCompensationOptions

type BacklightCompensationOptions struct {
	Mode  []string    `xml:"Mode"`
	Level *FloatRange `xml:"Level,omitempty"`
}

BacklightCompensationOptions represents backlight compensation options.

type BacklightCompensationSettings

type BacklightCompensationSettings struct {
	Mode  string   `xml:"Mode"`
	Level *float64 `xml:"Level,omitempty"`
}

BacklightCompensationSettings represents backlight compensation settings.

type Bounds

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

Bounds represents video bounds.

type Capabilities

type Capabilities struct {
	Analytics *AnalyticsCapabilities `xml:"Analytics,omitempty"`
	Device    *DeviceCapabilities    `xml:"Device"`
	Events    *EventCapabilities     `xml:"Events,omitempty"`
	Imaging   *ImagingCapabilities   `xml:"Imaging,omitempty"`
	Media     *MediaCapabilities     `xml:"Media"`
	PTZ       *PTZCapabilities       `xml:"PTZ,omitempty"`
}

Capabilities represents device capabilities.

type Config

type Config struct {
	// Server settings
	Host     string        // Bind address (e.g., "0.0.0.0")
	Port     int           // Server port (default: 8080)
	BasePath string        // Base path for services (default: "/onvif")
	Timeout  time.Duration // Request timeout

	// Device information
	DeviceInfo DeviceInfo

	// Authentication
	Username string
	Password string

	// Camera profiles (supports multi-lens cameras)
	Profiles []ProfileConfig

	// Capabilities
	SupportPTZ     bool
	SupportImaging bool
	SupportEvents  bool
}

Config represents the ONVIF server configuration.

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig returns a default server configuration with a multi-lens camera setup.

func (*Config) ServiceEndpoints

func (c *Config) ServiceEndpoints(host string) map[string]string

ServiceEndpoints returns the service endpoint URLs.

type ContinuousFocus

type ContinuousFocus struct {
	Speed float64 `xml:"Speed"`
}

ContinuousFocus represents continuous focus.

type ContinuousMoveRequest

type ContinuousMoveRequest struct {
	XMLName      xml.Name  `xml:"http://www.onvif.org/ver20/ptz/wsdl ContinuousMove"`
	ProfileToken string    `xml:"ProfileToken"`
	Velocity     PTZVector `xml:"Velocity"`
	Timeout      string    `xml:"Timeout,omitempty"`
}

ContinuousMoveRequest represents ContinuousMove request.

type ContinuousMoveResponse

type ContinuousMoveResponse struct {
	XMLName xml.Name `xml:"http://www.onvif.org/ver20/ptz/wsdl ContinuousMoveResponse"`
}

ContinuousMoveResponse represents ContinuousMove response.

type DeviceCapabilities

type DeviceCapabilities struct {
	XAddr    string                `xml:"XAddr"`
	Network  *NetworkCapabilities  `xml:"Network,omitempty"`
	System   *SystemCapabilities   `xml:"System,omitempty"`
	IO       *IOCapabilities       `xml:"IO,omitempty"`
	Security *SecurityCapabilities `xml:"Security,omitempty"`
}

DeviceCapabilities represents device service capabilities.

type DeviceInfo

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

DeviceInfo contains device identification information.

type EventCapabilities

type EventCapabilities struct {
	XAddr                         string `xml:"XAddr"`
	WSSubscriptionPolicySupport   bool   `xml:"WSSubscriptionPolicySupport,attr"`
	WSPullPointSupport            bool   `xml:"WSPullPointSupport,attr"`
	WSPausableSubscriptionSupport bool   `xml:"WSPausableSubscriptionManagerInterfaceSupport,attr"`
}

EventCapabilities represents event service capabilities.

type ExposureOptions

type ExposureOptions struct {
	Mode            []string    `xml:"Mode"`
	Priority        []string    `xml:"Priority,omitempty"`
	MinExposureTime *FloatRange `xml:"MinExposureTime,omitempty"`
	MaxExposureTime *FloatRange `xml:"MaxExposureTime,omitempty"`
	MinGain         *FloatRange `xml:"MinGain,omitempty"`
	MaxGain         *FloatRange `xml:"MaxGain,omitempty"`
	MinIris         *FloatRange `xml:"MinIris,omitempty"`
	MaxIris         *FloatRange `xml:"MaxIris,omitempty"`
	ExposureTime    *FloatRange `xml:"ExposureTime,omitempty"`
	Gain            *FloatRange `xml:"Gain,omitempty"`
	Iris            *FloatRange `xml:"Iris,omitempty"`
}

ExposureOptions represents exposure options.

type ExposureSettings

type ExposureSettings struct {
	Mode         string // AUTO, MANUAL
	Priority     string // LowNoise, FrameRate
	MinExposure  float64
	MaxExposure  float64
	MinGain      float64
	MaxGain      float64
	ExposureTime float64
	Gain         float64
}

ExposureSettings represents exposure settings.

type ExposureSettings20

type ExposureSettings20 struct {
	Mode            string     `xml:"Mode"`
	Priority        *string    `xml:"Priority,omitempty"`
	Window          *Rectangle `xml:"Window,omitempty"`
	MinExposureTime *float64   `xml:"MinExposureTime,omitempty"`
	MaxExposureTime *float64   `xml:"MaxExposureTime,omitempty"`
	MinGain         *float64   `xml:"MinGain,omitempty"`
	MaxGain         *float64   `xml:"MaxGain,omitempty"`
	MinIris         *float64   `xml:"MinIris,omitempty"`
	MaxIris         *float64   `xml:"MaxIris,omitempty"`
	ExposureTime    *float64   `xml:"ExposureTime,omitempty"`
	Gain            *float64   `xml:"Gain,omitempty"`
	Iris            *float64   `xml:"Iris,omitempty"`
}

ExposureSettings20 represents exposure settings for ONVIF 2.0.

type FloatRange

type FloatRange struct {
	Min float64 `xml:"Min"`
	Max float64 `xml:"Max"`
}

FloatRange represents a float range.

type FocusConfiguration20

type FocusConfiguration20 struct {
	AutoFocusMode string   `xml:"AutoFocusMode"`
	DefaultSpeed  *float64 `xml:"DefaultSpeed,omitempty"`
	NearLimit     *float64 `xml:"NearLimit,omitempty"`
	FarLimit      *float64 `xml:"FarLimit,omitempty"`
}

FocusConfiguration20 represents focus configuration for ONVIF 2.0.

type FocusMove

type FocusMove struct {
	Absolute   *AbsoluteFocus   `xml:"Absolute,omitempty"`
	Relative   *RelativeFocus   `xml:"Relative,omitempty"`
	Continuous *ContinuousFocus `xml:"Continuous,omitempty"`
}

FocusMove represents focus move parameters.

type FocusOptions

type FocusOptions struct {
	AutoFocusModes []string    `xml:"AutoFocusModes"`
	DefaultSpeed   *FloatRange `xml:"DefaultSpeed,omitempty"`
	NearLimit      *FloatRange `xml:"NearLimit,omitempty"`
	FarLimit       *FloatRange `xml:"FarLimit,omitempty"`
}

FocusOptions represents focus options.

type FocusSettings

type FocusSettings struct {
	AutoFocusMode string // AUTO, MANUAL
	DefaultSpeed  float64
	NearLimit     float64
	FarLimit      float64
	CurrentPos    float64
}

FocusSettings represents focus settings.

type GetCapabilitiesResponse

type GetCapabilitiesResponse struct {
	XMLName      xml.Name      `xml:"http://www.onvif.org/ver10/device/wsdl GetCapabilitiesResponse"`
	Capabilities *Capabilities `xml:"Capabilities"`
}

GetCapabilitiesResponse represents GetCapabilities response.

type GetConfigurationsResponse

type GetConfigurationsResponse struct {
	XMLName          xml.Name              `xml:"http://www.onvif.org/ver20/ptz/wsdl GetConfigurationsResponse"`
	PTZConfiguration []PTZConfigurationExt `xml:"PTZConfiguration"`
}

GetConfigurationsResponse represents GetConfigurations response.

type GetDeviceInformationResponse

type GetDeviceInformationResponse struct {
	XMLName         xml.Name `xml:"http://www.onvif.org/ver10/device/wsdl GetDeviceInformationResponse"`
	Manufacturer    string   `xml:"Manufacturer"`
	Model           string   `xml:"Model"`
	FirmwareVersion string   `xml:"FirmwareVersion"`
	SerialNumber    string   `xml:"SerialNumber"`
	HardwareID      string   `xml:"HardwareId"`
}

GetDeviceInformationResponse represents GetDeviceInformation response.

type GetImagingSettingsRequest

type GetImagingSettingsRequest struct {
	XMLName          xml.Name `xml:"http://www.onvif.org/ver20/imaging/wsdl GetImagingSettings"`
	VideoSourceToken string   `xml:"VideoSourceToken"`
}

GetImagingSettingsRequest represents GetImagingSettings request.

type GetImagingSettingsResponse

type GetImagingSettingsResponse struct {
	XMLName         xml.Name         `xml:"http://www.onvif.org/ver20/imaging/wsdl GetImagingSettingsResponse"`
	ImagingSettings *ImagingSettings `xml:"ImagingSettings"`
}

GetImagingSettingsResponse represents GetImagingSettings response.

type GetOptionsRequest

type GetOptionsRequest struct {
	XMLName          xml.Name `xml:"http://www.onvif.org/ver20/imaging/wsdl GetOptions"`
	VideoSourceToken string   `xml:"VideoSourceToken"`
}

GetOptionsRequest represents GetOptions request.

type GetOptionsResponse

type GetOptionsResponse struct {
	XMLName        xml.Name        `xml:"http://www.onvif.org/ver20/imaging/wsdl GetOptionsResponse"`
	ImagingOptions *ImagingOptions `xml:"ImagingOptions"`
}

GetOptionsResponse represents GetOptions response.

type GetPresetsRequest

type GetPresetsRequest struct {
	XMLName      xml.Name `xml:"http://www.onvif.org/ver20/ptz/wsdl GetPresets"`
	ProfileToken string   `xml:"ProfileToken"`
}

GetPresetsRequest represents GetPresets request.

type GetPresetsResponse

type GetPresetsResponse struct {
	XMLName xml.Name    `xml:"http://www.onvif.org/ver20/ptz/wsdl GetPresetsResponse"`
	Preset  []PTZPreset `xml:"Preset"`
}

GetPresetsResponse represents GetPresets response.

type GetProfilesResponse

type GetProfilesResponse struct {
	XMLName  xml.Name       `xml:"http://www.onvif.org/ver10/media/wsdl GetProfilesResponse"`
	Profiles []MediaProfile `xml:"Profiles"`
}

GetProfilesResponse represents GetProfiles response.

type GetServicesResponse

type GetServicesResponse struct {
	XMLName xml.Name  `xml:"http://www.onvif.org/ver10/device/wsdl GetServicesResponse"`
	Service []Service `xml:"Service"`
}

GetServicesResponse represents GetServices response.

type GetSnapshotURIResponse

type GetSnapshotURIResponse struct {
	XMLName  xml.Name `xml:"http://www.onvif.org/ver10/media/wsdl GetSnapshotURIResponse"`
	MediaURI MediaURI `xml:"MediaUri"`
}

GetSnapshotURIResponse represents GetSnapshotURI response.

type GetStatusRequest

type GetStatusRequest struct {
	XMLName      xml.Name `xml:"http://www.onvif.org/ver20/ptz/wsdl GetStatus"`
	ProfileToken string   `xml:"ProfileToken"`
}

GetStatusRequest represents GetStatus request.

type GetStatusResponse

type GetStatusResponse struct {
	XMLName   xml.Name   `xml:"http://www.onvif.org/ver20/ptz/wsdl GetStatusResponse"`
	PTZStatus *PTZStatus `xml:"PTZStatus"`
}

GetStatusResponse represents GetStatus response.

type GetStreamURIResponse

type GetStreamURIResponse struct {
	XMLName  xml.Name `xml:"http://www.onvif.org/ver10/media/wsdl GetStreamURIResponse"`
	MediaURI MediaURI `xml:"MediaUri"`
}

GetStreamURIResponse represents GetStreamURI response.

type GetVideoSourcesResponse

type GetVideoSourcesResponse struct {
	XMLName      xml.Name      `xml:"http://www.onvif.org/ver10/media/wsdl GetVideoSourcesResponse"`
	VideoSources []VideoSource `xml:"VideoSources"`
}

GetVideoSourcesResponse represents GetVideoSources response.

type GotoPresetRequest

type GotoPresetRequest struct {
	XMLName      xml.Name  `xml:"http://www.onvif.org/ver20/ptz/wsdl GotoPreset"`
	ProfileToken string    `xml:"ProfileToken"`
	PresetToken  string    `xml:"PresetToken"`
	Speed        PTZVector `xml:"Speed,omitempty"`
}

GotoPresetRequest represents GotoPreset request.

type GotoPresetResponse

type GotoPresetResponse struct {
	XMLName xml.Name `xml:"http://www.onvif.org/ver20/ptz/wsdl GotoPresetResponse"`
}

GotoPresetResponse represents GotoPreset response.

type H264Configuration

type H264Configuration struct {
	GovLength   int    `xml:"GovLength"`
	H264Profile string `xml:"H264Profile"`
}

H264Configuration represents H264 configuration.

type IOCapabilities

type IOCapabilities struct {
	InputConnectors int `xml:"InputConnectors,attr"`
	RelayOutputs    int `xml:"RelayOutputs,attr"`
}

IOCapabilities represents I/O capabilities.

type IPAddress

type IPAddress struct {
	Type        string `xml:"Type"`
	IPv4Address string `xml:"IPv4Address,omitempty"`
	IPv6Address string `xml:"IPv6Address,omitempty"`
}

IPAddress represents an IP address.

type ImagingCapabilities

type ImagingCapabilities struct {
	XAddr string `xml:"XAddr"`
}

ImagingCapabilities represents imaging service capabilities.

type ImagingOptions

type ImagingOptions struct {
	BacklightCompensation *BacklightCompensationOptions `xml:"BacklightCompensation,omitempty"`
	Brightness            *FloatRange                   `xml:"Brightness,omitempty"`
	ColorSaturation       *FloatRange                   `xml:"ColorSaturation,omitempty"`
	Contrast              *FloatRange                   `xml:"Contrast,omitempty"`
	Exposure              *ExposureOptions              `xml:"Exposure,omitempty"`
	Focus                 *FocusOptions                 `xml:"Focus,omitempty"`
	IrCutFilterModes      []string                      `xml:"IrCutFilterModes,omitempty"`
	Sharpness             *FloatRange                   `xml:"Sharpness,omitempty"`
	WideDynamicRange      *WideDynamicRangeOptions      `xml:"WideDynamicRange,omitempty"`
	WhiteBalance          *WhiteBalanceOptions          `xml:"WhiteBalance,omitempty"`
}

ImagingOptions represents imaging options/capabilities.

type ImagingSettings

type ImagingSettings struct {
	BacklightCompensation *BacklightCompensationSettings `xml:"BacklightCompensation,omitempty"`
	Brightness            *float64                       `xml:"Brightness,omitempty"`
	ColorSaturation       *float64                       `xml:"ColorSaturation,omitempty"`
	Contrast              *float64                       `xml:"Contrast,omitempty"`
	Exposure              *ExposureSettings20            `xml:"Exposure,omitempty"`
	Focus                 *FocusConfiguration20          `xml:"Focus,omitempty"`
	IrCutFilter           *string                        `xml:"IrCutFilter,omitempty"`
	Sharpness             *float64                       `xml:"Sharpness,omitempty"`
	WideDynamicRange      *WideDynamicRangeSettings      `xml:"WideDynamicRange,omitempty"`
	WhiteBalance          *WhiteBalanceSettings20        `xml:"WhiteBalance,omitempty"`
}

ImagingSettings represents imaging settings.

type ImagingState

type ImagingState struct {
	Brightness       float64
	Contrast         float64
	Saturation       float64
	Sharpness        float64
	BacklightComp    BacklightCompensation
	Exposure         ExposureSettings
	Focus            FocusSettings
	WhiteBalance     WhiteBalanceSettings
	WideDynamicRange WDRSettings
	IrCutFilter      string // ON, OFF, AUTO
}

ImagingState represents the current imaging settings state.

type IntRectangle

type IntRectangle struct {
	X      int `xml:"x,attr"`
	Y      int `xml:"y,attr"`
	Width  int `xml:"width,attr"`
	Height int `xml:"height,attr"`
}

IntRectangle represents a rectangle with integer coordinates.

type MediaCapabilities

type MediaCapabilities struct {
	XAddr                 string                 `xml:"XAddr"`
	StreamingCapabilities *StreamingCapabilities `xml:"StreamingCapabilities"`
}

MediaCapabilities represents media service capabilities.

type MediaProfile

type MediaProfile struct {
	Token                       string                       `xml:"token,attr"`
	Fixed                       bool                         `xml:"fixed,attr"`
	Name                        string                       `xml:"Name"`
	VideoSourceConfiguration    *VideoSourceConfiguration    `xml:"VideoSourceConfiguration"`
	AudioSourceConfiguration    *AudioSourceConfiguration    `xml:"AudioSourceConfiguration,omitempty"`
	VideoEncoderConfiguration   *VideoEncoderConfiguration   `xml:"VideoEncoderConfiguration"`
	AudioEncoderConfiguration   *AudioEncoderConfiguration   `xml:"AudioEncoderConfiguration,omitempty"`
	VideoAnalyticsConfiguration *VideoAnalyticsConfiguration `xml:"VideoAnalyticsConfiguration,omitempty"`
	PTZConfiguration            *PTZConfiguration            `xml:"PTZConfiguration,omitempty"`
	MetadataConfiguration       *MetadataConfiguration       `xml:"MetadataConfiguration,omitempty"`
}

MediaProfile represents a media profile.

type MediaURI added in v1.1.4

type MediaURI struct {
	URI                 string `xml:"Uri"`
	InvalidAfterConnect bool   `xml:"InvalidAfterConnect"`
	InvalidAfterReboot  bool   `xml:"InvalidAfterReboot"`
	Timeout             string `xml:"Timeout"`
}

MediaURI represents a media URI.

type MetadataConfiguration

type MetadataConfiguration struct {
	Token          string `xml:"token,attr"`
	Name           string `xml:"Name"`
	UseCount       int    `xml:"UseCount"`
	SessionTimeout string `xml:"SessionTimeout"`
}

MetadataConfiguration represents metadata configuration.

type MoveRequest

type MoveRequest struct {
	XMLName          xml.Name   `xml:"http://www.onvif.org/ver20/imaging/wsdl Move"`
	VideoSourceToken string     `xml:"VideoSourceToken"`
	Focus            *FocusMove `xml:"Focus"`
}

MoveRequest represents Move (focus) request.

type MoveResponse

type MoveResponse struct {
	XMLName xml.Name `xml:"http://www.onvif.org/ver20/imaging/wsdl MoveResponse"`
}

MoveResponse represents Move response.

type MulticastConfiguration

type MulticastConfiguration struct {
	Address   IPAddress `xml:"Address"`
	Port      int       `xml:"Port"`
	TTL       int       `xml:"TTL"`
	AutoStart bool      `xml:"AutoStart"`
}

MulticastConfiguration represents multicast configuration.

type NetworkCapabilities

type NetworkCapabilities struct {
	IPFilter          bool `xml:"IPFilter,attr"`
	ZeroConfiguration bool `xml:"ZeroConfiguration,attr"`
	IPVersion6        bool `xml:"IPVersion6,attr"`
	DynDNS            bool `xml:"DynDNS,attr"`
}

NetworkCapabilities represents network capabilities.

type PTZCapabilities

type PTZCapabilities struct {
	XAddr string `xml:"XAddr"`
}

PTZCapabilities represents PTZ service capabilities.

type PTZConfig

type PTZConfig struct {
	NodeToken          string   // PTZ node token
	PanRange           Range    // Pan range in degrees
	TiltRange          Range    // Tilt range in degrees
	ZoomRange          Range    // Zoom range
	DefaultSpeed       PTZSpeed // Default speed
	SupportsContinuous bool     // Supports continuous move
	SupportsAbsolute   bool     // Supports absolute move
	SupportsRelative   bool     // Supports relative move
	Presets            []Preset // Predefined presets
}

PTZConfig represents PTZ configuration.

type PTZConfiguration

type PTZConfiguration struct {
	Token     string `xml:"token,attr"`
	Name      string `xml:"Name"`
	UseCount  int    `xml:"UseCount"`
	NodeToken string `xml:"NodeToken"`
}

PTZConfiguration represents PTZ configuration.

type PTZConfigurationExt

type PTZConfigurationExt struct {
	Token         string         `xml:"token,attr"`
	Name          string         `xml:"Name"`
	UseCount      int            `xml:"UseCount"`
	NodeToken     string         `xml:"NodeToken"`
	PanTiltLimits *PanTiltLimits `xml:"PanTiltLimits,omitempty"`
	ZoomLimits    *ZoomLimits    `xml:"ZoomLimits,omitempty"`
}

PTZConfigurationExt represents PTZ configuration with extensions.

type PTZMoveStatus

type PTZMoveStatus struct {
	PanTilt string `xml:"PanTilt,omitempty"`
	Zoom    string `xml:"Zoom,omitempty"`
}

PTZMoveStatus represents PTZ movement status.

type PTZPosition

type PTZPosition struct {
	Pan  float64 // Pan position
	Tilt float64 // Tilt position
	Zoom float64 // Zoom position
}

PTZPosition represents PTZ position.

type PTZPreset

type PTZPreset struct {
	Token       string     `xml:"token,attr"`
	Name        string     `xml:"Name"`
	PTZPosition *PTZVector `xml:"PTZPosition,omitempty"`
}

PTZPreset represents a PTZ preset.

type PTZSpeed

type PTZSpeed struct {
	Pan  float64 // Pan speed (-1.0 to 1.0)
	Tilt float64 // Tilt speed (-1.0 to 1.0)
	Zoom float64 // Zoom speed (-1.0 to 1.0)
}

PTZSpeed represents PTZ movement speed.

type PTZState

type PTZState struct {
	Position   PTZPosition
	Moving     bool
	PanMoving  bool
	TiltMoving bool
	ZoomMoving bool
	LastUpdate time.Time
}

PTZState represents the current PTZ state.

type PTZStatus

type PTZStatus struct {
	Position   PTZVector     `xml:"Position"`
	MoveStatus PTZMoveStatus `xml:"MoveStatus"`
	UTCTime    string        `xml:"UtcTime"`
}

PTZStatus represents PTZ status.

type PTZVector

type PTZVector struct {
	PanTilt *Vector2D `xml:"PanTilt,omitempty"`
	Zoom    *Vector1D `xml:"Zoom,omitempty"`
}

PTZVector represents PTZ position/velocity.

type PanTiltLimits

type PanTiltLimits struct {
	Range Space2DDescription `xml:"Range"`
}

PanTiltLimits represents pan/tilt limits.

type Preset

type Preset struct {
	Token    string      // Preset token
	Name     string      // Preset name
	Position PTZPosition // Position
}

Preset represents a PTZ preset position.

type ProfileConfig

type ProfileConfig struct {
	Token        string              // Profile token (unique identifier)
	Name         string              // Profile name
	VideoSource  VideoSourceConfig   // Video source configuration
	AudioSource  *AudioSourceConfig  // Audio source configuration (optional)
	VideoEncoder VideoEncoderConfig  // Video encoder configuration
	AudioEncoder *AudioEncoderConfig // Audio encoder configuration (optional)
	PTZ          *PTZConfig          // PTZ configuration (optional)
	Snapshot     SnapshotConfig      // Snapshot configuration
}

ProfileConfig represents a camera profile configuration.

func (*ProfileConfig) ToONVIFProfile

func (p *ProfileConfig) ToONVIFProfile() *onvif.Profile

ToONVIFProfile converts a ProfileConfig to an ONVIF Profile.

type Range

type Range struct {
	Min float64
	Max float64
}

Range represents a numeric range.

type Rectangle

type Rectangle struct {
	Bottom float64 `xml:"bottom,attr"`
	Top    float64 `xml:"top,attr"`
	Right  float64 `xml:"right,attr"`
	Left   float64 `xml:"left,attr"`
}

Rectangle represents a rectangle.

type RelativeFocus

type RelativeFocus struct {
	Distance float64  `xml:"Distance"`
	Speed    *float64 `xml:"Speed,omitempty"`
}

RelativeFocus represents relative focus.

type RelativeMoveRequest

type RelativeMoveRequest struct {
	XMLName      xml.Name  `xml:"http://www.onvif.org/ver20/ptz/wsdl RelativeMove"`
	ProfileToken string    `xml:"ProfileToken"`
	Translation  PTZVector `xml:"Translation"`
	Speed        PTZVector `xml:"Speed,omitempty"`
}

RelativeMoveRequest represents RelativeMove request.

type RelativeMoveResponse

type RelativeMoveResponse struct {
	XMLName xml.Name `xml:"http://www.onvif.org/ver20/ptz/wsdl RelativeMoveResponse"`
}

RelativeMoveResponse represents RelativeMove response.

type Resolution

type Resolution struct {
	Width  int
	Height int
}

Resolution represents video resolution.

type SecurityCapabilities

type SecurityCapabilities struct {
	TLS11                bool `xml:"TLS1.1,attr"`
	TLS12                bool `xml:"TLS1.2,attr"`
	OnboardKeyGeneration bool `xml:"OnboardKeyGeneration,attr"`
	AccessPolicyConfig   bool `xml:"AccessPolicyConfig,attr"`
	X509Token            bool `xml:"X.509Token,attr"`
	SAMLToken            bool `xml:"SAMLToken,attr"`
	KerberosToken        bool `xml:"KerberosToken,attr"`
	RELToken             bool `xml:"RELToken,attr"`
}

SecurityCapabilities represents security capabilities.

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server represents the ONVIF server.

func New

func New(config *Config) (*Server, error)

New creates a new ONVIF server with the given configuration.

func (*Server) GetConfig

func (s *Server) GetConfig() *Config

GetConfig returns the server configuration.

func (*Server) GetImagingState

func (s *Server) GetImagingState(videoSourceToken string) (*ImagingState, bool)

GetImagingState returns the current imaging state for a video source.

func (*Server) GetPTZState

func (s *Server) GetPTZState(profileToken string) (*PTZState, bool)

GetPTZState returns the current PTZ state for a profile.

func (*Server) GetStreamConfig

func (s *Server) GetStreamConfig(profileToken string) (*StreamConfig, bool)

GetStreamConfig returns the stream configuration for a profile.

func (*Server) HandleAbsoluteMove

func (s *Server) HandleAbsoluteMove(body interface{}) (interface{}, error)

HandleAbsoluteMove handles AbsoluteMove request.

func (*Server) HandleContinuousMove

func (s *Server) HandleContinuousMove(body interface{}) (interface{}, error)

HandleContinuousMove handles ContinuousMove request.

func (*Server) HandleGetCapabilities

func (s *Server) HandleGetCapabilities(body interface{}) (interface{}, error)

HandleGetCapabilities handles GetCapabilities request.

func (*Server) HandleGetDeviceInformation

func (s *Server) HandleGetDeviceInformation(body interface{}) (interface{}, error)

HandleGetDeviceInformation handles GetDeviceInformation request.

func (*Server) HandleGetImagingSettings

func (s *Server) HandleGetImagingSettings(body interface{}) (interface{}, error)

HandleGetImagingSettings handles GetImagingSettings request.

func (*Server) HandleGetOptions

func (s *Server) HandleGetOptions(body interface{}) (interface{}, error)

HandleGetOptions handles GetOptions request.

func (*Server) HandleGetPresets

func (s *Server) HandleGetPresets(body interface{}) (interface{}, error)

HandleGetPresets handles GetPresets request.

func (*Server) HandleGetProfiles

func (s *Server) HandleGetProfiles(body interface{}) (interface{}, error)

HandleGetProfiles handles GetProfiles request.

func (*Server) HandleGetServices

func (s *Server) HandleGetServices(body interface{}) (interface{}, error)

HandleGetServices handles GetServices request.

func (*Server) HandleGetSnapshotURI

func (s *Server) HandleGetSnapshotURI(body interface{}) (interface{}, error)

HandleGetSnapshotURI handles GetSnapshotURI request.

func (*Server) HandleGetStatus

func (s *Server) HandleGetStatus(body interface{}) (interface{}, error)

HandleGetStatus handles GetStatus request.

func (*Server) HandleGetStreamURI

func (s *Server) HandleGetStreamURI(body interface{}) (interface{}, error)

HandleGetStreamURI handles GetStreamURI request.

func (*Server) HandleGetSystemDateAndTime

func (s *Server) HandleGetSystemDateAndTime(body interface{}) (interface{}, error)

HandleGetSystemDateAndTime handles GetSystemDateAndTime request.

func (*Server) HandleGetVideoSources

func (s *Server) HandleGetVideoSources(body interface{}) (interface{}, error)

HandleGetVideoSources handles GetVideoSources request.

func (*Server) HandleGotoPreset

func (s *Server) HandleGotoPreset(body interface{}) (interface{}, error)

HandleGotoPreset handles GotoPreset request.

func (*Server) HandleMove

func (s *Server) HandleMove(body interface{}) (interface{}, error)

HandleMove handles Move (focus) request.

func (*Server) HandleRelativeMove

func (s *Server) HandleRelativeMove(body interface{}) (interface{}, error)

HandleRelativeMove handles RelativeMove request.

func (*Server) HandleSetImagingSettings

func (s *Server) HandleSetImagingSettings(body interface{}) (interface{}, error)

HandleSetImagingSettings handles SetImagingSettings request.

func (*Server) HandleStop

func (s *Server) HandleStop(body interface{}) (interface{}, error)

HandleStop handles Stop request.

func (*Server) HandleSystemReboot

func (s *Server) HandleSystemReboot(body interface{}) (interface{}, error)

HandleSystemReboot handles SystemReboot request.

func (*Server) ListProfiles

func (s *Server) ListProfiles() []ProfileConfig

ListProfiles returns all configured profiles.

func (*Server) ServerInfo

func (s *Server) ServerInfo() string

ServerInfo returns human-readable server information.

func (*Server) Start

func (s *Server) Start(ctx context.Context) error

Start starts the ONVIF server.

func (*Server) UpdateStreamURI

func (s *Server) UpdateStreamURI(profileToken, uri string) error

UpdateStreamURI updates the RTSP URI for a profile.

type Service

type Service struct {
	Namespace string  `xml:"Namespace"`
	XAddr     string  `xml:"XAddr"`
	Version   Version `xml:"Version"`
}

Service represents a service.

type SetImagingSettingsRequest

type SetImagingSettingsRequest struct {
	XMLName          xml.Name         `xml:"http://www.onvif.org/ver20/imaging/wsdl SetImagingSettings"`
	VideoSourceToken string           `xml:"VideoSourceToken"`
	ImagingSettings  *ImagingSettings `xml:"ImagingSettings"`
	ForcePersistence bool             `xml:"ForcePersistence,omitempty"`
}

SetImagingSettingsRequest represents SetImagingSettings request.

type SetImagingSettingsResponse

type SetImagingSettingsResponse struct {
	XMLName xml.Name `xml:"http://www.onvif.org/ver20/imaging/wsdl SetImagingSettingsResponse"`
}

SetImagingSettingsResponse represents SetImagingSettings response.

type SetPresetRequest

type SetPresetRequest struct {
	XMLName      xml.Name `xml:"http://www.onvif.org/ver20/ptz/wsdl SetPreset"`
	ProfileToken string   `xml:"ProfileToken"`
	PresetName   string   `xml:"PresetName,omitempty"`
	PresetToken  string   `xml:"PresetToken,omitempty"`
}

SetPresetRequest represents SetPreset request.

type SetPresetResponse

type SetPresetResponse struct {
	XMLName     xml.Name `xml:"http://www.onvif.org/ver20/ptz/wsdl SetPresetResponse"`
	PresetToken string   `xml:"PresetToken"`
}

SetPresetResponse represents SetPreset response.

type SnapshotConfig

type SnapshotConfig struct {
	Enabled    bool       // Whether snapshots are supported
	Resolution Resolution // Snapshot resolution
	Quality    float64    // JPEG quality (0-100)
}

SnapshotConfig represents snapshot configuration.

type Space1DDescription

type Space1DDescription struct {
	URI    string     `xml:"URI"`
	XRange FloatRange `xml:"XRange"`
}

Space1DDescription represents 1D space description.

type Space2DDescription

type Space2DDescription struct {
	URI    string     `xml:"URI"`
	XRange FloatRange `xml:"XRange"`
	YRange FloatRange `xml:"YRange"`
}

Space2DDescription represents 2D space description.

type StopRequest

type StopRequest struct {
	XMLName      xml.Name `xml:"http://www.onvif.org/ver20/ptz/wsdl Stop"`
	ProfileToken string   `xml:"ProfileToken"`
	PanTilt      bool     `xml:"PanTilt,omitempty"`
	Zoom         bool     `xml:"Zoom,omitempty"`
}

StopRequest represents Stop request.

type StopResponse

type StopResponse struct {
	XMLName xml.Name `xml:"http://www.onvif.org/ver20/ptz/wsdl StopResponse"`
}

StopResponse represents Stop response.

type StreamConfig

type StreamConfig struct {
	ProfileToken string // Associated profile token
	RTSPPath     string // RTSP path (e.g., "/stream1")
	StreamURI    string // Full RTSP URI
}

StreamConfig represents an RTSP stream configuration.

type StreamingCapabilities

type StreamingCapabilities struct {
	RTPMulticast bool `xml:"RTPMulticast,attr"`
	RTPTCP       bool `xml:"RTP_TCP,attr"`
	RTPRTSPTCP   bool `xml:"RTP_RTSP_TCP,attr"`
}

StreamingCapabilities represents streaming capabilities.

type SystemCapabilities

type SystemCapabilities struct {
	DiscoveryResolve bool `xml:"DiscoveryResolve,attr"`
	DiscoveryBye     bool `xml:"DiscoveryBye,attr"`
	RemoteDiscovery  bool `xml:"RemoteDiscovery,attr"`
	SystemBackup     bool `xml:"SystemBackup,attr"`
	SystemLogging    bool `xml:"SystemLogging,attr"`
	FirmwareUpgrade  bool `xml:"FirmwareUpgrade,attr"`
}

SystemCapabilities represents system capabilities.

type SystemRebootResponse

type SystemRebootResponse struct {
	XMLName xml.Name `xml:"http://www.onvif.org/ver10/device/wsdl SystemRebootResponse"`
	Message string   `xml:"Message"`
}

SystemRebootResponse represents SystemReboot response.

type Vector1D

type Vector1D struct {
	X     float64 `xml:"x,attr"`
	Space string  `xml:"space,attr,omitempty"`
}

Vector1D represents a 1D vector.

type Vector2D

type Vector2D struct {
	X     float64 `xml:"x,attr"`
	Y     float64 `xml:"y,attr"`
	Space string  `xml:"space,attr,omitempty"`
}

Vector2D represents a 2D vector.

type Version

type Version struct {
	Major int `xml:"Major"`
	Minor int `xml:"Minor"`
}

Version represents service version.

type VideoAnalyticsConfiguration

type VideoAnalyticsConfiguration struct {
	Token    string `xml:"token,attr"`
	Name     string `xml:"Name"`
	UseCount int    `xml:"UseCount"`
}

VideoAnalyticsConfiguration represents video analytics configuration.

type VideoEncoderConfig

type VideoEncoderConfig struct {
	Encoding   string     // JPEG, H264, H265, MPEG4
	Resolution Resolution // Video resolution
	Quality    float64    // Quality (0-100)
	Framerate  int        // Frames per second
	Bitrate    int        // Bitrate in kbps
	GovLength  int        // GOP length
}

VideoEncoderConfig represents video encoder configuration.

type VideoEncoderConfiguration

type VideoEncoderConfiguration struct {
	Token          string                  `xml:"token,attr"`
	Name           string                  `xml:"Name"`
	UseCount       int                     `xml:"UseCount"`
	Encoding       string                  `xml:"Encoding"`
	Resolution     VideoResolution         `xml:"Resolution"`
	Quality        float64                 `xml:"Quality"`
	RateControl    *VideoRateControl       `xml:"RateControl,omitempty"`
	H264           *H264Configuration      `xml:"H264,omitempty"`
	Multicast      *MulticastConfiguration `xml:"Multicast,omitempty"`
	SessionTimeout string                  `xml:"SessionTimeout"`
}

VideoEncoderConfiguration represents video encoder configuration.

type VideoRateControl

type VideoRateControl struct {
	FrameRateLimit   int `xml:"FrameRateLimit"`
	EncodingInterval int `xml:"EncodingInterval"`
	BitrateLimit     int `xml:"BitrateLimit"`
}

VideoRateControl represents video rate control.

type VideoResolution

type VideoResolution struct {
	Width  int `xml:"Width"`
	Height int `xml:"Height"`
}

VideoResolution represents video resolution.

type VideoSource

type VideoSource struct {
	Token      string          `xml:"token,attr"`
	Framerate  float64         `xml:"Framerate"`
	Resolution VideoResolution `xml:"Resolution"`
}

VideoSource represents a video source.

type VideoSourceConfig

type VideoSourceConfig struct {
	Token      string // Video source token
	Name       string // Video source name
	Resolution Resolution
	Framerate  int
	Bounds     Bounds
}

VideoSourceConfig represents video source configuration.

type VideoSourceConfiguration

type VideoSourceConfiguration struct {
	Token       string       `xml:"token,attr"`
	Name        string       `xml:"Name"`
	UseCount    int          `xml:"UseCount"`
	SourceToken string       `xml:"SourceToken"`
	Bounds      IntRectangle `xml:"Bounds"`
}

VideoSourceConfiguration represents video source configuration.

type WDRSettings

type WDRSettings struct {
	Mode  string  // OFF, ON
	Level float64 // 0-100
}

WDRSettings represents wide dynamic range settings.

type WhiteBalanceOptions

type WhiteBalanceOptions struct {
	Mode   []string    `xml:"Mode"`
	YrGain *FloatRange `xml:"YrGain,omitempty"`
	YbGain *FloatRange `xml:"YbGain,omitempty"`
}

WhiteBalanceOptions represents white balance options.

type WhiteBalanceSettings

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

WhiteBalanceSettings represents white balance settings.

type WhiteBalanceSettings20

type WhiteBalanceSettings20 struct {
	Mode   string   `xml:"Mode"`
	CrGain *float64 `xml:"CrGain,omitempty"`
	CbGain *float64 `xml:"CbGain,omitempty"`
}

WhiteBalanceSettings20 represents white balance settings for ONVIF 2.0.

type WideDynamicRangeOptions

type WideDynamicRangeOptions struct {
	Mode  []string    `xml:"Mode"`
	Level *FloatRange `xml:"Level,omitempty"`
}

WideDynamicRangeOptions represents WDR options.

type WideDynamicRangeSettings

type WideDynamicRangeSettings struct {
	Mode  string   `xml:"Mode"`
	Level *float64 `xml:"Level,omitempty"`
}

WideDynamicRangeSettings represents WDR settings.

type ZoomLimits

type ZoomLimits struct {
	Range Space1DDescription `xml:"Range"`
}

ZoomLimits represents zoom limits.

Directories

Path Synopsis
Package soap provides SOAP request handling for the ONVIF server.
Package soap provides SOAP request handling for the ONVIF server.

Jump to

Keyboard shortcuts

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