Package-level declarations

Types

Link copied to clipboard
data class Aresample(val sampleRate: Int) : FilterStep
Link copied to clipboard
data class Atempo(val tempo: Double) : FilterStep
Link copied to clipboard
data class AudioEncoderTuning(val profile: String? = null, val bitrateBps: Long? = null)
Link copied to clipboard
Link copied to clipboard
data class AudioFormat(val sampleFormat: String? = null, val sampleRate: Int? = null, val channelLayout: String? = null) : FilterStep
Link copied to clipboard
data class Crop(val width: Int, val height: Int, val x: Int? = null, val y: Int? = null) : FilterStep
Link copied to clipboard
data class DecoderOptions(val skipLoopFilter: DecoderSkip? = null, val skipFrame: DecoderSkip? = null, val errorDetection: Set<ErrorDetection> = emptySet(), val threadType: DecoderThreadType? = null, val options: Map<String, String> = emptyMap())

Typed decoder options (KD-2), applied through the EXISTING av_opt_set funnel between codec-context creation and open. Control plane only (law 1): these configure an open, never a per-frame call. compile is the pure, golden-tested mapping to option pairs; a wrong key in options reproduces the funnel's measured EINVAL path rather than being filtered here.

Link copied to clipboard

avcodec's skip ladder, by its own option value names.

Link copied to clipboard
Link copied to clipboard
data class Deinterlace(val with: Deinterlacer = Deinterlacer.Bwdif) : FilterStep
Link copied to clipboard
Link copied to clipboard
data class DrawBox(val x: Int, val y: Int, val width: Int, val height: Int, val color: String = "red", val thickness: Int = 3) : FilterStep
Link copied to clipboard
Link copied to clipboard
data class Eq(val brightness: Double? = null, val contrast: Double? = null, val saturation: Double? = null, val gamma: Double? = null) : FilterStep

Neutral values compile away, so Eq(brightness = 0.1) sends exactly one knob.

Link copied to clipboard
Link copied to clipboard
data class FilterChain(val steps: List<FilterStep>)
Link copied to clipboard
sealed interface FilterStep

The typed filter DSL (KD-1): a compilation layer onto the description STRINGS the existing FilterGraph.buildVideo/buildAudio already take. Nothing here crosses into C; the laws that bind it:

Link copied to clipboard
data class Format(val format: PixelFormat) : FilterStep
Link copied to clipboard
data class Fps(val rate: Rational) : FilterStep
Link copied to clipboard
data class Loudnorm(val integrated: Double = -24.0, val truePeak: Double = -2.0, val range: Double = 7.0) : FilterStep

EBU R128 loudness normalisation with the filter's own defaults.

Link copied to clipboard
data class Pad(val width: Int, val height: Int, val x: Int = -1, val y: Int = -1, val color: String = "black") : FilterStep
Link copied to clipboard
data class Pan(val layout: String, val outputs: List<String>) : FilterStep

A downmix or routing matrix: Pan("stereo", "c0=FL+0.7*FC", "c1=FR+0.7*FC"). The channel expressions are FFmpeg's own pan syntax, escaped as one value because pan's separator is the pipe, which the chain separator must not see.

Link copied to clipboard
Link copied to clipboard
sealed interface RateControl
Link copied to clipboard
data class Raw(val fragment: String) : FilterStep

The escape hatch (law 2): any chain fragment the typed set lacks, joined verbatim. Capability checks cannot see inside it; the caller owns that claim.

Link copied to clipboard
data class Scale(val width: Int, val height: Int) : FilterStep
Link copied to clipboard
data class Transpose(val turn: QuarterTurn) : FilterStep
Link copied to clipboard
data class VideoEncoderTuning(val preset: EncoderPreset? = null, val profile: String? = null, val tune: String? = null, val rateControl: RateControl? = null)

The typed encoder layer: sugar compiling INTO the existing options maps of the encoder specs. Zero C, zero new funnel; applyTo returns a new spec whose options carry the typed knobs as the exact av_opt_set strings the wrappers already send.

Link copied to clipboard
Link copied to clipboard
data class Volume(val gain: Double) : FilterStep

Linear gain: 1.0 is unity, 0.5 is half amplitude.

Functions

Link copied to clipboard
Link copied to clipboard

The one escaping function every typed filter argument passes through (KD-1).

Link copied to clipboard