vaapi

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package vaapi implements hardware accelerated codecs. This package requires libva headers and libraries to be built. libva requires supported graphic card and its driver.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ParamsVP8

type ParamsVP8 struct {
	codec.BaseParams
	Sequence        SequenceParamVP8
	RateControlMode RateControlMode
	RateControl     RateControlParam
}

ParamsVP8 stores VP8 encoding parameters.

func NewVP8Params

func NewVP8Params() (ParamsVP8, error)

NewVP8Params returns default parameters of VP8 codec.

func (*ParamsVP8) BuildVideoEncoder

func (p *ParamsVP8) BuildVideoEncoder(r video.Reader, property prop.Media) (codec.ReadCloser, error)

BuildVideoEncoder builds VP8 encoder with given params

func (*ParamsVP8) RTPCodec added in v0.1.2

func (p *ParamsVP8) RTPCodec() *codec.RTPCodec

RTPCodec represents the codec metadata

type ParamsVP9

type ParamsVP9 struct {
	codec.BaseParams
	RateControlMode RateControlMode
	RateControl     RateControlParam
}

ParamsVP9 represents VAEncSequenceParameterBufferVP9 and other parameter buffers.

func NewVP9Params

func NewVP9Params() (ParamsVP9, error)

NewVP9Params returns default parameters of VP9 codec.

func (*ParamsVP9) BuildVideoEncoder

func (p *ParamsVP9) BuildVideoEncoder(r video.Reader, property prop.Media) (codec.ReadCloser, error)

BuildVideoEncoder builds VP9 encoder with given params

func (*ParamsVP9) RTPCodec added in v0.1.2

func (p *ParamsVP9) RTPCodec() *codec.RTPCodec

RTPCodec represents the codec metadata

type RateControlMode

type RateControlMode uint

RateControlMode represents rate control mode. Note that supported mode depends on the codec and acceleration hardware.

const (
	RateControlCBR            RateControlMode = 0x00000002
	RateControlVBR            RateControlMode = 0x00000004
	RateControlVCM            RateControlMode = 0x00000008
	RateControlCQP            RateControlMode = 0x00000010
	RateControlVBRConstrained RateControlMode = 0x00000020
	RateControlICQ            RateControlMode = 0x00000040
	RateControlMB             RateControlMode = 0x00000080
	RateControlCFS            RateControlMode = 0x00000100
	RateControlParallel       RateControlMode = 0x00000200
	RateControlQVBR           RateControlMode = 0x00000400
	RateControlAVBR           RateControlMode = 0x00000800
)

List of the RateControlMode.

type RateControlParam

type RateControlParam struct {

	// TargetPercentage is a target bit-rate relative to the maximum bit-rate.
	// BaseParams.BitRate / (TargetPercentage * 0.01) will be the maximum bit-rate.
	TargetPercentage uint
	// WindowSize is a rate control window size in milliseconds.
	WindowSize uint
	InitialQP  uint
	MinQP      uint
	MaxQP      uint
	// contains filtered or unexported fields
}

RateControlParam represents VAEncMiscParameterRateControl.

type SequenceParamVP8

type SequenceParamVP8 struct {
	ErrorResilient  bool
	ClampQindexHigh uint
	ClampQindexLow  uint
}

SequenceParamVP8 represents VAEncSequenceParameterBufferVP8 and other parameter buffers.

Jump to

Keyboard shortcuts

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