ffmpeg

package
v0.4.16 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrNoMem           = avError(-C.ENOMEM)
	ErrEOF             = avError(C.AVERROR_EOF)
	ErrUnknown         = avError(C.AVERROR_UNKNOWN)
	ErrDecoderNotFound = avError(C.AVERROR_DECODER_NOT_FOUND)
	ErrInvalidData     = avError(C.AVERROR_INVALIDDATA)
	ErrTooBig          = avError(C.ERR_TOO_BIG)
)

AV Error enum

Variables

This section is empty.

Functions

func SetFFmpegLogLevel

func SetFFmpegLogLevel(logLevel AVLogLevel)

SetFFmpegLogLevel allows you to change the log level from the default (AVLogInfo).

func SetLogging added in v0.0.2

func SetLogging(handler LoggingHandlerFunction)

SetLogging set AV logging handler

Types

type AVContext

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

AVContext manages lifecycle of AV contexts and reader stream

func LoadAVContext

func LoadAVContext(reader io.Reader, size int64) (*AVContext, error)

LoadAVContext load and create AVContext from reader stream

func (*AVContext) Close

func (av *AVContext) Close()

Close AVContext objects

func (*AVContext) Export added in v0.0.4

func (av *AVContext) Export(bands int) (buf []byte, err error)

Export frame to RGB or RGBA buffer

func (*AVContext) Metadata

func (av *AVContext) Metadata() *Metadata

Metadata AV metadata

func (*AVContext) ProcessFrames added in v0.2.0

func (av *AVContext) ProcessFrames(maxFrames int) (err error)

ProcessFrames triggers frame processing limit under max num of frames if maxFrames > 0

func (*AVContext) SeekDuration added in v0.3.2

func (av *AVContext) SeekDuration(ts time.Duration) error

SeekDuration seeks to keyframe before the specified duration

func (*AVContext) SeekPosition added in v0.3.2

func (av *AVContext) SeekPosition(f float64) error

SeekPosition seeks to keyframe before specified position percentage between 0 and 1 then process frames to find precise position

func (*AVContext) SelectDuration added in v0.3.0

func (av *AVContext) SelectDuration(ts time.Duration) (err error)

SelectDuration seeks to keyframe before the specified duration then process frames to find precise duration

func (*AVContext) SelectFrame added in v0.2.0

func (av *AVContext) SelectFrame(n int) (err error)

SelectFrame triggers frame processing and select specific frame index

func (*AVContext) SelectPosition added in v0.3.0

func (av *AVContext) SelectPosition(f float64) (err error)

type AVLogLevel

type AVLogLevel int

AVLogLevel defines the ffmpeg threshold for dumping information to stderr.

const (
	AVLogQuiet AVLogLevel = (iota - 1) * 8
	AVLogPanic
	AVLogFatal
	AVLogError
	AVLogWarning
	AVLogInfo
	AVLogVerbose
	AVLogDebug
	AVLogTrace
)

AVLogLevel enum

type LoggingHandlerFunction added in v0.0.2

type LoggingHandlerFunction func(messageLevel AVLogLevel, message string)

type Metadata

type Metadata struct {
	Orientation int     `json:"orientation"`
	Duration    int     `json:"duration,omitempty"`
	Width       int     `json:"width,omitempty"`
	Height      int     `json:"height,omitempty"`
	Title       string  `json:"title,omitempty"`
	Artist      string  `json:"artist,omitempty"`
	FPS         float64 `json:"fps,omitempty"`
	HasVideo    bool    `json:"has_video"`
	HasAudio    bool    `json:"has_audio"`
}

Metadata AV metadata

Jump to

Keyboard shortcuts

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