Skip to main content

kX264EncoderTune

Electron APIs / recorder / kX264EncoderTune

type kX264EncoderTune =
| ""
| "film"
| "animation"
| "grain"
| "stillimage"
| "psnr"
| "ssim"
| "fastdecode"
| "zerolatency";

Specifies the tuning presets for the x264 encoder.

Tuning options help optimize the encoder's performance for specific types of content or use cases. These settings adjust internal compression behavior and rate-distortion tradeoffs.

ValueDescription
''Default. No tuning applied; encoder uses standard compression behavior.
'film'Optimizes for live-action, natural footage. Preserves fine grain and cinematic detail.
'animation'Optimizes for animated content. Enhances compression of solid colors and repetitive patterns.
'grain'Preserves film grain. Reduces temporal blurring at the cost of larger file sizes.
'stillimage'Optimizes for individual image compression. Suitable for slideshow or low-motion content.
'psnr'Optimizes for peak signal-to-noise ratio (PSNR). Prioritizes objective video quality metrics.
'ssim'Optimizes for structural similarity index (SSIM). Targets better perceptual quality over raw pixel accuracy.
'fastdecode'Reduces computational load on decoders. Disables features that are hard to decode quickly.
'zerolatency'Minimizes latency for real-time streaming. Reduces buffering and introduces faster frame delivery.

Example

const tune: kX264EncoderTune = "animation";