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 a base for encoding to the VVC codec.
x265 is generally regarded as having better performance while producing better quality video streams.
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:
| Format | Chroma Subsampling | Supported Bit Depth(s) |
|---|---|---|
| YUV420P | 4:2:0 | 8-bit |
| YUV420P10LE | 4:2:0 | 10-bit* |
*10-bit support requires a flag to be set during compilation with CMake.
Installationâ
- Linux & macOS
- Windows
For Arch Linux, Kvazaar is available as kvazaar. It is also available in the Arch User Repository (AUR) as kvazaar-git.
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. Here are the instructions to do so:
Autotoolsâ
-
Compilation requires GNU Automake, Autoconf, Libtool, and M4. Install them via your package manager.
-
Clone the repository and its submodules:
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 runmake installon Linux to install (May need elevated permissions).
CMake (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" # optional 10-bit flag
make -j$(nproc)
Be aware that encoding 10-bit HEVC with Kvazaar is significantly slower, as the developers only prioritized SIMD optimizations for 8-bit encoding. Be aware that this implementation can be buggy in general.
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.
MSYS2â
-
Make sure you have downloaded & installed MSYS2 from the MSYS2 website before beginning the build process.
-
Start the UCRT64 console & install the required dependencies with the
pacmanpackage manager -
Resume the build process as you would on a Unix-like system. See the "Linux & macOS" tab for more information.
Usageâ
Here are some examples of how to use Kvazaar on its own:
kvazaar -i input.y4m --input-file-format y4m --qp 20 -o output.265
kvazaar -i input.y4m --input-file-format y4m --qp 20 --preset slow -o output.265
The command below still uses the kvazaar binary, but reads from a YUV4MPEG pipe instead of a file. This is useful for piping FFmpeg output to Kvazaar.
ffmpeg -v error -i input.mkv -f yuv4mpegpipe -strict -1 - | kvazaar -i - --input-file-format y4m --qp 20 --preset slow -o output.265