ffmpeg

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2020 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package ffmpeg provides process management and monitoring for ffmpeg.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Args

type Args struct {
	ConstantRateFactor         int
	EnableHardwareAcceleration bool
	EnableExperimentalCodecs   bool
	EnableFastStart            bool
	InputFile                  string
	OutputFile                 string
	ProgressAddress            string
	Preset                     string
}

Args hold arguments for ffmpeg executable. http://trac.ffmpeg.org/wiki/Encode/H.264 https://github.com/a-nagrani/ffmpeg-commands

type FFMetadata

type FFMetadata struct {
	Frames []map[string]string
	Format map[string]string
}

FFMetadata contains metadata for a media file.

type Process

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

Process manages a ffmpeg process to perform some action.

func New

func New() *Process

New creates a new Process.

func (*Process) Concatenate

func (ffw *Process) Concatenate(ctx context.Context, inputFile []string, outputFile string) error

Concatenate a collection of media files into 1 file.

func (*Process) Probe

func (ffw *Process) Probe(ctx context.Context, filename string) (*FFMetadata, error)

Probe the information of the file.

func (*Process) Run

func (ffw *Process) Run(ctx context.Context, args Args) error

Run spawns an ffmpeg process to do perform video encoding. This method waits for the encoding to finish.

func (*Process) RunEx

func (ffw *Process) RunEx(ctx context.Context, relay ProgressRelay, args Args) error

RunEx spawns an ffmpeg process to do perform video encoding. This method waits for the encoding to finish.

func (*Process) Truncate

func (ffw *Process) Truncate(ctx context.Context, inputFile string, outputFile string, startSecond float64, durationSeconds float64) error

Truncate extracts a portion of the video file.

type ProgressRelay

type ProgressRelay interface {
	OnFfmpegComplete()
	OnFfmpegProgress(map[string]string)
}

ProgressRelay reports progress of the encoding process to any event sink.

Jump to

Keyboard shortcuts

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