processor

package
v0.0.0-...-dec19c8 Latest Latest
Warning

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

Go to latest
Published: May 17, 2024 License: MIT Imports: 23 Imported by: 0

Documentation

Overview

Package processor contains mp4 file processor which can only do segmentation for now.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Logger           *zap.Logger
	Notificator      *notificator.Notificator
	Store            MediaStore
	VideoAPIEndpoint string
	VideoAPIToken    string
	InputPathPrefix  string
	OutputPathPrefix string
	SegmentDuration  time.Duration
	VideoCheckPeriod time.Duration
}

type MediaStore

type MediaStore interface {
	Put(ctx context.Context, name string, r io.Reader, size int64) error
	Get(ctx context.Context, name string) (io.ReadSeekCloser, int64, error)
}

type Processor

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

Processor is worker-style app that polls videoapi for uploaded videos, processes them and notifies videoapi about results.

Processing includes - segmentation - MPD generation Segments and static MPD are stored in MediaStore (s3).

func New

func New(cfg *Config) (*Processor, error)

func (*Processor) ProcessFileFromReader

func (p *Processor) ProcessFileFromReader(ctx context.Context, rs io.ReadSeeker, location string) (*meta.Meta, error)

ProcessFileFromReader segments mp4 file provided as reader using specified segment duration and writes resulting segments to segment writer. It also generates StaticMPD schema.

func (*Processor) Run

func (p *Processor) Run(ctx context.Context, wg *sync.WaitGroup, _ chan<- error)

Jump to

Keyboard shortcuts

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