onvif2go

module
v0.0.0-...-dc03e4e Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2025 License: Apache-2.0

README ยถ

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.

Directories ยถ

Path Synopsis
cmd
server command
internal

Jump to

Keyboard shortcuts

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