codec

package
v0.0.0-...-3f9f10d Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package codec defines the encoder and factory interfaces for encoding video frames and audio chunks.

Index

Constants

View Source
const DefaultKeyFrameInterval = 30

DefaultKeyFrameInterval is the default interval chosen in order to produce high enough quality results at a low latency.

Variables

This section is empty.

Functions

This section is empty.

Types

type AudioEncoder

type AudioEncoder interface {
	Encode(ctx context.Context, chunk wave.Audio) ([]byte, bool, error)
	Close()
}

An AudioEncoder is anything that can encode audo chunks into bytes. This means that the encoder must follow some type of format dictated by a type (see AudioEncoderFactory.MimeType). An encoder that produces bytes of different encoding formats per call is invalid.

type AudioEncoderFactory

type AudioEncoderFactory interface {
	New(sampleRate, channelCount int, latency time.Duration, logger golog.Logger) (AudioEncoder, error)
	MIMEType() string
}

An AudioEncoderFactory produces AudioEncoders and provides information about the underlying encoder itself.

type VideoEncoder

type VideoEncoder interface {
	Encode(ctx context.Context, img image.Image) ([]byte, error)
}

A VideoEncoder is anything that can encode images into bytes. This means that the encoder must follow some type of format dictated by a type (see EncoderFactory.MimeType). An encoder that produces bytes of different encoding formats per call is invalid.

type VideoEncoderFactory

type VideoEncoderFactory interface {
	New(height, width, keyFrameInterval int, logger golog.Logger) (VideoEncoder, error)
	MIMEType() string
}

A VideoEncoderFactory produces VideoEncoders and provides information about the underlying encoder itself.

Directories

Path Synopsis
Package mmal contains the mmal video codec.
Package mmal contains the mmal video codec.
Package opus contains the opus video codec.
Package opus contains the opus video codec.
Package vpx contains the vpx video codec.
Package vpx contains the vpx video codec.
Package x264 contains the x264 video codec.
Package x264 contains the x264 video codec.

Jump to

Keyboard shortcuts

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