utilities

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

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

Go to latest
Published: Apr 17, 2024 License: BSD-2-Clause Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const NTSCRatio = float64(1001) / 1000

Variables

This section is empty.

Functions

func GetSettingString

func GetSettingString(m map[string]any, name string, fallback string) string

func Log2

func Log2[T constraints.Integer](v T) (result int)

func Max

func Max[T constraints.Ordered](v0 T, values ...T) (result T)

func Min

func Min[T constraints.Ordered](v0 T, values ...T) (result T)

Types

type Logger

type Logger interface {
	Panic(v ...any)
	Panicf(format string, v ...any)
	Print(v ...any)
	Printf(format string, v ...any)
	Fatal(v ...any)
	Fatalf(format string, v ...any)
}

func DefaultLogger

func DefaultLogger() Logger

type Ratio

type Ratio struct {
	Numerator   int
	Denominator int
}

func FPSToRatio

func FPSToRatio(fps float64) Ratio

FPSToRatio Attempt common FPS conversions to ratios

func NewRatio

func NewRatio(n, d int) Ratio

func (Ratio) Float64

func (r Ratio) Float64() float64

func (Ratio) MarshalJSON

func (r Ratio) MarshalJSON() ([]byte, error)

func (Ratio) PTSToDuration

func (r Ratio) PTSToDuration(pts int64) time.Duration

func (Ratio) Reciprocal

func (r Ratio) Reciprocal() Ratio

Reciprocal get the reciprocal, for example, to convert frame rate into time base

func (Ratio) String

func (r Ratio) String() string

func (*Ratio) UnmarshalJSON

func (r *Ratio) UnmarshalJSON(buf []byte) error

func (*Ratio) UnmarshalYAML

func (r *Ratio) UnmarshalYAML(node *yaml.Node) error

type Timecodes

type Timecodes []int64

Timecodes Entries in milliseconds. First entry includes fallback duration, in time.Duration format

func ParseTimecodesV1

func ParseTimecodesV1(reader io.Reader) (Timecodes, error)

func (Timecodes) FallbackDuration

func (tc Timecodes) FallbackDuration() time.Duration

func (Timecodes) PTS

func (tc Timecodes) PTS(n int) int64

Directories

Path Synopsis
Package ivfreader implements IVF media container reader
Package ivfreader implements IVF media container reader

Jump to

Keyboard shortcuts

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