VideoEncoderTuning

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.

Rate control is one sealed choice, so CRF plus CBR is unrepresentable by construction.

Knobs belong to encoders, not to encoding

preset, tune and crf are x264-family options. FFmpeg does not have a generic version of any of them, so asking h264_videotoolbox for preset=slow sets nothing: the option is dropped at open, the encode runs at the hardware encoder's own defaults, and the only trace is an entry in the sink's unused-option report that nobody reads. This class used to emit them for every codec. It refuses them now for an encoder that does not have them, which is the same rule the collision check below has always applied: a caller who asked for two things gets told, rather than getting one of them silently.

That refusal has teeth in this project specifically. The recipes build LGPL FFmpeg with no external encoders at all, so libx264 is not in any shipped artifact; the video encoders that exist are mpeg4, mjpeg, png and the platform hardware ones, and NONE of them has a preset or a CRF. A preset in this library was, until now, always a no-op.

Constructors

Link copied to clipboard
constructor(preset: EncoderPreset? = null, profile: String? = null, tune: String? = null, rateControl: RateControl? = null)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val tune: String?

Functions

Link copied to clipboard

Returns spec with the compiled knobs merged in. Average and constant bitrate flow through the spec's own bitrateBps; constant quality zeroes it so the encoder rates by quality alone (FFmpeg reads a zero bit_rate as unset).

Link copied to clipboard

The av_opt_set pairs this tuning becomes for codec.