Skip to main content

EncoderProperty

Electron APIs / recorder / EncoderProperty

Configurable property of an encoder.

Used to describe encoder settings such as bitrates, presets, or modes. Provides metadata to help display options in a UI or validate configuration.

Examples

// An enum-like setting - `values` lists every accepted value.
const rateControl: EncoderProperty = {
default: "CBR",
description: "Rate Control",
values: ["CBR", "CQP", "VBR", "CQVBR"],
valuesDesc: ["CBR", "CQP", "VBR", "CQVBR"],
};
// A numeric range setting - no `values`; the range is min/max/step.
const bitrate: EncoderProperty = {
default: 10000,
description: "Bitrate",
min: 50,
max: 4294967,
step: 50,
};

Properties

PropertyModifierTypeDescription
default?readonlyanyThe default value for this encoder property.
descriptionreadonlystringA human-readable explanation of the property's purpose.
max?readonlynumberThe largest value this setting accepts. Reported for numeric settings only.
min?readonlynumberThe smallest value this setting accepts. Reported for numeric settings only (bitrate, keyint_sec, cqp, ...); enum-like settings use values instead.
step?readonlynumberThe granularity between accepted values. Reported for numeric settings only. A bitrate with a step of 50 accepts 50, 100, 150 and so on.
values?readonly(string | number)[]The complete set of accepted values for this property, present only for enum-like settings (e.g. rate_control, preset, profile, tune). Useful for dropdowns or presets. Numeric range settings such as bitrate, max_bitrate or keyint_sec do not report values - they describe their range through min, max and step instead. An absent or single-entry values array therefore does not mean the setting is restricted to one option.
valuesDesc?readonlystring[]Optional array of descriptions corresponding to the values array. Helps provide additional context for each option.