Documentation ¶
Overview ¶
Package media provides high-level media services for multiplexing, extracting and transcoding audio and video.
Index ¶
- Constants
- Variables
- func NewMediaError(level ffmpeg.AVLogLevel, message string) error
- func ParseTrackDisc(value string) (uint, uint)
- func Version() string
- type Codec
- type Config
- type Format
- type LogLevel
- type Manager
- func (mgr *Manager) Close() error
- func (this *Manager) CodecByName(name string) *Codec
- func (this *Manager) Codecs(f ...MediaFlag) []*Codec
- func (mgr *Manager) CreateFile(path string) (*MediaOutput, error)
- func (mgr *Manager) Formats(f ...MediaFlag) []*Format
- func (mgr *Manager) Open(r io.Reader, bufsize int) (*MediaInput, error)
- func (mgr *Manager) OpenFile(path string) (*MediaInput, error)
- func (mgr *Manager) OpenURL(url *url.URL) (*MediaInput, error)
- func (mgr *Manager) Release(f Media) error
- func (mgr *Manager) ReleaseInput(f *MediaInput) error
- func (mgr *Manager) ReleaseOutput(f *MediaOutput) error
- func (mgr *Manager) String() string
- type MediaError
- type MediaInput
- func (m *MediaInput) CustomIO() bool
- func (m *MediaInput) Flags() MediaFlag
- func (m *MediaInput) Metadata() *Metadata
- func (m *MediaInput) Read(ctx context.Context, streams []int, fn DecodeIteratorFunc) error
- func (m *MediaInput) Release() error
- func (m *MediaInput) StreamForIndex(i int) *Stream
- func (m *MediaInput) Streams() []*Stream
- func (m *MediaInput) StreamsForFlag(flag MediaFlag) []int
- func (m *MediaInput) String() string
- func (m *MediaInput) URL() *url.URL
- type MediaOutput
- func (m *MediaOutput) Flags() MediaFlag
- func (m *MediaOutput) IsFile() bool
- func (m *MediaOutput) Metadata() *Metadata
- func (m *MediaOutput) Release() error
- func (m *MediaOutput) StreamForIndex(i int) *Stream
- func (m *MediaOutput) Streams() []*Stream
- func (m *MediaOutput) String() string
- func (m *MediaOutput) URL() *url.URL
- type Metadata
- type Stream
- type StreamMap
Constants ¶
View Source
const ( AV_LOG_PANIC = LogLevel(ffmpeg.AV_LOG_PANIC) AV_LOG_FATAL = LogLevel(ffmpeg.AV_LOG_FATAL) AV_LOG_ERROR = LogLevel(ffmpeg.AV_LOG_ERROR) AV_LOG_WARNING = LogLevel(ffmpeg.AV_LOG_WARNING) AV_LOG_INFO = LogLevel(ffmpeg.AV_LOG_INFO) AV_LOG_VERBOSE = LogLevel(ffmpeg.AV_LOG_VERBOSE) AV_LOG_DEBUG = LogLevel(ffmpeg.AV_LOG_DEBUG) AV_LOG_TRACE = LogLevel(ffmpeg.AV_LOG_TRACE) )
Variables ¶
View Source
var (
DefaultConfig = Config{Debug: false}
)
Functions ¶
func NewMediaError ¶
func NewMediaError(level ffmpeg.AVLogLevel, message string) error
func ParseTrackDisc ¶
Types ¶
type Codec ¶
type Codec struct {
// contains filtered or unexported fields
}
func NewCodecWithParameters ¶
func NewCodecWithParameters(ctx *ffmpeg.AVCodecParameters) *Codec
func (*Codec) Description ¶
type Config ¶
type Config struct { // Debug will output debug messages on error channel Debug bool `yaml:"debug"` }
type Format ¶
type Format struct {
// contains filtered or unexported fields
}
func NewInputFormat ¶
func NewInputFormat(ctx *ffmpeg.AVInputFormat) *Format
func NewOutputFormat ¶
func NewOutputFormat(ctx *ffmpeg.AVOutputFormat) *Format
func (*Format) Description ¶
type LogLevel ¶
type LogLevel ffmpeg.AVLogLevel
type Manager ¶
func NewManagerWithConfig ¶
func (*Manager) CodecByName ¶
func (*Manager) CreateFile ¶
func (mgr *Manager) CreateFile(path string) (*MediaOutput, error)
func (*Manager) ReleaseInput ¶
func (mgr *Manager) ReleaseInput(f *MediaInput) error
func (*Manager) ReleaseOutput ¶
func (mgr *Manager) ReleaseOutput(f *MediaOutput) error
type MediaError ¶
func (MediaError) Error ¶
func (e MediaError) Error() string
type MediaInput ¶
type MediaInput struct {
// contains filtered or unexported fields
}
func NewMediaInput ¶
func NewMediaInput(ctx *ffmpeg.AVFormatContext) *MediaInput
func (*MediaInput) CustomIO ¶
func (m *MediaInput) CustomIO() bool
func (*MediaInput) Flags ¶
func (m *MediaInput) Flags() MediaFlag
func (*MediaInput) Metadata ¶
func (m *MediaInput) Metadata() *Metadata
func (*MediaInput) Read ¶
func (m *MediaInput) Read(ctx context.Context, streams []int, fn DecodeIteratorFunc) error
Iterate over packets in the input stream
func (*MediaInput) Release ¶
func (m *MediaInput) Release() error
func (*MediaInput) StreamForIndex ¶
func (m *MediaInput) StreamForIndex(i int) *Stream
func (*MediaInput) Streams ¶
func (m *MediaInput) Streams() []*Stream
func (*MediaInput) StreamsForFlag ¶
func (m *MediaInput) StreamsForFlag(flag MediaFlag) []int
func (*MediaInput) String ¶
func (m *MediaInput) String() string
func (*MediaInput) URL ¶
func (m *MediaInput) URL() *url.URL
type MediaOutput ¶
type MediaOutput struct {
// contains filtered or unexported fields
}
func NewMediaOutput ¶
func NewMediaOutput(ctx *ffmpeg.AVFormatContext) *MediaOutput
func (*MediaOutput) Flags ¶
func (m *MediaOutput) Flags() MediaFlag
func (*MediaOutput) IsFile ¶
func (m *MediaOutput) IsFile() bool
func (*MediaOutput) Metadata ¶
func (m *MediaOutput) Metadata() *Metadata
func (*MediaOutput) Release ¶
func (m *MediaOutput) Release() error
func (*MediaOutput) StreamForIndex ¶
func (m *MediaOutput) StreamForIndex(i int) *Stream
func (*MediaOutput) Streams ¶
func (m *MediaOutput) Streams() []*Stream
func (*MediaOutput) String ¶
func (m *MediaOutput) String() string
func (*MediaOutput) URL ¶
func (m *MediaOutput) URL() *url.URL
type Metadata ¶
type Metadata struct {
// contains filtered or unexported fields
}
func NewMetadata ¶
func NewMetadata(dict *ffmpeg.AVDictionary) *Metadata
Click to show internal directories.
Click to hide internal directories.