loader

package
v0.0.0-...-f6e7208 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DEFAULT_FFMPEG_COMMAND_STRING = "ffmpeg -hide_banner -i %s -s %s -vf fps=15/1 -f rawvideo -c:v rawvideo -pix_fmt rgb24 -"
	// Dryrun is for getting total frames
	FFMPEG_DRYRUN     = "ffmpeg -hide_banner -i %s -s 1x1 -vf fps=15/1 -f rawvideo -c:v rawvideo -pix_fmt rgb24 -"
	FFMPEG_IMAGE_SIZE = "ffmpeg -i %s -f null -"
)

Variables

View Source
var LoaderMap = make(map[string]func(...string) MediaLoader)

Functions

func Lerp

func Lerp(start, end, t float64) float64

Types

type FFMPEG

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

func (*FFMPEG) GetTotalFrames

func (l *FFMPEG) GetTotalFrames(filename string) (int, error)

func (*FFMPEG) ImageSize

func (l *FFMPEG) ImageSize(filename string) (image.Point, error)

func (*FFMPEG) Load

func (l *FFMPEG) Load(filename string, size image.Point) ([]image.Image, error)

Runs ffmpeg binary to ... if the file is video, get each frame of the video/gif if the file is image, get image with specified size. The frames are being loaded forehand and will get saved in the buffer. If the terminal size is altered, this whole process should happen again.

type FFMPEGJob

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

type FFMPEGWorkerPool

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

func NewFFMPEGWorkerPool

func NewFFMPEGWorkerPool(bufsize int, poolsize int, jobFn func(*FFMPEGJob)) *FFMPEGWorkerPool

func (*FFMPEGWorkerPool) Acquire

func (wp *FFMPEGWorkerPool) Acquire() (*FFMPEGJob, chan<- *FFMPEGJob)

func (*FFMPEGWorkerPool) Wait

func (wp *FFMPEGWorkerPool) Wait()

type GoimageLoader

type GoimageLoader struct {
}

func (*GoimageLoader) ImageSize

func (l *GoimageLoader) ImageSize(filename string) (image.Point, error)

func (*GoimageLoader) Load

func (l *GoimageLoader) Load(filename string, size image.Point) ([]image.Image, error)

type MediaLoader

type MediaLoader interface {
	Load(filename string, size image.Point) ([]image.Image, error)
	ImageSize(filename string) (image.Point, error)
}

func NewFFMPEG

func NewFFMPEG(options ...string) MediaLoader

func NewGoimage

func NewGoimage(options ...string) MediaLoader

Jump to

Keyboard shortcuts

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