Documentation ¶
Index ¶
- Variables
- func HandleCheck(job Job)
- func HandleStreamParams(job Job)
- func HandleTranscode(job Job)
- func HandleTranscodeParams(job Job)
- type Job
- type Probe
- type Stream
- type Transcoder
- func (t *Transcoder) Job(work string, media m.Media) Job
- func (t *Transcoder) Probe(path string) (Stream, error)
- func (t *Transcoder) RegisterTasks(tasks map[string]func(Job))
- func (t *Transcoder) Start()
- func (t *Transcoder) Status(hash string) string
- func (t *Transcoder) Submit(job Job)
- func (t *Transcoder) Subtitles(path, hash string) error
- func (t *Transcoder) Transcoded(hash string) bool
- func (t *Transcoder) UpdateStatus(hash, status string)
- type Worker
Constants ¶
This section is empty.
Variables ¶
var (
ErrTaskNotFound = errors.New("Task with this name not found")
)
Functions ¶
func HandleCheck ¶
func HandleCheck(job Job)
HandleCheck handles the check if the provided file is already transcoded
func HandleStreamParams ¶
func HandleStreamParams(job Job)
HandleStreamParams handles the retrieval of stream params
func HandleTranscodeParams ¶
func HandleTranscodeParams(job Job)
HandleTranscodeParams handles the retrieval of transcoding params
Types ¶
type Transcoder ¶
type Transcoder struct { Config *m.Config Queue chan Job ReadyQueue chan chan Job Workers []*Worker Tasks map[string]func(Job) Jobs map[string]string DispatcherStopped sync.WaitGroup WorkersStopped sync.WaitGroup // contains filtered or unexported fields }
func (*Transcoder) Probe ¶
func (t *Transcoder) Probe(path string) (Stream, error)
Probe issues a single ffprobe on the provided media file path and returns framerate, width and height of the video
func (*Transcoder) RegisterTasks ¶
func (t *Transcoder) RegisterTasks(tasks map[string]func(Job))
RegisterTasks registers tasks executed by the workers
func (*Transcoder) Start ¶
func (t *Transcoder) Start()
Start starts the multithreaded Transcoder workers
func (*Transcoder) Status ¶
func (t *Transcoder) Status(hash string) string
Status returns the status of the job with the provided hash
func (*Transcoder) Submit ¶
func (t *Transcoder) Submit(job Job)
Submit add the job both to the job map and the queue
func (*Transcoder) Subtitles ¶
func (t *Transcoder) Subtitles(path, hash string) error
Subtitles issues a single ffmpeg on the provided media file path and saves the subtitles in a srt file
func (*Transcoder) Transcoded ¶
func (t *Transcoder) Transcoded(hash string) bool
Transcoded returns if the file / media with the hash is already transcoded
func (*Transcoder) UpdateStatus ¶
func (t *Transcoder) UpdateStatus(hash, status string)
UpdateStatus updates the status of the job with the provided hash to status