ffmpeg

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Exec

type Exec struct {
	Loglevel Loglevel
	// contains filtered or unexported fields
}

func New

func New(ffmpegFile string, options ...Option) *Exec

func (*Exec) ExecCtx

func (e *Exec) ExecCtx(ctx context.Context, args ...string) error

func (*Exec) ExecCtxValue

func (e *Exec) ExecCtxValue(ctx context.Context, loglevel Loglevel, args ...string) (string, error)

func (*Exec) GenerateVideoPreviewImg

func (e *Exec) GenerateVideoPreviewImg(ctx context.Context, videoFilePath, outputFilePath string) error

GenerateVideoPreviewImg 视频预览图

func (*Exec) GetResolution

func (e *Exec) GetResolution(ctx context.Context, input string) (image.Point, error)

GetResolution 获取分辨率

func (*Exec) MergeImg2Video

func (e *Exec) MergeImg2Video(ctx context.Context, imgDir, audioFile, outputFile string) error

MergeImg2Video 合并图片成视频

func (*Exec) Overlay

func (e *Exec) Overlay(ctx context.Context, isVideo bool, outputFile string, elementFile ...string) error

Overlay 视频叠加

func (*Exec) Scale

func (e *Exec) Scale(ctx context.Context, input string, w, h int, output string) error

Scale 缩放

func (*Exec) VideoFrameExtraction

func (e *Exec) VideoFrameExtraction(ctx context.Context, videoFile, outputDir string) error

VideoFrameExtraction 将视频以每秒24帧的方式提取 videoFile 视频文件 outputDir 输出目录

type Loglevel

type Loglevel int
const (
	// LogLevelQuiet Show nothing at all; be silent.
	LogLevelQuiet Loglevel = -8
	// LogLevelPanic Only show fatal errors which could lead the process to crash, such as an assertion failure. This is not currently used for anything.
	LogLevelPanic Loglevel = 0
	// LogLevelFatal Only show fatal errors. These are errors after which the process absolutely cannot continue.
	LogLevelFatal Loglevel = 8
	// LogLevelError Show all errors, including ones which can be recovered from.
	LogLevelError Loglevel = 16
	// LogLevelWarning Show all warnings and errors. Any message related to possibly incorrect or unexpected events will be shown.
	LogLevelWarning Loglevel = 24
	// LogLevelInfo Show informative messages during processing. This is in addition to warnings and errors. This is the default value.
	LogLevelInfo Loglevel = 32
	// LogLevelVerbose Same as info, except more verbose.
	LogLevelVerbose Loglevel = 40
	// LogLevelDebug Show everything, including debugging information.
	LogLevelDebug Loglevel = 48
	LogLevelTrace Loglevel = 56
)

type Option

type Option func(*Exec)

func WithLoglevel

func WithLoglevel(loglevel Loglevel) Option

Jump to

Keyboard shortcuts

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