hls

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2019 License: BSD-3-Clause Imports: 21 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var FFMPEGPath = "ffmpeg"
View Source
var FFProbePath = "ffprobe"
View Source
var HomeDir = ".gohls"
View Source
var VideoSuffixes = []string{".mp4", ".rmvb", ".avi", ".mkv", ".flv", ".wmv", ".mov", ".mpg"}

Functions

func ClearCache added in v0.2.0

func ClearCache() error

func EncodingArgs added in v0.4.0

func EncodingArgs(videoFile string, segment int64, res int64) []string

func FilenameLooksLikeVideo

func FilenameLooksLikeVideo(name string) bool

func GetFFMPEGJson

func GetFFMPEGJson(path string) (map[string]interface{}, error)

func GetRawFFMPEGInfo

func GetRawFFMPEGInfo(path string) ([]byte, error)

func ServeJson

func ServeJson(status int, data interface{}, w http.ResponseWriter)

Types

type Empty

type Empty struct{}

type Encoder added in v0.4.0

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

func NewEncoder added in v0.4.0

func NewEncoder(cacheDir string, workerCount int) *Encoder

func (*Encoder) Encode added in v0.4.0

func (e *Encoder) Encode(r EncodingRequest)

func (*Encoder) GetCacheFile added in v0.4.0

func (e *Encoder) GetCacheFile(r EncodingRequest) string

func (*Encoder) GetFromCache added in v0.4.0

func (e *Encoder) GetFromCache(r EncodingRequest) ([]byte, error)

type EncodingRequest added in v0.4.0

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

func NewEncodingRequest added in v0.4.0

func NewEncodingRequest(file string, segment int64, res int64) *EncodingRequest

func NewWarmupEncodingRequest added in v0.4.0

func NewWarmupEncodingRequest(file string, segment int64, res int64) *EncodingRequest

type FrameHandler

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

func NewFrameHandler

func NewFrameHandler(idx fileindex.Index, rootUri string) *FrameHandler

func (*FrameHandler) ServeHTTP

func (s *FrameHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type HttpCommandHandler

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

func NewHttpCommandHandler

func NewHttpCommandHandler(workerCount int, cacheDir string) *HttpCommandHandler

func (*HttpCommandHandler) ServeCommand

func (s *HttpCommandHandler) ServeCommand(cmdPath string, args []string, key string, w io.Writer) error

type InfoHandler added in v0.4.0

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

func NewInfoHandler added in v0.4.0

func NewInfoHandler(idx fileindex.Index, title string, rootUri string) *InfoHandler

func (*InfoHandler) ServeHTTP added in v0.4.0

func (s *InfoHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type ListHandler

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

func NewListHandler

func NewListHandler(idx fileindex.Index, name string, rootUri string) *ListHandler

func (*ListHandler) ServeHTTP

func (s *ListHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type ListResponse

type ListResponse struct {
	Error   error                  `json:"error"`
	Name    string                 `json:"name"`
	Path    string                 `json:"path"`
	Parents *[]*ListResponseFolder `json:"parents"`
	Folders []*ListResponseFolder  `json:"folders"`
	Videos  []*ListResponseVideo   `json:"videos"`
}

type ListResponseFolder

type ListResponseFolder struct {
	Name string `json:"name"`
	Path string `json:"path"`
}

type ListResponseVideo

type ListResponseVideo struct {
	Name string     `json:"name"`
	Path string     `json:"path"`
	Info *VideoInfo `json:"info"`
}

type PlaylistHandler

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

func NewPlaylistHandler

func NewPlaylistHandler(idx fileindex.Index, rootUri string, segmentsPath string) *PlaylistHandler

func (*PlaylistHandler) ServeHTTP

func (s *PlaylistHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type StreamHandler

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

func NewStreamHandler

func NewStreamHandler(idx fileindex.Index, rootUri string) *StreamHandler

func (*StreamHandler) ServeHTTP

func (s *StreamHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type VideoInfo

type VideoInfo struct {
	Duration float64 `json:"duration"`
	//FileCreated      time.Time `json:"created"`
	FileLastModified time.Time `json:"lastModified"`
}

func GetVideoInformation

func GetVideoInformation(path string) (*VideoInfo, error)

Jump to

Keyboard shortcuts

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