formats

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeHLS   = "hls"
	TypeDASH  = "dash"
	TypeRange = "range"

	FPS30 = 30
	FPS60 = 60
)

Variables

View Source
var (
	UHD4K  = Resolution{Height: 2160}
	QHD2K  = Resolution{Height: 1440}
	HD1080 = Resolution{Height: 1080}
	HD720  = Resolution{Height: 720}
	SD480  = Resolution{Height: 480}
	SD360  = Resolution{Height: 360}
	SD240  = Resolution{Height: 240}
)

Commonly defined resolutions

View Source
var H264 = Codec{
	Format{UHD4K, Bitrate{FPS30: 23000, FPS60: 35000}},
	Format{QHD2K, Bitrate{FPS30: 12000, FPS60: 18000}},
	Format{HD1080, Bitrate{FPS30: 2300, FPS60: 3500}},
	Format{HD720, Bitrate{FPS30: 1400, FPS60: 2200}},
	Format{SD480, Bitrate{FPS30: 1100, FPS60: 1700}},
	Format{SD360, Bitrate{FPS30: 525, FPS60: 800}},
}

H264 codec with its suggested bitrates

View Source
var Resolutions = []Resolution{
	UHD4K, QHD2K, HD1080, HD720, SD480, SD360, SD240,
}

Functions

func DetectFPS

func DetectFPS(meta *ffmpeg.Metadata) (int, error)

func SetLogger

func SetLogger(l *zap.SugaredLogger)

Types

type Bitrate

type Bitrate struct {
	FPS30, FPS60 int
}

Bitrate in kilobits

type Codec

type Codec []Format

func (Codec) Format

func (c Codec) Format(r Resolution) Format

type Format

type Format struct {
	Resolution Resolution
	Bitrate    Bitrate
}

func TargetFormats

func TargetFormats(codec Codec, meta *ffmpeg.Metadata) ([]Format, error)

func (Format) GetBitrateForFPS

func (f Format) GetBitrateForFPS(fps int) int

type Resolution

type Resolution struct {
	Width, Height int
}

Jump to

Keyboard shortcuts

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