uvg266
uvg266 is an open-source software encoder for encoding to the H.266 / VVC codec. Developed by the Ultra Video Group, written in C and licensed under BSD 3-clause. The encoder is based on Kvazaar, their open source HEVC encoder solution.
Installationâ
Arch Linuxâ
uvg266 is available in the Arch User Repository (AUR) as uvg266 and uvg266-git.
Compilingâ
Ultra Video Group does not ship any pre-built binaries of their encoders so you'll have to compile them yourself.
Windows users are recommended to compile via MinGW-W64 which comes with MSYS2.
Compilation requires GNU Make and CMake
The following build procedure should work across all common operating systems. Using Clang instead of GCC works.
You may add -DCMAKE_CXX_FLAGS="-flto -O3 -march=native" -DCMAKE_C_FLAGS="-flto -O3 -march=native -pipe -fno-plt" -DCMAKE_C_FLAGS_INIT="-flto=8 -static" in CMake for better performance.
git clone https://github.com/ultravideo/uvg266.git
cd uvg266/build
cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=0
make -j 8
Binaries will be available in the same folder (build), or you can run make install on Linux to install (May need elevated permissions).
10-bit Supportâ
uvg266 defaults to an 8-bit build; 10-bit support is a CMake build option (not a compiler flag; passing -DUVG_BIT_DEPTH=10 via -DCMAKE_C_FLAGS is silently ignored):
cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=0 -DUVG_BIT_DEPTH=10
make -j$(nproc)
A 10-bit build detects 10-bit Y4M input automatically. An 8-bit build rejects 10-bit input with the unhelpful message usage: -i and --input-res to set input, -o to set output.
Encoding 10-bit with uvg266 is significantly slower as the developers only prioritized SIMD optimizations for 8-bit, and can get really buggy.
Usageâ
uvg266 -i input.y4m --input-file-format y4m --qp 20 -o output.266
uvg266 -i input.y4m --input-file-format y4m --qp 20 --preset slow -o output.266
ffmpeg -v error -i input.mkv -f yuv4mpegpipe -strict -1 - | uvg266 -i - --input-file-format y4m --qp 20 --preset slow -o output.266
Parameters worth knowingâ
Being a Kvazaar descendant, uvg266 shares its command line: eleven --presets from ultrafast to placebo (medium default), fixed -q QP (default 22) or single-pass --bitrate rate control, -p/--period for the intra period (no scene change detection), --lossless, --vaq, & automatic threading via --threads auto with WPP enabled by default. The notable difference from Kvazaar is the default GOP: lp-g4d3t1, a low-delay structure. Use --gop 16 or --gop 8 for a random-access B-pyramid if latency doesn't matter, as it is more efficient.
The output is a raw VVC bitstream & muxes like any other: ffmpeg -f vvc -i output.266 -c copy output.mp4 (FFmpeg 7.0+).
Troubleshootingâ
Could not find a strategy for crc32c_8x8!- You're out of luck, uvg266 failed to initialize its block partitioning strategy for your specific CPU instruction set, so you can't use the encoder or encode that specific video.