onvif

package
v0.0.23 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const SensorWidth1_2_8 = 5.04 // mm, 1/2.8" sensor (most common in security cameras)
View Source
const WsDiscoveryAddr = "239.255.255.250:3702"

Variables

This section is empty.

Functions

func AbsoluteMove

func AbsoluteMove(ep ServiceEndpoints, user, pass, profileToken string, pan, tilt, zoom float64) error

func AzimuthToPan

func AzimuthToPan(az float64) float64

func DigestGet

func DigestGet(rawURL, user, pass string) ([]byte, error)

func DigestPost

func DigestPost(rawURL, user, pass, contentType string, body []byte) ([]byte, error)

func ElevationToTilt

func ElevationToTilt(el float64) float64

func ExtractIPFromXAddr

func ExtractIPFromXAddr(xaddr string) string

func FOVFromFocalLength

func FOVFromFocalLength(focalLengthMM, sensorWidthMM float64) float64

func GetPTZStatus

func GetPTZStatus(ep ServiceEndpoints, user, pass, profileToken string) (pan, tilt, zoom float64, err error)

func GetSnapshotURI

func GetSnapshotURI(ep ServiceEndpoints, user, pass, profileToken string) (string, error)

func GetStreamURI

func GetStreamURI(ep ServiceEndpoints, user, pass, profileToken string) (string, error)

func GetVideoSourceToken

func GetVideoSourceToken(ep ServiceEndpoints, user, pass string) (string, error)

func IsVideoCodec

func IsVideoCodec(enc string) bool

func PanToAzimuth

func PanToAzimuth(pan float64) float64

func ParseXAddrsFromResponse

func ParseXAddrsFromResponse(data string) []string

func ProbeDevices

func ProbeDevices(ctx context.Context, logger *slog.Logger) []string

func TiltToElevation

func TiltToElevation(tilt float64) float64

Types

type DeviceInfo

type DeviceInfo struct {
	Manufacturer string
	Model        string
	SerialNumber string
}

func GetDeviceInformation

func GetDeviceInformation(ep ServiceEndpoints, user, pass string) (DeviceInfo, error)

type LensInfo

type LensInfo struct {
	FocalLengthMin float64 // mm, widest
	FocalLengthMax float64 // mm, most zoomed
}

func GetLensInfo

func GetLensInfo(ep ServiceEndpoints, user, pass, videoSourceToken string) (LensInfo, error)

type MediaProfile

type MediaProfile struct {
	Token    string
	Name     string
	Encoding string // e.g. "JPEG", "H264", "H265"
}

func GetProfiles

func GetProfiles(ep ServiceEndpoints, user, pass string) ([]MediaProfile, error)

type ServiceEndpoints

type ServiceEndpoints struct {
	Device  string
	Media   string
	PTZ     string
	Imaging string
}

func DiscoverEndpoints

func DiscoverEndpoints(host, user, pass string) (ServiceEndpoints, error)

Jump to

Keyboard shortcuts

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