Modern, high-performance Go library for ONVIF IP camera integration - Control surveillance cameras, NVRs, and video devices with comprehensive ONVIF Profile S/T/G support. Includes both client and server implementations for complete ONVIF camera simulation and testing.
A production-ready, feature-rich Go (Golang) library for communicating with ONVIF-compliant IP cameras, network video recorders (NVR), and surveillance devices. Perfect for building video management systems (VMS), security camera applications, IoT projects, and camera testing frameworks.
- ✅ ONVIF Client & Server - Both client library and virtual camera server
- ✅ Production Ready - Battle-tested with multiple camera brands
- ✅ Full Protocol Support - Device, Media, PTZ, Imaging, Discovery services
- ✅ Type Safe - Comprehensive Go types for all ONVIF operations
- ✅ Well Documented - Extensive examples and API documentation
- ✅ Camera Tested - Verified with Hikvision, Axis, Dahua, Bosch cameras
- ✅ Testing Framework - Built-in mock server and testing utilities
ONVIF (Open Network Video Interface Forum) is an open industry standard for IP-based security products. This library allows you to:
- 🎥 Control IP cameras from any manufacturer (Bosch, Hikvision, Axis, Dahua, etc.)
- 📹 Get RTSP video streams and snapshots
- 🎮 Pan, tilt, and zoom cameras remotely
- 🔧 Configure camera settings (exposure, focus, white balance)
- 🔍 Discover cameras on your network automatically
- 🧪 Test ONVIF implementations without physical hardware
✨ Modern Go Design
- Context support for cancellation and timeouts
- Concurrent-safe operations
- Type-safe API with comprehensive error handling
- Connection pooling for optimal performance
🎥 Comprehensive ONVIF Support
- Device Management: Get device info, capabilities, system date/time, reboot
- Media Services: Profiles, stream URIs (RTSP/HTTP), snapshot URIs, encoder configuration
- PTZ Control: Continuous, absolute, and relative movement, presets, status
- Imaging: Get/set brightness, contrast, exposure, focus, white balance, WDR
- Discovery: Automatic camera detection via WS-Discovery multicast
🎥 Virtual IP Camera Simulator
- Multi-Lens Camera Support: Simulate up to 10 independent camera profiles
- Complete ONVIF Implementation: Device, Media, PTZ, and Imaging services
- Flexible Configuration: CLI and library interfaces for easy setup
- PTZ Simulation: Full pan-tilt-zoom control with preset positions
- Imaging Control: Brightness, contrast, exposure, focus, and more
- Testing & Development: Perfect for testing ONVIF clients without physical cameras
🔐 Security
- WS-Security with UsernameToken authentication
- Password digest (SHA-1) support
- Configurable timeout and HTTP client options
📦 Easy Integration
- Simple, intuitive API
- Well-documented with examples
- No external dependencies beyond Go standard library and golang.org/x/net
go get github.com/0x524a/onvif-gopackage main
import (
"context"
"fmt"
"log"
"time"
"github.com/0x524a/onvif-go/discovery"
)
func main() {
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
devices, err := discovery.Discover(ctx, 5*time.Second)
if err != nil {
log.Fatal(err)
}
for _, device := range devices {
fmt.Printf("Found: %s at %s\n",
device.GetName(),
device.GetDeviceEndpoint())
}
}package main
import (
"context"
"fmt"
"log"
"time"
"github.com/0x524a/onvif-go"
)
func main() {
// Create client - endpoint can be:
// - Full URL: "http://192.168.1.100/onvif/device_service"
// - IP with port: "192.168.1.100:8080"
// - IP only: "192.168.1.100" (automatically adds http:// and path)
client, err := onvif.NewClient(
"192.168.1.100", // Simple IP address
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)
fmt.Printf("Firmware: %s\n", info.FirmwareVersion)
// Initialize and discover service endpoints
if err := client.Initialize(ctx); err != nil {
log.Fatal(err)
}
// Get media profiles
profiles, err := client.GetProfiles(ctx)
if err != nil {
log.Fatal(err)
}
// Get stream URI
if len(profiles) > 0 {
streamURI, err := client.GetStreamURI(ctx, profiles[0].Token)
if err != nil {
log.Fatal(err)
}
fmt.Printf("Stream URI: %s\n", streamURI.URI)
}
}// Continuous movement
velocity := &onvif.PTZSpeed{
PanTilt: &onvif.Vector2D{X: 0.5, Y: 0.0}, // Move right
}
timeout := "PT2S" // 2 seconds
err := client.ContinuousMove(ctx, profileToken, velocity, &timeout)
// Stop movement
err = client.Stop(ctx, profileToken, true, true)
// Absolute positioning
position := &onvif.PTZVector{
PanTilt: &onvif.Vector2D{X: 0.0, Y: 0.0}, // Center
Zoom: &onvif.Vector1D{X: 0.5}, // 50% zoom
}
err = client.AbsoluteMove(ctx, profileToken, position, nil)
// Go to preset
presets, err := client.GetPresets(ctx, profileToken)
if len(presets) > 0 {
err = client.GotoPreset(ctx, profileToken, presets[0].Token, nil)
}// Get current settings
settings, err := client.GetImagingSettings(ctx, videoSourceToken)
// Modify settings
brightness := 60.0
settings.Brightness = &brightness
contrast := 55.0
settings.Contrast = &contrast
// Apply settings
err = client.SetImagingSettings(ctx, videoSourceToken, settings, true)The onvif-go library provides comprehensive ONVIF protocol support with 200+ implemented APIs across all major ONVIF services:
- Device Management: 98 APIs (100% complete) ✅
- Media Service: 14+ APIs (profiles, streams, encoding) ✅
- PTZ Service: 13 APIs (movement, presets, status) ✅
- Imaging Service: 7 APIs (brightness, contrast, focus control) ✅
- Discovery Service: WS-Discovery network scanning ✅
client, err := onvif.NewClient(
endpoint,
onvif.WithCredentials(username, password),
onvif.WithTimeout(30*time.Second),
onvif.WithHTTPClient(customHTTPClient),
)The Device Service provides comprehensive device management capabilities with 98 fully implemented APIs:
| Method | Description |
|---|---|
GetDeviceInformation() |
Get manufacturer, model, firmware version, serial number, hardware ID |
GetCapabilities() |
Get device capabilities and service endpoints (device, media, imaging, PTZ, events, etc.) |
GetServices() |
Get list of services with optional capabilities |
GetServiceCapabilities() |
Get device service-specific capabilities |
GetEndpointReference() |
Get device's WS-Addressing endpoint reference |
SystemReboot() |
Reboot the device |
Initialize() |
Discover and cache service endpoints |
| Method | Description |
|---|---|
GetHostname() |
Get device hostname configuration |
SetHostname() |
Set device hostname |
SetHostnameFromDHCP() |
Enable/disable hostname from DHCP |
GetScopes() |
Get configured WS-Discovery scopes |
SetScopes() |
Set WS-Discovery scopes |
AddScopes() |
Add WS-Discovery scopes |
RemoveScopes() |
Remove WS-Discovery scopes |
| Method | Description |
|---|---|
GetDNS() |
Get DNS configuration (DHCP and manual DNS servers) |
SetDNS() |
Set DNS configuration (from DHCP, search domains, DNS servers) |
| Method | Description |
|---|---|
GetNTP() |
Get NTP configuration (DHCP and manual NTP servers) |
SetNTP() |
Set NTP configuration (from DHCP, NTP servers) |
| Method | Description |
|---|---|
GetDynamicDNS() |
Get Dynamic DNS configuration |
SetDynamicDNS() |
Set Dynamic DNS with type and name |
| Method | Description |
|---|---|
GetSystemDateAndTime() |
Get device system date and time (interface{}) |
FixedGetSystemDateAndTime() |
Get properly typed system date and time with timezone support |
SetSystemDateAndTime() |
Set device system date and time with manual/NTP mode |
| Method | Description |
|---|---|
GetNetworkInterfaces() |
Get all network interface configurations |
GetNetworkProtocols() |
Get network protocol settings (HTTP, HTTPS, RTSP, RTMP, SSH, etc.) |
SetNetworkProtocols() |
Set network protocol settings |
GetNetworkDefaultGateway() |
Get default gateway configuration (IPv4 and IPv6) |
SetNetworkDefaultGateway() |
Set default gateway configuration |
GetZeroConfiguration() |
Get Zero Configuration (zeroconf/Bonjour) status |
SetZeroConfiguration() |
Enable/disable Zero Configuration per interface |
| Method | Description |
|---|---|
GetUsers() |
Get list of user accounts and credentials |
CreateUsers() |
Create new user accounts |
SetUser() |
Modify existing user account |
DeleteUsers() |
Delete user accounts |
GetRemoteUser() |
Get remote user connection status |
SetRemoteUser() |
Set remote user connection settings |
| Method | Description |
|---|---|
GetIPAddressFilter() |
Get IP address filter (allow/deny lists) |
SetIPAddressFilter() |
Set IP address filtering rules |
AddIPAddressFilter() |
Add IP addresses to filter list |
RemoveIPAddressFilter() |
Remove IP addresses from filter list |
GetPasswordComplexityConfiguration() |
Get password policy settings |
SetPasswordComplexityConfiguration() |
Set password policy (length, uppercase, numbers, special chars) |
GetPasswordHistoryConfiguration() |
Get password history requirements |
SetPasswordHistoryConfiguration() |
Set password history and re-use prevention |
GetAuthFailureWarningConfiguration() |
Get failed authentication warning settings |
SetAuthFailureWarningConfiguration() |
Set failed authentication thresholds |
| Method | Description |
|---|---|
GetDiscoveryMode() |
Get discovery mode (Discoverable/NonDiscoverable) |
SetDiscoveryMode() |
Set discovery mode |
GetRemoteDiscoveryMode() |
Get remote discovery mode |
SetRemoteDiscoveryMode() |
Set remote discovery mode |
| Method | Description |
|---|---|
GetCertificates() |
Get installed certificates |
GetCACertificates() |
Get Certificate Authority certificates |
LoadCertificates() |
Load/install certificates |
LoadCACertificates() |
Load/install CA certificates |
CreateCertificate() |
Create self-signed certificate |
DeleteCertificates() |
Delete certificates |
GetCertificateInformation() |
Get certificate details and validity |
GetCertificatesStatus() |
Get certificate usage status |
SetCertificatesStatus() |
Set certificate usage (enabled/disabled) |
GetPkcs10Request() |
Generate PKCS#10 certificate signing request |
LoadCertificateWithPrivateKey() |
Load certificate with private key |
GetClientCertificateMode() |
Check if client certificate authentication enabled |
SetClientCertificateMode() |
Enable/disable client certificate authentication |
| Method | Description |
|---|---|
GetDot11Capabilities() |
Get WiFi capabilities (cipher suites, auth modes) |
GetDot11Status() |
Get WiFi status (SSID, signal strength, link quality) |
GetDot1XConfiguration() |
Get 802.1X EAP configuration |
GetDot1XConfigurations() |
Get all 802.1X configurations |
SetDot1XConfiguration() |
Set 802.1X configuration |
CreateDot1XConfiguration() |
Create new 802.1X configuration |
DeleteDot1XConfiguration() |
Delete 802.1X configuration |
ScanAvailableDot11Networks() |
Scan for available WiFi networks |
| Method | Description |
|---|---|
GetStorageConfigurations() |
Get all storage configurations |
GetStorageConfiguration() |
Get specific storage configuration |
CreateStorageConfiguration() |
Create new storage configuration |
SetStorageConfiguration() |
Update storage configuration |
DeleteStorageConfiguration() |
Delete storage configuration |
SetHashingAlgorithm() |
Set password hashing algorithm |
| Method | Description |
|---|---|
GetSystemLog() |
Get system logs (boot, security, etc.) |
GetSystemBackup() |
Get available system backups |
RestoreSystem() |
Restore from backup file |
GetSystemUris() |
Get system log and backup URIs |
GetSystemSupportInformation() |
Get support information and system details |
SetSystemFactoryDefault() |
Reset device to factory defaults |
StartFirmwareUpgrade() |
Initiate firmware upgrade |
StartSystemRestore() |
Initiate system restore |
| Method | Description |
|---|---|
GetRelayOutputs() |
Get relay outputs and their current state |
SetRelayOutputSettings() |
Configure relay output behavior |
SetRelayOutputState() |
Set relay output state (active/inactive) |
SendAuxiliaryCommand() |
Send auxiliary commands (e.g., IR control) |
| Method | Description |
|---|---|
GetGeoLocation() |
Get device geographic location |
SetGeoLocation() |
Set device geographic location |
DeleteGeoLocation() |
Delete geographic location |
GetDPAddresses() |
Get WS-Discovery multicast addresses |
SetDPAddresses() |
Set WS-Discovery multicast addresses |
GetAccessPolicy() |
Get device access policy |
SetAccessPolicy() |
Set device access policy |
GetWsdlUrl() |
Get device WSDL URL (deprecated) |
The onvif-go library provides 98 fully-implemented Device Management APIs for complete device configuration and control. See DEVICE_API_STATUS.md for the complete API reference.
// Get device info (manufacturer, model, firmware)
info, err := client.GetDeviceInformation(ctx)
if err != nil {
log.Fatal(err)
}
fmt.Printf("Camera: %s %s (FW: %s)\n", info.Manufacturer, info.Model, info.FirmwareVersion)
// Get capabilities
caps, err := client.GetCapabilities(ctx)
if err != nil {
log.Fatal(err)
}// Get all network interfaces
interfaces, err := client.GetNetworkInterfaces(ctx)
if err != nil {
log.Fatal(err)
}
// Get DNS and NTP settings
dns, err := client.GetDNS(ctx)
ntp, err := client.GetNTP(ctx)
// Configure DNS
err = client.SetDNS(ctx, false, []string{"example.com"}, []onvif.IPAddress{
{Type: "IPv4", IPv4Address: "8.8.8.8"},
})
// Get/Set hostname
hostname, err := client.GetHostname(ctx)
err = client.SetHostname(ctx, "new-camera-name")// Get users
users, err := client.GetUsers(ctx)
// Create new user
err = client.CreateUsers(ctx, []*onvif.User{
{Username: "operator", Password: "pass123"},
})
// Configure security
err = client.SetPasswordComplexityConfiguration(ctx, &onvif.PasswordComplexityConfiguration{
MinLen: 8,
Uppercase: 1,
Number: 1,
SpecialChars: 1,
})
// IP address filtering
filter := &onvif.IPAddressFilter{
Type: onvif.IPAddressFilterAllow,
}
err = client.SetIPAddressFilter(ctx, filter)// Get installed certificates
certs, err := client.GetCertificates(ctx)
// Create self-signed certificate
cert, err := client.CreateCertificate(ctx,
"cert1",
"CN=camera.example.com",
"2024-01-01T00:00:00Z",
"2025-01-01T00:00:00Z",
)
// Check certificate status
status, err := client.GetCertificatesStatus(ctx)
// Enable client certificate authentication
err = client.SetClientCertificateMode(ctx, true)// Get system logs
log, err := client.GetSystemLog(ctx, onvif.SystemLogTypeBoot)
// Get system backup
backups, err := client.GetSystemBackup(ctx)
// Reboot device
rebootToken, err := client.SystemReboot(ctx)
// Set factory defaults
err = client.SetSystemFactoryDefault(ctx, onvif.FactoryDefaultTypeSoft)
// Firmware upgrade
upgradeToken, err := client.StartFirmwareUpgrade(ctx)// Get WiFi capabilities
caps, err := client.GetDot11Capabilities(ctx)
// Scan available networks
networks, err := client.ScanAvailableDot11Networks(ctx, "interface1")
// Get 802.1X configuration
config, err := client.GetDot1XConfiguration(ctx, "config1")
// Set 802.1X
err = client.SetDot1XConfiguration(ctx, config)// Get relay outputs
relays, err := client.GetRelayOutputs(ctx)
// Control relay state
err = client.SetRelayOutputState(ctx, "relay1", onvif.RelayLogicalStateActive)
err = client.SetRelayOutputState(ctx, "relay1", onvif.RelayLogicalStateInactive)
// Send auxiliary commands (e.g., IR control)
response, err := client.SendAuxiliaryCommand(ctx, "tt:IRLamp|On")For complete documentation of all 98 Device Management APIs with detailed descriptions, parameters, and return types, see:
- DEVICE_API_STATUS.md - Complete API listing with categories and examples
| Method | Description |
|---|---|
GetProfiles() |
Get all media profiles |
GetStreamURI() |
Get RTSP/HTTP stream URI |
GetSnapshotURI() |
Get snapshot image URI |
GetVideoEncoderConfiguration() |
Get video encoder settings |
GetVideoSources() |
Get all video sources |
GetAudioSources() |
Get all audio sources |
GetAudioOutputs() |
Get all audio outputs |
CreateProfile() |
Create new media profile |
DeleteProfile() |
Delete media profile |
SetVideoEncoderConfiguration() |
Set video encoder configuration |
| Method | Description |
|---|---|
ContinuousMove() |
Start continuous PTZ movement |
AbsoluteMove() |
Move to absolute position |
RelativeMove() |
Move relative to current position |
Stop() |
Stop PTZ movement |
GetStatus() |
Get current PTZ status and position |
GetPresets() |
Get list of PTZ presets |
GotoPreset() |
Move to a preset position |
SetPreset() |
Save current position as preset |
RemovePreset() |
Delete a preset |
GotoHomePosition() |
Move to home position |
SetHomePosition() |
Set current position as home |
GetConfiguration() |
Get PTZ configuration |
GetConfigurations() |
Get all PTZ configurations |
| Method | Description |
|---|---|
GetImagingSettings() |
Get imaging settings (brightness, contrast, etc.) |
SetImagingSettings() |
Set imaging settings |
Move() |
Perform focus move operations |
GetOptions() |
Get available imaging options and ranges |
GetMoveOptions() |
Get available focus move options |
StopFocus() |
Stop focus movement |
GetImagingStatus() |
Get current imaging/focus status |
| Method | Description |
|---|---|
Discover() |
Discover ONVIF devices on network |
The library now includes a complete ONVIF server implementation that simulates multi-lens IP cameras!
# Install the server CLI
go install ./cmd/onvif-server
# Run with default settings (3 camera profiles)
onvif-server
# Or customize
onvif-server -profiles 5 -username admin -password mypass -port 9000package main
import (
"context"
"log"
"github.com/0x524a/onvif-go/server"
)
func main() {
// Create server with default multi-lens camera configuration
srv, err := server.New(server.DefaultConfig())
if err != nil {
log.Fatal(err)
}
// Start server
ctx := context.Background()
if err := srv.Start(ctx); err != nil {
log.Fatal(err)
}
}- 🎥 Multi-Lens Simulation: Support for up to 10 independent camera profiles
- 🎮 Full PTZ Control: Pan, tilt, zoom with preset positions
- 📷 Imaging Settings: Brightness, contrast, exposure, focus, white balance
- 🌐 Complete ONVIF Services: Device, Media, PTZ, and Imaging services
- 🔐 WS-Security: Digest authentication support
- ⚙️ Flexible Configuration: CLI and library interfaces
- Testing ONVIF client implementations
- Developing video management systems
- CI/CD integration testing
- Demonstrations without physical cameras
- Learning ONVIF protocol
For complete documentation, see server/README.md.
The examples directory contains complete working examples:
- discovery: Discover cameras on the network
- device-info: Get device information and media profiles
- ptz-control: Control camera PTZ (pan, tilt, zoom)
- imaging-settings: Adjust imaging settings
- onvif-server: Multi-lens camera server with custom configuration
To run an example:
cd examples/discovery
go run main.goonvif-go/
├── client.go # Main ONVIF client
├── types.go # ONVIF data types
├── errors.go # Error definitions
├── device.go # Device service implementation
├── media.go # Media service implementation
├── ptz.go # PTZ service implementation
├── imaging.go # Imaging service implementation
├── soap/ # SOAP client with WS-Security
│ └── soap.go
├── discovery/ # WS-Discovery implementation
│ └── discovery.go
├── server/ # ONVIF server implementation
│ ├── server.go # Main server
│ ├── types.go # Server types and configuration
│ ├── device.go # Device service handlers
│ ├── media.go # Media service handlers
│ ├── ptz.go # PTZ service handlers
│ ├── imaging.go # Imaging service handlers
│ └── soap/ # SOAP server handler
│ └── handler.go
├── cmd/
│ ├── onvif-cli/ # Client CLI tool
│ └── onvif-server/ # Server CLI tool
└── examples/ # Usage examples
├── discovery/
├── device-info/
├── ptz-control/
├── imaging-settings/
└── onvif-server/ # Multi-lens camera server example
- Context-Aware: All network operations accept
context.Contextfor cancellation and timeouts - Type Safety: Strong typing with comprehensive struct definitions
- Error Handling: Typed errors with clear error messages
- Concurrency Safe: Thread-safe operations with proper locking
- Performance: Connection pooling and efficient HTTP client reuse
- Standards Compliant: Follows ONVIF specifications for SOAP/XML messaging
- Go Version: 1.21+
- ONVIF Versions: Compatible with ONVIF Profile S, Profile T, Profile G
- Tested Cameras: Works with most ONVIF-compliant IP cameras including:
- Axis
- Hikvision
- Dahua
- Bosch
- Hanwha (Samsung)
- And many others
# Run tests
go test ./...
# Run tests with coverage
go test -cover ./...
# Run tests with race detection
go test -race ./...Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Event service implementation
- Analytics service implementation
- Recording service implementation
- Replay service implementation
- Advanced security features (TLS, X.509 certificates)
- Comprehensive test suite with mock cameras
- Performance benchmarks
- CLI tool for camera management
Comprehensive camera testing and analysis with optional XML capture:
go build -o onvif-diagnostics ./cmd/onvif-diagnostics/
# Standard diagnostic report
./onvif-diagnostics \
-endpoint "http://camera-ip/onvif/device_service" \
-username "admin" \
-password "pass" \
-verbose
# With raw SOAP XML capture for debugging
./onvif-diagnostics \
-endpoint "http://camera-ip/onvif/device_service" \
-username "admin" \
-password "pass" \
-capture-xml \
-verboseGenerates:
camera-logs/Manufacturer_Model_Firmware_timestamp.json- Diagnostic reportcamera-logs/Manufacturer_Model_Firmware_xmlcapture_timestamp.tar.gz- Raw XML (with-capture-xml)
See: XML_DEBUGGING_SOLUTION.md for complete debugging workflow
Automated regression testing using captured camera responses:
# 1. Capture from camera
./onvif-diagnostics -endpoint "http://camera/onvif/device_service" \
-username "user" -password "pass" -capture-xml
# 2. Generate test
go build -o generate-tests ./cmd/generate-tests/
./generate-tests -capture camera-logs/*_xmlcapture_*.tar.gz -output testdata/captures/
# 3. Run tests
go test -v ./testdata/captures/Benefits:
- Test without physical cameras
- Prevent regressions across camera models
- Fast CI/CD integration
- Real camera response validation
See: testdata/captures/README.md for complete testing guide
Feature-rich command-line interface for camera management and testing:
go build -o onvif-cli ./cmd/onvif-cli/
# Start interactive menu
./onvif-cliFeatures:
- 🔍 Discover cameras on network with interface selection
- 🌐 View all network interfaces and their capabilities
- 🔗 Connect to cameras with authentication
- 📱 Get device info, capabilities, and system settings
- 📹 Retrieve media profiles and stream URLs
- 🎮 PTZ control (pan, tilt, zoom, presets)
- 🎨 Imaging settings (brightness, contrast, exposure, etc.)
- 📞 Network interface selection for multi-interface systems
Usage:
📋 Main Menu:
1. Discover Cameras on Network
2. Connect to Camera
3. Device Operations
4. Media Operations
5. PTZ Operations
6. Imaging Operations
0. Exit
Note: The discovery function now intelligently detects multiple interfaces and shows options only when needed - no separate "List Network Interfaces" menu required.
Lightweight tool for quick testing and demonstration:
go build -o onvif-quick ./cmd/onvif-quick/
# Start interactive menu
./onvif-quickFeatures:
- ⚡ Quick camera discovery
- 🌐 List available network interfaces
- 🔗 Quick connection and camera info
- 🎮 PTZ demo with movement examples
- 📡 Stream URL retrieval
The CLI intelligently handles network interface selection automatically:
- Single interface: Auto-discovery works seamlessly
- Multiple interfaces: Shows interfaces only if auto-discovery fails
- Multiple active interfaces: Tries each one and aggregates results
For programmatic usage:
opts := &discovery.DiscoverOptions{
NetworkInterface: "eth0", // By interface name
// or
// NetworkInterface: "192.168.1.100", // By IP address
}
devices, err := discovery.DiscoverWithOptions(ctx, 5*time.Second, opts)See:
docs/CLI_NETWORK_INTERFACE_USAGE.md- Detailed CLI guidediscovery/NETWORK_INTERFACE_GUIDE.md- API usage examplesDESIGN_REFACTOR.md- How smart interface detection works
If you find this project useful, please consider giving it a star! ⭐
This project is licensed under the MIT License - see the LICENSE file for details.
- Inspired by the original use-go/onvif library
- ONVIF specifications from ONVIF.org
- Thanks to all contributors and the Go community
onvif ip-camera surveillance golang rtsp ptz camera-control video-streaming security-camera nvr vms iot cctv hikvision axis dahua bosch camera-sdk golang-library soap ws-discovery
- ONVIF Device Manager - GUI tool for testing ONVIF devices
- ONVIF Device Tool - Official ONVIF test tool
Made with ❤️ for the Go and IoT community