services

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2025 License: MIT Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OutputDirContext contextKey = iota
	SourceURLContext
)
View Source
const (
	HLSAACCodecFlag = "hls-aac-codec"
)
View Source
const (
	OutputFlag = "output"
)

Variables

View Source
var DefaultRenditions = []Rendition{
	{
		Height:   240,
		DefRate:  500,
		Required: true,
	},
	{
		Height:   360,
		DefRate:  1000,
		Required: true,
	},
	{
		Height:  480,
		DefRate: 2500,
	},
	{
		Height:  720,
		DefRate: 5000,
	},
	{
		Height:  1080,
		DefRate: 8000,
	},
}

https://support.google.com/youtube/answer/1722171?hl=en#zippy=%2Cbitrate

Functions

func DistributeByHash

func DistributeByHash(dirs []string, hash string) (string, error)

func GetDir

func GetDir(location string, hash string) (string, error)

func NewBufferedResponseWrtier

func NewBufferedResponseWrtier(w http.ResponseWriter) *bufferedResponseWriter

func RegisterCommonFlags

func RegisterCommonFlags(f []cli.Flag) []cli.Flag

func RegisterContentProberFlags

func RegisterContentProberFlags(f []cli.Flag) []cli.Flag

func RegisterHLSFlags

func RegisterHLSFlags(f []cli.Flag) []cli.Flag

func RegisterWebFlags

func RegisterWebFlags(f []cli.Flag) []cli.Flag

Types

type ContentProbe

type ContentProbe struct {
	lazymap.LazyMap[*cp.ProbeReply]
	// contains filtered or unexported fields
}

func NewContentProbe

func NewContentProbe(c *cli.Context) *ContentProbe

func (*ContentProbe) Get

func (s *ContentProbe) Get(input string, out string) (*cp.ProbeReply, error)

type HLS

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

func NewHLS

func NewHLS(in string, probe *cp.ProbeReply, cfg *HLSConfig) *HLS

func (*HLS) GetFFmpegParams

func (h *HLS) GetFFmpegParams(out string) ([]string, error)

func (*HLS) MakeMasterPlaylist

func (s *HLS) MakeMasterPlaylist(out string) error

type HLSBuilder

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

func NewHLSBuilder

func NewHLSBuilder(c *cli.Context) *HLSBuilder

func (*HLSBuilder) Build

func (s *HLSBuilder) Build(in string, probe *cp.ProbeReply) *HLS

type HLSConfig

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

type HLSStream

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

func NewHLSStream

func NewHLSStream(index int, st StreamType, s *cp.Stream, r *Rendition, cfg *HLSConfig, force bool) *HLSStream

func (*HLSStream) GetCodecParams

func (h *HLSStream) GetCodecParams() []string

func (*HLSStream) GetFFmpegParams

func (h *HLSStream) GetFFmpegParams(out string) []string

func (*HLSStream) GetLanguage

func (h *HLSStream) GetLanguage() string

func (*HLSStream) GetName

func (h *HLSStream) GetName() string

func (*HLSStream) GetPlaylistName

func (h *HLSStream) GetPlaylistName() string

func (*HLSStream) GetPlaylistPath

func (h *HLSStream) GetPlaylistPath(out string) string

func (*HLSStream) GetSegmentExtension

func (h *HLSStream) GetSegmentExtension() string

func (*HLSStream) GetSegmentFormat

func (h *HLSStream) GetSegmentFormat() string

func (*HLSStream) MakeMasterPlaylist

func (h *HLSStream) MakeMasterPlaylist() string

type PlayerData

type PlayerData struct {
	SourceURL string
}

type Rendition

type Rendition struct {
	Height   uint
	DefRate  uint
	Required bool
}

func (*Rendition) Rate

func (s *Rendition) Rate() uint

type StreamMode

type StreamMode int
const (
	Online       StreamMode = 0
	MultiBitrate StreamMode = 1
)

type StreamType

type StreamType string
const (
	Audio    StreamType = "a"
	Video    StreamType = "v"
	Subtitle StreamType = "s"
)

type TouchMap

type TouchMap struct {
	lazymap.LazyMap[bool]
}

func NewTouchMap

func NewTouchMap() *TouchMap

func (*TouchMap) Touch

func (s *TouchMap) Touch(path string) (bool, error)

type TranscodePool

type TranscodePool struct {
	lazymap.LazyMap[bool]
}

func NewTranscodePool

func NewTranscodePool() *TranscodePool

func (*TranscodePool) IsDone

func (s *TranscodePool) IsDone(out string) bool

func (*TranscodePool) IsTranscoding

func (s *TranscodePool) IsTranscoding(out string) bool

func (*TranscodePool) Transcode

func (s *TranscodePool) Transcode(out string, h *HLS) error

type Transcoder

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

func NewTranscoder

func NewTranscoder(out string, h *HLS) *Transcoder

func (*Transcoder) Run

func (s *Transcoder) Run() (err error)

func (*Transcoder) Stop

func (s *Transcoder) Stop() error

type Web

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

func NewWeb

func NewWeb(c *cli.Context, contentProbe *ContentProbe, hlsBuilder *HLSBuilder, transcodePool *TranscodePool, touchMap *TouchMap) *Web

func (*Web) Close

func (s *Web) Close()

func (*Web) Serve

func (s *Web) Serve() error

Jump to

Keyboard shortcuts

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