Skip to main content

Kvazaar

Kvazaar is an open-source H.265 / HEVC software encoder Written in C, developed by Ultra Video Group and licensed under BSD 3-clause.

uvg266 (Developed by the same group) uses Kvazaar as base for encoding to the VVC codec.

info

It is recommended to use x265 instead as it performs much better in both quality and speed.

FFmpeg​

Kvazaar is available in FFmpeg via libkvazaar, to check if you have it, run ffmpeg -h encoder=libkvazaar. You can input non-FFmpeg standard Kvazaar parameters via -kvazaar-params.

You may need to download "Full" builds. As most of the time, this encoder is not included.

Supported Color Space​

Kvazaar supports the following color spaces:

FormatChroma SubsamplingSupported Bit Depth(s)
YUV420P4:2:08-bit
YUV420P10LE4:2:010-bit

Installation​

Arch Linux​

Kvazaar is available on both pacman (kvazaar) and the Arch User Repository (AUR) as kvazaar-git.

Compiling​

Ultra Video Group does not ship any pre-built binaries of their encoders except for their AppVeyor CI, but AppVeyor deletes build artifacts after a month, so most of the time you'll have to compile Kvazaar yourself.

Windows users are recommended to compile via MinGW-W64 which comes with MSYS2. Please be advised the usage of Clang for compiling in this situation is heavily recommended due to disabled AVX2 optimizations because of a known GCC issue from 2012 (MinGW environments-exclusive). To do this, run CC=clang ./configure during autoconf.

caution

Compilation requires GNU Automake, Autoconf, Libtool, and M4.

git clone --recursive https://github.com/ultravideo/kvazaar.git
cd kvazaar
./autogen.sh
./configure
make -j$(nproc)

Binaries will be available in src, or you can run make install on Linux to install (May need elevated permissions).

Using CMake for 10-bit support​

You will need to use CMake to specify a flag to be able to encode 10-bit with the encoder, by default Kvazaar ships with only 8-bit.

git clone --recursive https://github.com/ultravideo/kvazaar.git
cd kvazaar/build
cmake .. -DCMAKE_C_FLAGS="-DKVZ_BIT_DEPTH=10"
make -j$(nproc)
warning

Encoding 10-bit with Kvazaar is significantly slower as the developers only prioritized SIMD optimizations for 8-bit, and can get quite buggy.

Usage​

Simple Y4M input with QP 20 and raw 265 bitstream output
kvazaar -i input.y4m --input-file-format y4m --qp 20 -o output.265
Preset slow, CRF 20, Y4M input
kvazaar -i input.y4m --input-file-format y4m --qp 20 --preset slow -o output.265
FFmpeg piping
ffmpeg -v error -i input.mkv -f yuv4mpegpipe -strict -1 - | kvazaar -i - --input-file-format y4m --qp 20 --preset slow -o output.265