encode

package
v0.3.5 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2026 License: GPL-3.0 Imports: 20 Imported by: 0

Documentation

Overview

Package encode writes content-addressed On Air master clips off request paths.

Index

Constants

View Source
const Profile = "1080p30-h264-high-l4.0-yuv420p-g120-aac48k-stereo-v1"

Variables

This section is empty.

Functions

func Encode

func Encode(ctx context.Context, ffmpegPath string, frames func(int) *image.RGBA, n, fps int, audio, out string) error

Encode uses half the available processors for frames. Audio is an optional path.

func Hash

func Hash(rendererVersion string, doc, tokens, bindings, assetDigests, profile any) string

Hash uses encoding/json's stable map ordering, with length-delimited inputs.

func MixFilter

func MixFilter(base string, sounds []SoundInput, firstInput int, duration float64) string

MixFilter builds a bounded, timestamp-reset mix alongside the generated bed. Sound input indexes begin at firstInput; base names the existing audio stream.

func PCM

func PCM(a scene.Audio, seconds int) ([]int16, error)

PCM returns deterministic stereo 48 kHz signed PCM. Static masters use the same band-limited hiss as the live Signal engine; tone and bed remain periodic.

func WithOptions

func WithOptions(ctx context.Context, ffmpegPath string, frames func(int) *image.RGBA, n, fps int, audio, out string, opts Options) error

func WithWorkers

func WithWorkers(ctx context.Context, ffmpegPath string, frames func(int) *image.RGBA, n, fps int, audio, out string, workers int) error

WithWorkers is also used by the reproducible four-worker Phase 0 measurement.

func WriteWAV

func WriteWAV(w io.Writer, a scene.Audio, seconds int) error

Types

type Options

type Options struct {
	Workers, Width, Height int
	Sounds                 []SoundInput
	Background             *VideoInput
	// MaxSeconds is 28 for look moments; plugin segments may opt into 600.
	MaxSeconds          int
	MaxRate, BufferSize string
	Audio               *scene.Audio
	AudioVolume         *float64
}

Options allows Signal loops to honor a negotiated session ceiling and size.

type SoundInput

type SoundInput struct {
	Path                    string
	At, Start               float64
	End                     *float64
	Volume, FadeIn, FadeOut float64
}

SoundInput is a prepared asset path plus its authored timeline envelope.

type VideoInput

type VideoInput struct {
	Path, Fit string
	Start     float64
}

Jump to

Keyboard shortcuts

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