ffmpeg

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2025 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidBitRate = errors.New("invalid bitrate")
View Source
var ErrInvalidBitsPerSample = errors.New("bits per sample must be 8 or 10")
View Source
var ErrInvalidCodec = errors.New("only hevc supported")
View Source
var ErrMissingFilename = errors.New("missing filename")

Functions

This section is empty.

Types

type Bits

type Bits int

func (Bits) Format

func (b Bits) Format(decimals int) string

type Processor

type Processor struct {
	Logger *slog.Logger
}

Processor implements video scanning (ffprobe) and converting (ffmpeg). Implemented as a struct so that it can be mocked at the calling side.

func (Processor) Convert

func (p Processor) Convert(ctx context.Context, request Request) error

func (Processor) Scan

func (p Processor) Scan(_ context.Context, path string) (VideoStats, error)

type Progress

type Progress struct {
	Converted time.Duration
	Speed     float64
}

type Request

type Request struct {
	ProgressCB  func(Progress)
	Source      string
	Target      string
	TargetStats VideoStats
}

func (Request) IsValid

func (r Request) IsValid() error

type VideoStats

type VideoStats struct {
	VideoCodec    string
	Duration      time.Duration
	BitRate       int
	BitsPerSample int
	Height        int
	Width         int
}

func (VideoStats) LogValue added in v0.3.1

func (s VideoStats) LogValue() slog.Value

func (VideoStats) String

func (s VideoStats) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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