mux

package module
v0.0.0-...-1fadc4d Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2023 License: MIT Imports: 10 Imported by: 1

README

mux

An oversimplified media muxing/demuxing/transcoding library for Go.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrAgain = errors.New("resource temporarily unavailable")

	ErrNotOpen = errors.New("encoder/decoder is not open for I/O")
)

Functions

This section is empty.

Types

type Codec

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

func FindCodec

func FindCodec(name string) *Codec

func MustFindCodec

func MustFindCodec(name string) *Codec

func NewCodec

func NewCodec(id avcodec.CodecID) *Codec

func (*Codec) Name

func (c *Codec) Name() string

func (*Codec) NewDecoder

func (c *Codec) NewDecoder() *CodecIO

func (*Codec) NewEncoder

func (c *Codec) NewEncoder() *CodecIO

type CodecIO

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

func (*CodecIO) Close

func (cio *CodecIO) Close() error

func (*CodecIO) CopyCodecParameters

func (cio *CodecIO) CopyCodecParameters(dst *Stream) error

func (*CodecIO) CopyParameters

func (cio *CodecIO) CopyParameters(dst *CodecIO) error

func (*CodecIO) Encoder

func (cio *CodecIO) Encoder() bool

func (*CodecIO) Flush

func (cio *CodecIO) Flush() error

func (*CodecIO) Open

func (cio *CodecIO) Open() error

func (*CodecIO) ReadFrame

func (cio *CodecIO) ReadFrame(frm *Frame) error

func (*CodecIO) ReadPacket

func (cio *CodecIO) ReadPacket(pkt *Packet) error

func (*CodecIO) WriteFrame

func (cio *CodecIO) WriteFrame(frm *Frame) error

func (*CodecIO) WritePacket

func (cio *CodecIO) WritePacket(pkt *Packet) error

type CodecSet

type CodecSet struct {
	Audio, Video, Subtitle *Codec
}

type Demuxer

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

func AvailableDemuxers

func AvailableDemuxers() []*Demuxer

func FindDemuxer

func FindDemuxer(name, ext, mime string) *Demuxer

func MustFindDemuxer

func MustFindDemuxer(name, ext, mime string) *Demuxer

func (*Demuxer) Extensions

func (d *Demuxer) Extensions() []string

func (*Demuxer) Input

func (d *Demuxer) Input() bool

func (*Demuxer) LongName

func (d *Demuxer) LongName() string

func (*Demuxer) MIME

func (d *Demuxer) MIME() []string

func (*Demuxer) Name

func (d *Demuxer) Name() string

type ErrAV

type ErrAV struct {
	Code int
}

func (*ErrAV) Error

func (eav *ErrAV) Error() string

type Format

type Format interface {
	Name() string
	LongName() string
	MIME() []string
	Extensions() []string
	Input() bool
}

type Frame

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

func NewFrame

func NewFrame() *Frame

func (*Frame) Clear

func (f *Frame) Clear() error

func (*Frame) Close

func (f *Frame) Close() error

type IOContext

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

func NewInputContext

func NewInputContext(path string) (*IOContext, error)

func NewOutputContext

func NewOutputContext(fmt *Muxer, path string) (*IOContext, error)

func (*IOContext) Close

func (ioc *IOContext) Close() error

func (*IOContext) Metadata

func (ioc *IOContext) Metadata() map[string]string

func (*IOContext) NewStream

func (ioc *IOContext) NewStream(codec *Codec) *Stream

func (*IOContext) ReadFrame

func (ioc *IOContext) ReadFrame(pkt *Packet) error

func (*IOContext) Stream

func (ioc *IOContext) Stream(index int) *Stream

func (*IOContext) Streams

func (ioc *IOContext) Streams() []*Stream

func (*IOContext) WriteEnd

func (ioc *IOContext) WriteEnd() error

func (*IOContext) WriteFrame

func (ioc *IOContext) WriteFrame(pkt *Packet) error

func (*IOContext) WriteHeader

func (ioc *IOContext) WriteHeader() error

type MediaType

type MediaType int
const (
	MediaTypeUnknown MediaType = iota
	MediaTypeAudio
	MediaTypeVideo
	MediaTypeSubtitle
	MediaTypeAttachment
)

type Muxer

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

func AvailableMuxers

func AvailableMuxers() []*Muxer

func FindMuxer

func FindMuxer(name, ext, mime string) *Muxer

func MustFindMuxer

func MustFindMuxer(name, ext, mime string) *Muxer

func (*Muxer) Extensions

func (m *Muxer) Extensions() []string

func (*Muxer) Input

func (m *Muxer) Input() bool

func (*Muxer) LongName

func (m *Muxer) LongName() string

func (*Muxer) MIME

func (m *Muxer) MIME() []string

func (*Muxer) Name

func (m *Muxer) Name() string

func (*Muxer) PreferredCodecs

func (m *Muxer) PreferredCodecs() *CodecSet

func (*Muxer) SupportsCodec

func (m *Muxer) SupportsCodec(codec *Codec) bool

type Packet

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

func NewPacket

func NewPacket() *Packet

func (*Packet) Clear

func (p *Packet) Clear() error

func (*Packet) Close

func (p *Packet) Close() error

func (*Packet) Pos

func (p *Packet) Pos() int

func (*Packet) Rescale

func (p *Packet) Rescale(src, dst *Rational)

func (*Packet) ResetPos

func (p *Packet) ResetPos()

func (*Packet) SetPos

func (p *Packet) SetPos(pos int)

func (*Packet) SetStreamIndex

func (p *Packet) SetStreamIndex(index int)

func (*Packet) StreamIndex

func (p *Packet) StreamIndex() int

type Rational

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

func NewRational

func NewRational(num, den int) *Rational

func (*Rational) Den

func (r *Rational) Den() int

func (*Rational) Num

func (r *Rational) Num() int

type Stream

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

func (*Stream) Codec

func (s *Stream) Codec() *Codec

func (*Stream) CopyCodecParameters

func (s *Stream) CopyCodecParameters(dst *CodecIO) error

func (*Stream) CopyParameters

func (s *Stream) CopyParameters(dst *Stream) error

func (*Stream) Decoder

func (s *Stream) Decoder() (*CodecIO, error)

func (*Stream) Index

func (s *Stream) Index() int

func (*Stream) TimeBase

func (s *Stream) TimeBase() *Rational

func (*Stream) Type

func (s *Stream) Type() MediaType

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

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