videosource

package
v0.50.0-rc0 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2024 License: AGPL-3.0 Imports: 25 Imported by: 0

Documentation

Overview

Package videosource implements various camera models including webcam

Index

Constants

This section is empty.

Variables

View Source
var ModelWebcam = resource.DefaultModelFamily.WithModel("webcam")

ModelWebcam is the name of the webcam component.

Functions

func Discover

func Discover(ctx context.Context, getDrivers func() []driver.Driver, logger logging.Logger) (*pb.Webcams, error)

Discover webcam attributes.

func NewWebcam added in v0.2.36

func NewWebcam(
	ctx context.Context,
	deps resource.Dependencies,
	conf resource.Config,
	logger logging.Logger,
) (camera.Camera, error)

NewWebcam returns a new source based on a webcam discovered from the given config.

Types

type CameraConfig

type CameraConfig struct {
	Label      string
	Status     driver.State
	Properties []prop.Media
}

CameraConfig is collection of configuration options for a camera.

type WebcamConfig added in v0.2.36

type WebcamConfig struct {
	CameraParameters     *transform.PinholeCameraIntrinsics `json:"intrinsic_parameters,omitempty"`
	DistortionParameters *transform.BrownConrady            `json:"distortion_parameters,omitempty"`
	Debug                bool                               `json:"debug,omitempty"`
	Format               string                             `json:"format,omitempty"`
	Path                 string                             `json:"video_path"`
	Width                int                                `json:"width_px,omitempty"`
	Height               int                                `json:"height_px,omitempty"`
	FrameRate            float32                            `json:"frame_rate,omitempty"`
}

WebcamConfig is the attribute struct for webcams.

func (WebcamConfig) Validate added in v0.26.0

func (c WebcamConfig) Validate(path string) ([]string, error)

Validate ensures all parts of the config are valid.

Jump to

Keyboard shortcuts

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