streaming

package
v2.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IProcess

type IProcess interface {
	Spawn(path, URI string) *exec.Cmd
}

IProcess is an interface around the FFMPEG process

type IStream

type IStream interface {
	Start() *sync.WaitGroup
	Restart() *sync.WaitGroup
	Stop() error
}

IStream is almost like icecream, that's why it is perfect

type Process

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

Process is the main type for creating new processes

func NewProcess

func NewProcess(
	keepFiles bool,
	audio bool,
	loggingOpts config.ProcessLogging,
) *Process

NewProcess creates a new process able to spawn transcoding FFMPEG processes

func (Process) Spawn

func (p Process) Spawn(path, URI string) *exec.Cmd

Spawn creates a new FFMPEG cmd

type Stream

type Stream struct {
	ID          string                 `json:"id"`
	Path        string                 `json:"path"`
	Running     bool                   `json:"running"`
	CMD         *exec.Cmd              `json:"-"`
	Process     IProcess               `json:"-"`
	Mux         *sync.Mutex            `json:"-"`
	Streak      *hotstreak.Hotstreak   `json:"-"`
	OriginalURI string                 `json:"-"`
	StorePath   string                 `json:"-"`
	KeepFiles   bool                   `json:"-"`
	LoggingOpts *config.ProcessLogging `json:"-"`
	Logger      *lumberjack.Logger     `json:"-"`
	WaitTimeOut time.Duration          `json:"-"`
}

Stream describes a given host's streaming

func NewStream

func NewStream(
	URI string,
	storingDirectory string,
	keepFiles bool,
	audio bool,
	loggingOpts config.ProcessLogging,
	waitTimeOut time.Duration,
) (*Stream, string)

NewStream creates a new transcoding process for ffmpeg

func (*Stream) Restart

func (strm *Stream) Restart() *sync.WaitGroup

Restart restarts the given CMD

func (*Stream) Start

func (strm *Stream) Start() *sync.WaitGroup

Start is starting a new transcoding process

func (*Stream) Stop

func (strm *Stream) Stop() error

Stop makes sure that the transcoding process is killed correctly

Jump to

Keyboard shortcuts

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