vaapi

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2026 License: Apache-2.0 Imports: 14 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package vaapi encodes HEVC on Linux with VA-API (Intel's iHD and AMD's radeonsi drivers), through libva.so.2 and libva-drm.so.2 loaded with purego (no cgo).

Frames come as capture.DMABuf surfaces: a DMA-BUF is imported as a VA surface with no copy, planes in memory are uploaded. RGB is converted to 4:2:0 by the driver's video processor.

Where the driver takes packed sequence and slice headers, the encoder writes the VPS, SPS, PPS and slice headers itself (package codec/hevc), as VA-API's parameters carry no conformance window; elsewhere the driver writes them all.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Adapters

func Adapters() ([]gpu.Adapter, error)

Adapters lists the render nodes whose VA-API driver encodes HEVC.

func Probe

func Probe(adapter gpu.Adapter) (encode.Caps, error)

Probe reports what the VA-API driver of adapter's render node encodes: HEVC Main, and Main 10 where it has the profile.

Types

type Encoder

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

Encoder is a VA-API HEVC encoder of one stream.

func Open

func Open(adapter gpu.Adapter, cfg encode.Config) (*Encoder, error)

Open starts an HEVC encoder on adapter's render node.

func (*Encoder) Caps

func (e *Encoder) Caps() encode.Caps

func (*Encoder) Close

func (e *Encoder) Close() error

func (*Encoder) Encode

func (e *Encoder) Encode(f capture.Frame, forceKey bool, dst []byte) (encode.Packet, error)

func (*Encoder) SetBitrate

func (e *Encoder) SetBitrate(kbps int) error

SetBitrate takes effect from the next picture, through a rate control reset.

Jump to

Keyboard shortcuts

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