capture

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VideoCaptureFrameHeight = int32(gocv.VideoCaptureFrameHeight)
	VideoCaptureFrameWidth  = int32(gocv.VideoCaptureFrameWidth)
	VideoCaptureFPS         = int32(gocv.VideoCaptureFPS)
)

Variables

View Source
var ErrClosed = errors.New("capture device closed")

Functions

This section is empty.

Types

type Capture

type Capture interface {
	Open() error
	Close() error
	Read() (*cv.Frame, error)
	Get(property int32) (value float32, err error)
	Set(property int32, value float32) error
}

Capture is the interface that wraps the basic methods for capturing frames.

func OpenDevice added in v0.4.0

func OpenDevice(captureDevice, source string) (Capture, error)

OpenDevice opens a capture device based on the specified type and source. It returns a Capture interface that can be used to read frames from the device. The captureDevice parameter can be "auto", "webcam", "gstreamer", or "ffmpeg". The source parameter is the input source for the capture device. If the capture device type is not recognized, an error is returned. If the capture device fails to open, an error is returned.

type FFmpeg added in v0.2.0

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

func NewFFmpeg added in v0.2.0

func NewFFmpeg(device string) *FFmpeg

func (*FFmpeg) Close added in v0.2.0

func (g *FFmpeg) Close() error

func (*FFmpeg) Get added in v0.4.0

func (g *FFmpeg) Get(property int32) (value float32, err error)

func (*FFmpeg) Open added in v0.2.0

func (g *FFmpeg) Open() error

func (*FFmpeg) Read added in v0.2.0

func (g *FFmpeg) Read() (*cv.Frame, error)

func (*FFmpeg) Set added in v0.4.0

func (g *FFmpeg) Set(property int32, value float32) error

type GStreamer

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

func NewGStreamer

func NewGStreamer(device string) *GStreamer

func (*GStreamer) Close

func (g *GStreamer) Close() error

func (*GStreamer) Get added in v0.4.0

func (g *GStreamer) Get(property int32) (value float32, err error)

func (*GStreamer) Open

func (g *GStreamer) Open() error

func (*GStreamer) Read

func (g *GStreamer) Read() (*cv.Frame, error)

func (*GStreamer) Set added in v0.4.0

func (g *GStreamer) Set(property int32, value float32) error

type Webcam

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

func NewWebcam

func NewWebcam(device string) *Webcam

func (*Webcam) Close

func (w *Webcam) Close() error

func (*Webcam) Get added in v0.4.0

func (w *Webcam) Get(property int32) (value float32, err error)

func (*Webcam) Open

func (w *Webcam) Open() error

func (*Webcam) Read

func (w *Webcam) Read() (*cv.Frame, error)

func (*Webcam) Set added in v0.4.0

func (w *Webcam) Set(property int32, value float32) error

Jump to

Keyboard shortcuts

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