encoders

package
v0.0.0-...-889e70c Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Encoder

type Encoder interface {
	io.Closer
	Encode(*image.RGBA) ([]byte, error)
	VideoSize() (image.Point, error)
}

Encoder takes an image/frame and encodes it

type EncoderService

type EncoderService struct {
}

EncoderService creates instances of encoders

func (*EncoderService) NewEncoder

func (*EncoderService) NewEncoder(codec VideoCodec, size image.Point, frameRate int) (Encoder, error)

NewEncoder creates an instance of an encoder of the selected codec

func (*EncoderService) Supports

func (*EncoderService) Supports(codec VideoCodec) bool

Supports returns a boolean indicating if the codec is supported

type Service

type Service interface {
	NewEncoder(codec VideoCodec, size image.Point, frameRate int) (Encoder, error)
	Supports(codec VideoCodec) bool
}

Service creates encoder instances

func NewEncoderService

func NewEncoderService() Service

NewEncoderService creates an encoder factory

type VideoCodec

type VideoCodec = int

VideoCodec can be either h264 or vp8

const (
	//NoCodec "zero-value"
	NoCodec VideoCodec = iota
	//H264Codec h264
	H264Codec
	//VP8Codec vp8
	VP8Codec
)

Jump to

Keyboard shortcuts

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