ONVIF Device Manager (Go + Web UI)
A modern ONVIF Device Manager rewritten in Go with a web-based user interface. This is a reimplementation of the original ONVIF Device Manager with enhanced features including WebRTC streaming support.
Features
- ๐ Device Discovery - Automatically discover ONVIF-compatible cameras on your network using WS-Discovery
- ๐น Live Streaming - View live video streams via WebRTC (RTSP to WebRTC conversion)
- ๐ฎ PTZ Control - Pan, Tilt, and Zoom controls for PTZ-enabled cameras
- ๐ท Snapshot Capture - Take snapshots from camera streams
- ๐ Authentication - Support for ONVIF digest authentication
- ๐ป Web Interface - Modern, responsive web UI that works in any browser
Screenshots
The web interface provides a clean, intuitive layout with:
- Device sidebar for managing multiple cameras
- Live streaming panel with profile selection
- PTZ controls with preset support
- Device information display
Requirements
- Go 1.21 or later
- Network access to ONVIF-compatible cameras
Installation
From Source
# Clone the repository
git clone https://github.com/sickplanet/onvif2go.git
cd onvif2go
# Build the application
go build -o onvif2go ./cmd/server
# Run the server
./onvif2go -port 8080
Using Go Install
go install github.com/sickplanet/onvif2go/cmd/server@latest
Usage
Starting the Server
./onvif2go -port 8080
Then open your browser and navigate to http://localhost:8080
Command Line Options
| Option |
Default |
Description |
-port |
8080 |
HTTP server port |
API Endpoints
Device Discovery
POST /api/discover - Discover ONVIF devices on the network
Device Management
GET /api/devices - List all devices
POST /api/devices - Add a new device
GET /api/devices/{id} - Get device details
DELETE /api/devices/{id} - Remove a device
POST /api/devices/{id}/refresh - Refresh device info
Streaming
GET /api/devices/{id}/stream/{profileToken} - Get stream URI
POST /api/devices/{id}/webrtc - Start WebRTC streaming
GET /api/devices/{id}/snapshot/{profileToken} - Get camera snapshot
PTZ Control
POST /api/devices/{id}/ptz/move - Continuous PTZ movement
POST /api/devices/{id}/ptz/stop - Stop PTZ movement
GET /api/devices/{id}/ptz/presets - Get PTZ presets
POST /api/devices/{id}/ptz/goto - Go to preset
Architecture
โโโ cmd/
โ โโโ server/
โ โโโ main.go # HTTP server and API handlers
โ โโโ web/ # Embedded web files
โ โโโ index.html
โ โโโ static/
โ โโโ css/
โ โโโ js/
โโโ internal/
โ โโโ onvif/
โ โ โโโ client.go # ONVIF SOAP client
โ โ โโโ discovery.go # WS-Discovery implementation
โ โโโ webrtc/
โ โโโ bridge.go # RTSP to WebRTC bridge
โโโ go.mod
Technology Stack
- Backend: Go with standard library HTTP server
- ONVIF: Custom SOAP client implementation
- Streaming: gortsplib + pion/webrtc
- Frontend: Vanilla JavaScript with modern CSS
Supported ONVIF Features
- Device Management
- GetDeviceInformation
- GetServices
- GetCapabilities
- Media
- GetProfiles
- GetStreamUri
- GetSnapshotUri
- PTZ
- ContinuousMove
- Stop
- GetPresets
- GotoPreset
Browser Compatibility
The web interface works in all modern browsers that support WebRTC:
- Chrome/Edge 79+
- Firefox 72+
- Safari 14.1+
License
Apache License - See LICENSE for details
Credits
Contributing
Contributions are welcome! Please feel free to submit issues and pull requests.