encoder

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2022 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoPreset               = errors.New("no presetID on video")
	ErrNoVideoFiles           = errors.New("no video files")
	ErrNoSourceFile           = errors.New("no source file set")
	ErrTooManySourceFiles     = errors.New("too many source files set")
	ErrNoFormats              = errors.New("preset has no formats set")
	ErrNoArgs                 = errors.New("no encoding arguments set")
	ErrVTFailedToCreate       = errors.New("vt failed to create encode job")
	ErrVTFailedToAuthenticate = errors.New("failed to authenticate to vt")
	ErrVTUnknownResponse      = errors.New("unknown vt response")
)

Functions

func Manager

func Manager()

Manager subroutine provides a service to manage videos, also ensuring consistency of video library.

Types

type Config added in v0.7.0

type Config struct {
	VTEndpoint  string
	ServeBucket string
}

type EncodeFormat added in v0.7.0

type EncodeFormat struct {
	Arguments  string `db:"arguments"`
	FileSuffix string `db:"file_suffix"`
}

type EncodeResult added in v0.7.0

type EncodeResult struct {
	URI   string
	JobID string
}

type Encoder added in v0.7.0

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

func NewEncoder added in v0.7.0

func NewEncoder(db *sqlx.DB, cdn *s3.S3, conf *Config) *Encoder

func (*Encoder) CreateEncode added in v0.7.0

func (e *Encoder) CreateEncode(ctx context.Context, file VideoFile, formatID int) (EncodeResult, error)

CreateEncode creates an encode item in the message queue.

func (*Encoder) Refresh added in v0.7.0

func (e *Encoder) Refresh(ctx context.Context) error

Refresh will check all existing videoitems to ensure that they match their preset, creating new job

func (*Encoder) RefreshVideo added in v0.7.0

func (e *Encoder) RefreshVideo(ctx context.Context, videoID int) error

RefreshVideoItem will run CreateEncode() on a VideoItem for any encodes missing in the preset.

func (*Encoder) TranscodeFinished added in v0.7.0

func (e *Encoder) TranscodeFinished(ctx context.Context, taskID string) error

type TaskIdentification added in v0.7.0

type TaskIdentification struct {
	State  string `json:"state"`
	TaskID string `json:"taskID"`
}

TaskIdentification is for initially informing the user of their job starting and its given ID for later checking

type VideoFile added in v0.7.0

type VideoFile struct {
	FileID         int    `db:"file_id"`
	EncodeFormatID int    `db:"format_id"`
	URI            string `db:"uri"`
	IsSource       bool   `db:"is_source"`
}

type VideoItem added in v0.7.0

type VideoItem struct {
	VideoID  int  `db:"video_id"`
	PresetID *int `db:"preset_id"`
	Files    []VideoFile
}

Jump to

Keyboard shortcuts

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