# Kvazaar

Canonical URL: https://encode.wiki/tools/software-encoders/kvazaar/
Content version: ca42e61ede0a24f789d7287a0001244ad22f4abf
Status: current
License: CC BY-SA 4.0
Checksum (SHA-256): 0f9e040c84d235a5d2d19dd239428f0f0382b345c64d649f79f0e968ad3e16cc

> **Repository:** [ultravideo/kvazaar](https://github.com/ultravideo/kvazaar). An open-source HEVC encoder. Latest release: [v2.3.2](https://github.com/ultravideo/kvazaar/releases/tag/v2.3.2), Sep 17, 2025. Last commit: Sep 30, 2026. License: BSD-3-Clause. Stars: 966.

Kvazaar is an open-source [H.265 / HEVC](/codecs/video/hevc/) encoder written in C by the [Ultra Video Group](https://ultravideo.fi/kvazaar.html) at Tampere University, Finland. It is an academic project, licensed under the 3-clause BSD licence, and is still maintained: the latest release is v2.3.2 (September 2025), with ongoing commits on master. The same group's VVC encoder, [uvg266](/tools/software-encoders/uvg266/), is based on Kvazaar.

For quality-focused HEVC encoding most people use [x265](/tools/software-encoders/x265/), which has a more mature rate control and psychovisual tuning. Kvazaar is mainly of interest for research, for its fast presets and low-delay GOP structures, and when a permissive licence matters (x265 is GPL).

## Get Kvazaar

Arch Linux packages it as `kvazaar`; other platforms usually build from source with CMake or Autotools as described in the [README](https://github.com/ultravideo/kvazaar/blob/v2.3.2/README.md#compiling-kvazaar). On MinGW/MSYS2, build with Clang (`CC=clang ./configure`): with GCC the AVX2 optimizations are disabled because of a long-standing GCC issue, and performance suffers badly.

The sample bit depth is fixed at compile time and defaults to 8. For 10-bit, build with `-DKVZ_BIT_DEPTH=10`:

```sh
cmake -S kvazaar -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_FLAGS="-DKVZ_BIT_DEPTH=10"
cmake --build build
```

FFmpeg's `libkvazaar` wrapper accepts only 8-bit `yuv420p`, and many FFmpeg builds do not include it. Extra options go through `-kvazaar-params` as a comma-separated `key=value` list.

## Encode with Kvazaar

```sh
kvazaar -i input.y4m --preset slow --qp 24 -o output.hevc
ffmpeg -i input.mkv -f yuv4mpegpipe - | kvazaar -i - --input-file-format y4m --preset slow --qp 24 -o output.hevc
```

Kvazaar detects Y4M from the file extension; for a pipe, give `--input-file-format y4m`, or `--input-res` and `--input-fps` for raw YUV. It does not take the bit depth from the Y4M header, so a 10-bit build needs `--input-bitdepth 10` for 10-bit input. The output is a raw HEVC stream to mux afterwards.

| Option | Default | Notes |
| --- | --- | --- |
| `--preset` | `medium` | `ultrafast` to `placebo`, same names as x264/x265. The README lists what each preset sets. |
| `--qp` | `22` | Base QP. There is no CRF mode; B-frames in the GOP pyramid get higher QPs automatically. |
| `--bitrate` | `0` (off) | Target bitrate in **bits** per second, not kbit/s. Uses lambda-domain rate control by default. |
| `--vaq` | Off | Variance-based adaptive quantization, strength 1–20; upstream recommends 5. |
| `--gop` | `16` (8 at `fast` and faster) | GOP structure: 8 or 16 for a B-frame pyramid, `0` to disable, or `lp-…` for low-delay P/B GOPs. |
| `--period` | `64` | Intra period in frames (0 = only the first frame). |
| `--open-gop` | On | Use `--no-open-gop` for streams that will be cut at keyframes. |
| `--threads` / `--owf` | auto | Worker threads and number of frames encoded in parallel. |

## Related pages

- [H.265 / HEVC](/codecs/video/hevc/)
- [x265](/tools/software-encoders/x265/)
- [uvg266](/tools/software-encoders/uvg266/)
- [FFmpeg](/tools/utilities/ffmpeg/)
