avcodec

package
v1.7.7 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

avcodec is roughly a wrapper around FFmpeg's libavcodec library, which provides encoding, decoding and transcoding of audio and video streams.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Codecs

func Codecs(t media.Type) []media.Metadata

Return all codecs. Codecs can be either encoders or decoders. The argument can be ANY or any combination of INPUT, OUTPUT, VIDEO, AUDIO and SUBTITLE, in order to return a subset of codecs.

Types

type Codec

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

func NewDecodingCodec

func NewDecodingCodec(name string, opts ...Opt) (*Codec, error)

NewDecodingCodec returns a decoder by name. Options for decoding can be passed. Call Close() to release the codec context. Codec options are listed at <https://ffmpeg.org/ffmpeg-codecs.html>

func NewEncodingCodec

func NewEncodingCodec(name string, opts ...Opt) (*Codec, error)

NewEncodingCodec returns an encoder by name. Options for encoding can be passed. Call Close() to release the codec. Codec options are listed at <https://ffmpeg.org/ffmpeg-codecs.html>

func (*Codec) Close

func (ctx *Codec) Close() error

Release the codec resources

func (*Codec) MarshalJSON

func (ctx *Codec) MarshalJSON() ([]byte, error)

func (*Codec) Name

func (ctx *Codec) Name() string

func (*Codec) String

func (ctx *Codec) String() string

func (*Codec) Type

func (ctx *Codec) Type() media.Type

type EncodingContext

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

type Opt

type Opt func(*opt) error

func WithChannelLayout

func WithChannelLayout(v string) Opt

func WithFrameRate

func WithFrameRate(num, den int) Opt

func WithFrameSize

func WithFrameSize(v string) Opt

func WithOpt

func WithOpt(key string, value any) Opt

func WithPixelFormat

func WithPixelFormat(v string) Opt

func WithSampleFormat

func WithSampleFormat(v string) Opt

func WithSampleRate

func WithSampleRate(v int) Opt

Jump to

Keyboard shortcuts

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