Categorygithub.com/thinkski/go-v4l2
modulepackage
0.0.0-20220516055852-8bc59635f07d
Repository: https://github.com/thinkski/go-v4l2.git
Documentation: pkg.go.dev

# README

go-v4l2

A pure Go implementation of Video4Linux2 stream capture with a simple channel based interface:

  • No C code. No separate cross-compiler required.
  • Zero copy. Memory-mapped double-buffer scheme makes kernel memory reference available via Go channel.

Quickstart

See examples/record.go for a more detailed example.

device, err := v4l2.Open("/dev/video0")

device.SetPixelFormat(1280, 720, v4l2.V4L2_PIX_FMT_H264)

device.SetBitrate(1000000)

device.Start()

for {
	select {
	case sample := <-device.C:
		// Each read is a H.264 NAL unit
		fmt.Printf("Read %d byte sample\n", len(sample.Data))
		sample.Release()
	}
}

Build example:

GOARCH=arm GOOS=linux go build examples/record.go

# Packages

No description provided by the author

# Functions

Open device.

# Constants

No description provided by the author
Controls (from linux/v4l2-controls.h).
Controls (from linux/v4l2-controls.h).
User-class control IDs.
Controls (from linux/v4l2-controls.h).
Controls (from linux/v4l2-controls.h).
Controls (from linux/v4l2-controls.h).
Controls (from linux/v4l2-controls.h).
Controls (from linux/v4l2-controls.h).
Controls (from linux/v4l2-controls.h).
Controls (from linux/v4l2-controls.h).
Controls (from linux/v4l2-controls.h).
Controls (from linux/v4l2-controls.h).
MPEG-class control IDs.
Controls (from linux/v4l2-controls.h).
Controls (from linux/v4l2-controls.h).
Controls (from linux/v4l2-controls.h).
Controls (from linux/v4l2-controls.h).
Controls (from linux/v4l2-controls.h).
Controls (from linux/v4l2-controls.h).
Controls (from linux/v4l2-controls.h).
Controls (from linux/v4l2-controls.h).
Controls (from linux/v4l2-controls.h).
Controls (from linux/v4l2-controls.h).
Controls (from linux/v4l2-controls.h).
Controls (from linux/v4l2-controls.h).
Controls (from linux/v4l2-controls.h).
Controls (from linux/v4l2-controls.h).
Control classes.
No description provided by the author
No description provided by the author
No description provided by the author
H.264 Levels.
Controls (from linux/v4l2-controls.h).
Controls (from linux/v4l2-controls.h).
Controls (from linux/v4l2-controls.h).
Controls (from linux/v4l2-controls.h).
Controls (from linux/v4l2-controls.h).
Controls (from linux/v4l2-controls.h).
Controls (from linux/v4l2-controls.h).
Controls (from linux/v4l2-controls.h).
Controls (from linux/v4l2-controls.h).
Controls (from linux/v4l2-controls.h).
Controls (from linux/v4l2-controls.h).
Controls (from linux/v4l2-controls.h).
Controls (from linux/v4l2-controls.h).
Controls (from linux/v4l2-controls.h).
Controls (from linux/v4l2-controls.h).
H.264 Profiles.
Controls (from linux/v4l2-controls.h).
Controls (from linux/v4l2-controls.h).
Controls (from linux/v4l2-controls.h).
Controls (from linux/v4l2-controls.h).
Controls (from linux/v4l2-controls.h).
Controls (from linux/v4l2-controls.h).
Controls (from linux/v4l2-controls.h).
Controls (from linux/v4l2-controls.h).
Controls (from linux/v4l2-controls.h).
Controls (from linux/v4l2-controls.h).
Controls (from linux/v4l2-controls.h).
Controls (from linux/v4l2-controls.h).
Controls (from linux/v4l2-controls.h).
Controls (from linux/v4l2-controls.h).
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Structs

No description provided by the author
No description provided by the author