Skip to main content

EncoderSettingsX264

Electron APIs / Recorder / EncoderSettingsX264

Configuration options for the x264 software video encoder.

Allows customization of encoding behavior including rate control, quality presets, profiles, and advanced tuning.

See

VideoEncoderSettingsBase

Extends

Properties

PropertyTypeDescription
bitrate?numberTarget encoding bitrate in kilobits per second (kbps). Default 8000
buffer_size?numberCustom buffer size (in kbps) to be used when use_bufsize is true.
keyint_sec?numberKeyframe interval, in seconds. Defines how frequently a keyframe (I-frame) is inserted into the video stream. - 0 — Automatically selected by the encoder. - Recommended values: 2 for high quality/editability, 4 for reduced file size. - 1 — Suitable for short replays or splitting, but more CPU/GPU intensive. Balances quality, file size, and streaming performance.
max_bitrate?numberMaximum bitrate in kilobits per second (kbps). Caps the bitrate for encoders using variable bitrate modes (e.g., VBR).
preset?kX264EncoderPresetSpecifies the encoding speed/quality trade-off preset. A slower preset provides better compression (quality per bitrate). Default 'veryfast' See kX264EncoderPreset
profile?kX264EncoderProfileSets the H.264 encoding profile. Default '' (no profile). See kX264EncoderProfile
rate_control?kX264EncoderRateControlSpecifies the rate control method for x264. Common options include 'CBR', 'VBR', 'CRF', and 'ABR'. Default rate_control. See kX264EncoderRateControl
tune?kX264EncoderTuneSpecifies a tuning parameter to optimize the encoder for a specific type of content. Default '' (no tuning). See kX264EncoderTune
typekSupportedEncodersTypesThe selected video encoder type. See kSupportedEncodersTypes
use_bufsize?booleanWhether to use a custom buffer size. Default false
x264opts?stringAdditional x264 encoder options, provided as a space-separated string. Example ``"ref=4 bframes=2 me=umh subme=9".