visca

package module
v0.0.0-...-c307c20 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2024 License: BSD-3-Clause Imports: 10 Imported by: 0

README

go-visca

Easily control VISCA-Over-IP Cameras!

Getting Started

import (
    "fmt"

    visca "git.sr.ht/~gc/go-visca"
)

...

cam := visca.Connect("192.168.1.180", 52381)
defer cam.Close()

panTilt := cam.PanTilt(1000, 0, 24, 24)

pt := cam.PanTilt(preset.Pan, preset.Tilt, 24, 24)
z := cam.Zoom(preset.Zoom)
errPanTilt, errZoom := <-pt, <-z
if errPanTilt == nil && errZoom == nil {
    fmt.Printf("Success")
    return
}

fmt.Printf("Error: %s, %s", errPanTile, errZoom)

See Visca IP Web for more in-depth usage examples.

Tested Devices

  • Sony SRG-300SE

License

BSD 3-Clause License

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SonySrg300 = CameraProfile{
	// contains filtered or unexported fields
}

Functions

func MathMax

func MathMax[T Number](a, b T) T

func MathMin

func MathMin[T Number](a, b T) T

func MinMax

func MinMax[T Number](min, val, max T) T

Types

type CameraProfile

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

type Number

type Number interface {
	int | int8 | int16 | int32 | int64 | uint | uint8 | uint16 | uint32 | uint64 | float32 | float64
}

type ViscaCamera

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

func Connect

func Connect(ip string, port uint32, profile CameraProfile) (*ViscaCamera, error)

func (*ViscaCamera) Close

func (vc *ViscaCamera) Close() error

func (*ViscaCamera) GetPanTilt

func (vc *ViscaCamera) GetPanTilt() chan int32

Get current PanTilt position of camera Pan: -8704 to 8704 Tilt: -1024 to 4608 Speeds: 0 to 24

func (*ViscaCamera) GetZoom

func (vc *ViscaCamera) GetZoom() chan uint16

Get current zoom of camera 0 to 16384

func (*ViscaCamera) PanTilt

func (vc *ViscaCamera) PanTilt(
	panValue int32,
	tiltValue int32,
	panSpeed uint8,
	tiltSpeed uint8,
) chan error

Adjust PanTilt position of camera Pan: -8704 to 8704 Tilt: -1024 to 4608 Speeds: 0 to 24

func (*ViscaCamera) Zoom

func (vc *ViscaCamera) Zoom(
	position uint16,
) chan error

Adjust zoom of camera 0 to 16384

Jump to

Keyboard shortcuts

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