utils

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: May 12, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrorStack

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

func NewErrorStack

func NewErrorStack() *ErrorStack

func (*ErrorStack) Add

func (e *ErrorStack) Add(err error)

func (*ErrorStack) Error

func (e *ErrorStack) Error() string

func (*ErrorStack) Get

func (e *ErrorStack) Get() error

type FFMPEG added in v1.0.0

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

func NewFFMPEG added in v1.0.0

func NewFFMPEG(log tools.Logger) *FFMPEG

func (*FFMPEG) Bitrate added in v1.0.0

func (f *FFMPEG) Bitrate(file string) (int, error)

Bitrate returns the bitrate of a video

func (*FFMPEG) FPS added in v1.0.0

func (f *FFMPEG) FPS(file string) (int, error)

FPS returns fps of video

func (*FFMPEG) Filesize added in v1.0.0

func (f *FFMPEG) Filesize(file string) (int, error)

func (*FFMPEG) Resolution added in v1.0.0

func (f *FFMPEG) Resolution(file string) ([2]int, error)

Resolution returns the resolution of a video

func (*FFMPEG) Seconds added in v1.0.0

func (f *FFMPEG) Seconds(file string) (int, error)

Seconds returns the length of a video in seconds

func (*FFMPEG) Shot added in v1.0.0

func (f *FFMPEG) Shot(input string, s int) (image.Image, error)

Shot takes a screenshot of a video at a given second

func (*FFMPEG) ShotJPEG added in v1.0.0

func (f *FFMPEG) ShotJPEG(input string, output string, s int, quality int) error

ShotJpeg takes a screenshot of a video at a given second and saves it as a jpeg

func (*FFMPEG) ShotPNG added in v1.0.0

func (f *FFMPEG) ShotPNG(input string, output string, s int) error

func (*FFMPEG) Specs added in v1.0.0

func (f *FFMPEG) Specs(file string) (*Spec, error)

type File added in v0.3.3

type File string

func (File) Filename added in v0.3.3

func (fp File) Filename() string

Filename returns name of file

func (File) Path added in v0.3.3

func (fp File) Path() string

Path returns path of file

func (File) SaveImagesByPattern added in v1.0.0

func (fp File) SaveImagesByPattern(pattern string, images ...image.Image) error

type List added in v1.0.0

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

func NewList added in v1.0.0

func NewList(log tools.Logger, ffmpeg *FFMPEG) *List

func (*List) Make added in v1.0.0

func (l *List) Make(spec *Spec, grid, width int, images []image.Image) (image.Image, error)

type Spec added in v1.0.0

type Spec struct {
	Title      string
	Resolution [2]int
	Fps        int
	Size       int
	Duration   int
}

func (*Spec) Load added in v1.0.0

func (s *Spec) Load(ffmpeg *FFMPEG, file string, count int) ([]image.Image, error)

Load return video screenshots

Jump to

Keyboard shortcuts

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