transcode

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Transcode

func Transcode(ctx context.Context, cfg app.TranscodeConfig, sourceURL *url.URL, headers map[string]string) (io.ReadCloser, func() error, error)

Transcode starts an ffmpeg process that reads from sourceURL and writes transcoded output to a pipe. Returns the readable end, a wait function for the process, and any startup error.

Types

type StreamServer

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

StreamServer serves an io.Reader over HTTP. The consumer's read pace drives the producer through OS pipe backpressure.

func NewStreamServer

func NewStreamServer(cfg StreamServerConfig, reader io.Reader) (*StreamServer, error)

func (*StreamServer) Close added in v0.1.0

func (s *StreamServer) Close() error

Close shuts down the server.

func (*StreamServer) URL

func (s *StreamServer) URL() *url.URL

URL returns the full URL the server is listening on.

func (*StreamServer) Wait added in v0.0.2

func (s *StreamServer) Wait(ctx context.Context) error

Wait blocks until the server exits or the context is cancelled.

type StreamServerConfig

type StreamServerConfig struct {
	LocalIP     string
	ContentType string
	Extension   string
	Headers     map[string]string
}

StreamServerConfig holds the parameters for NewStreamServer.

Jump to

Keyboard shortcuts

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