ffrun

package
v0.2.0 Latest Latest
Warning

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

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

Documentation

Overview

Package ffrun provides a wrapper to run ffmpeg.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsInvalidInput

func IsInvalidInput(err error) bool

Types

type Error

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

func (*Error) Contains

func (e *Error) Contains(s string) bool

func (*Error) Error

func (e *Error) Error() string

func (*Error) Lines

func (e *Error) Lines() []string

func (*Error) Unwrap

func (e *Error) Unwrap() error

type Instance

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

func New

func New(opt Options) *Instance

func (*Instance) Probe

func (i *Instance) Probe(ctx context.Context, filePath string) (*ffmpeg.Probe, error)

Probe performs ffprobe on filePath and returns typed result.

func (*Instance) Run

func (i *Instance) Run(ctx context.Context, opt RunOptions) error

Run performs requested ffmpeg operation like video encoding.

type Options

type Options struct {
	Binary         string
	BinaryProbe    string
	TracerProvider trace.TracerProvider
}

type Progress

type Progress struct {
	Speed    float64 // 10.8x
	Complete float64 // 0..1
}

type RunOptions

type RunOptions struct {
	Input          string // input file path
	Output         string // output file path
	Progress       func(p Progress)
	ProgressPeriod time.Duration
	InputArgs      []string
	Args           []string
	Probe          *ffmpeg.Probe
}

Jump to

Keyboard shortcuts

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