hlsq

package module
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2021 License: MIT Imports: 17 Imported by: 0

README

hlsq

hlsq is a toolkit to record HLS streams. The main goal of this project is to record streams without loss of segments.

Commands

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FilterMediaPlaylistVariantFn

type FilterMediaPlaylistVariantFn func(va []*MediaPlaylist) []*MediaPlaylist

type MediaPlaylist

type MediaPlaylist struct {
	m3u8.Variant
}

type MediaSegment

type MediaSegment struct {
	m3u8.MediaSegment
	Sequence              uint64
	DiscontinuitySequence uint64
	Playlist              *url.URL
}

MediaSegment represents media segment in HLS stream

type MediaSegments

type MediaSegments []*MediaSegment

func (MediaSegments) Sort

func (mss MediaSegments) Sort() MediaSegments

Sort non-destructive sort

func (MediaSegments) String

func (mss MediaSegments) String(closed bool) string

type PlayHandler

type PlayHandler interface {
	// Receive called in goroutine. order isn't guaranteed, you must sort segments by sequence + discontinuity sequence to persist.
	Receive(ctx context.Context, m *MediaSegment) error
}

type PlaySession

type PlaySession interface {
	Close() error
	Wait() error
}

func Play

func Play(ctx context.Context, hc *http.Client, playlistURL *url.URL, fmpv FilterMediaPlaylistVariantFn, ph PlayHandler) (PlaySession, error)

Directories

Path Synopsis
cmd
examples

Jump to

Keyboard shortcuts

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