transcoder

package
v0.0.0-...-6a02954 Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BLANK = ""

	ENCODER_COPY  = "copy"
	ENCODER_X264  = "libx264"
	ENCODER_VAAPI = "h264_vaapi"
	ENCODER_NVENC = "h264_nvenc"

	QUALITY_MAX = "max"
	CODEC_H264  = "h264"
)

Variables

This section is empty.

Functions

func GetQueryString

func GetQueryString(r *http.Request) string

func WriteM3U8ContentType

func WriteM3U8ContentType(w http.ResponseWriter)

Types

type Chunk

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

func NewChunk

func NewChunk(id int) *Chunk

type Config

type Config struct {
	// Current version of go-vod
	Version string

	// Is this server configured?
	Configured bool

	// Restart the server if incorrect version detected
	VersionMonitor bool

	// Bind address
	Bind string `json:"bind"`

	// FFmpeg binary
	FFmpeg string `json:"ffmpeg"`
	// FFprobe binary
	FFprobe string `json:"ffprobe"`
	// Temp files directory
	TempDir string `json:"tempdir"`

	// Size of each chunk in seconds
	ChunkSize int `json:"chunkSize"`
	// How many *chunks* to look behind before restarting transcoding
	LookBehind int `json:"lookBehind"`
	// Number of chunks in goal to restart encoding
	GoalBufferMin int `json:"goalBufferMin"`
	// Number of chunks in goal to stop encoding
	GoalBufferMax int `json:"goalBufferMax"`

	// Number of seconds to wait before shutting down encoding
	StreamIdleTime int `json:"streamIdleTime"`
	// Number of seconds to wait before shutting down a client
	ManagerIdleTime int `json:"managerIdleTime"`

	// Quality Factor (e.g. CRF / global_quality)
	QF int `json:"qf"`

	// VA-API
	VAAPI         bool `json:"vaapi"`
	VAAPILowPower bool `json:"vaapiLowPower"`

	// NVENC
	NVENC           bool   `json:"nvenc"`
	NVENCTemporalAQ bool   `json:"nvencTemporalAQ"`
	NVENCScale      string `json:"nvencScale"` // cuda, npp

	// Use transpose workaround for streaming (VA-API)
	UseTranspose bool `json:"useTranspose"`
	// Force tranpose in software
	ForceSwTranspose bool `json:"forceSwTranspose"`

	// Use GOP size workaround for streaming (NVENC)
	UseGopSize bool `json:"useGopSize"`
}

func (*Config) AutoDetect

func (c *Config) AutoDetect()

func (*Config) FromFile

func (c *Config) FromFile(path string)

func (*Config) Print

func (c *Config) Print()

type Handler

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

func NewHandler

func NewHandler(c *Config) *Handler

func (*Handler) Close

func (h *Handler) Close()

func (*Handler) ServeHTTP

func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*Handler) Start

func (h *Handler) Start() int

type Manager

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

func NewManager

func NewManager(c *Config, path string, id string, close chan string) (*Manager, error)

func (*Manager) Destroy

func (m *Manager) Destroy()

Destroys streams. DOES NOT emit on the close channel.

func (*Manager) ServeHTTP

func (m *Manager) ServeHTTP(w http.ResponseWriter, r *http.Request, chunk string) error

func (*Manager) ServeIndex

func (m *Manager) ServeIndex(w http.ResponseWriter, r *http.Request) error

type ProbeVideoData

type ProbeVideoData struct {
	Width     int
	Height    int
	Duration  time.Duration
	FrameRate int
	CodecName string
	BitRate   int
	Rotation  int
}

type Stream

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

func (*Stream) Run

func (s *Stream) Run()

func (*Stream) ServeChunk

func (s *Stream) ServeChunk(w http.ResponseWriter, id int) error

func (*Stream) ServeFullVideo

func (s *Stream) ServeFullVideo(w http.ResponseWriter, r *http.Request) error

func (*Stream) ServeList

func (s *Stream) ServeList(w http.ResponseWriter, r *http.Request) error

func (*Stream) Stop

func (s *Stream) Stop()

Jump to

Keyboard shortcuts

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