hls

package
v0.0.0-...-742043b Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateHLS

func GenerateHLS(ffmpegPath, srcPath, targetPath, resolution string) error

GenerateHLS will generate HLS file based on resolution presets. The available resolutions are: 360p, 480p, 720p and 1080p.

func GenerateHLSCustom

func GenerateHLSCustom(ffmpegPath string, options []string) error

GenerateHLSCustom will generate HLS using the flexible options params.s options is array of string that accepted by ffmpeg command

func GeneratePlaylist

func GeneratePlaylist(variants []*Variant, targetPath, filename string)

GeneratePlaylist will generate playlist file from the given variants. Variant itself can be generate from GenerateHLSVariant() function of suplied by the caller

Types

type Variant

type Variant struct {
	// URL indicate the location of the variant playlist.
	// If variant located on remote server, this url should
	// contain the full url
	URL string

	// Bandwidth is an integer that is the upper bound of
	// the overall bitrate for each media file, in bits per second
	Bandwidth string

	// Resolution is display size, in pixels, at which to display
	// all of the video in the playlist
	Resolution string

	// Codecs is quoted string containing a comma-separated list of formats,
	// where each format specifies a media sample type that's present
	// in a media segment in the playlist file. Valid format identifiers are
	// those in the ISO file format name space defined by RFC 6381
	Codecs string
}

Variant is HLS variant that gonna be use to generate HLS master playlist

func GenerateHLSVariant

func GenerateHLSVariant(resOptions []string, locPrefix string) ([]*Variant, error)

GenerateHLSVariant will generate variants info from the given resolutions. The available resolutions are: 360p, 480p, 720p and 1080p.

Jump to

Keyboard shortcuts

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