Skip to content

VVenC

vvencapp spamming the terminal output with progress per-picture-order-count cause god knows why

VVenC is an open source command line application for encoding H.266/VVC written in C++ and developed by Fraunhofer Heinrich-Hertz-Institute (HHI).

Installation

Arch Linux users may check the AUR for the vvenc and vvenc-git packages.

Compilation from source as shown belowe requires CMake.

Terminal window
git clone https://github.com/fraunhoferhhi/vvenc.git
cd vvenc
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
cmake --build .

Binaries will be available in bin/release-static/

FFmpeg Integration

Although not officially supported, you can compile your own FFmpeg binary with libvvenc and libvvdec. A comprehensive tutorial can be found in the official VVenC wiki (archive).

The official guide is rather verbose, as FFmpeg (at the time of writing, 19 Feb 2024) does not support vvenc/vvdec officially. Below is an easy build script which uses an FFmpeg fork called FFmpeg-VVC. It is maintained by Marten Martin Eesmaa, who also maintains the VVCEasy GitHub repo featuring guides and more general information about working with VVC.

Please be aware the script below produces a build of FFmpeg licensed under LGPL version 2.1 or later. It is legal to distribute the resulting binary, given you do not interfere with the flags provided below.

Build FFmpeg with libvvdec, libvvenc, and fdk-aac
brew install libxml2 ffmpeg nasm # macOS-only; if on Linux, use your native package manager. Package names may differ.
git clone https://github.com/fraunhoferhhi/vvenc
git clone https://github.com/fraunhoferhhi/vvdec
git clone https://github.com/mstorsjo/fdk-aac
cd vvenc && mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local ..
sudo cmake --build . --target install -j $nproc
cd ../../
cd vvdec && mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local ..
sudo cmake --build . --target install -j $nproc
cd ../../
cd fdk-aac && ./autogen.sh && ./configure
make -j
sudo make install
cd ../
git clone --depth=1 https://github.com/MartinEesmaa/FFmpeg-VVC
cd FFmpeg-VVC
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
./configure --enable-libfdk-aac --enable-libvvenc --enable-libvvdec --enable-static --enable-pic --enable-libxml2 --pkg-config-flags="--static" --enable-sdl2
make -j

Binaries will be available in the final directory you end up in after the build process is complete.

Usage

There are two encoders, the simple encoder (vvencapp) and the full-featured expert mode encoder (vvencFFapp) which is based on the VTM configuration scheme. VVenC used to only accept YUV files input until support was added for Y4M.

YUV does not carry any of the original video’s metadata, which means you’ll have to manually input all the necessary parameters such as frame rates, resolution, bit depth, etc. Y4M takes care all of this automatically.

Here are some examples:

Standard VVenC input
vvencapp -i input.y4m --qp 20 -o output.266
Preset slow + qpa (already default) + YUV420P10
vvencapp -i input.y4m --preset slow --qpa on --qp 20 -c yuv420_10 -o output.266
Piping with FFmpeg
ffmpeg -hide_banner -loglevel error -i input.mkv -pix_fmt yuv420p10le -strict -1 -f yuv4mpegpipe - | vvencapp -i - --y4m --preset medium --qpa on --qp 20 -c yuv420_10 -o output.266

:::warning Limitations VVenC currently does not support input resolutions below 540p. In addition, VVenC usually produces bitstreams that don’t decode correctly when using FFmpeg’s recently implemented native ffvvc decoder (this is true as of the time of writing on 19 Feb 2024). For proper decoding, build FFmpeg with libvvdec. ::: :::info QPA VVenC by default operates with QP (Quantization Parameter), which is basically fixed quality. For “CRF-like” rate control, QPA is enabled by default QPA (provided by —qpa) enables perceptually motivated QP adaptation based on XPSNR. QPA modifies the QP value on the fly spatially and temporally as well as enabling temporal RDO. :::

Muxing

Since VVenC only outputs raw .266 bitstream files, you can’t just shove audio and subtitle streams in there. Instead you can remux them using GPAC MP4Box nightly/beta/git.

You can find all pre-built binaries for Windows, MacOS, and Ubuntu (Linux) right here, Arch Linux users can find mp4box/GPAC in the AUR, and those who aren’t listed here can find the build instructions here. It is recommended to do a minimal build since most of the time you don’t really need the extra stuff.

VVdeC

VVdeC is the software decoding implementation for decoding/playing VVC files developed by Fraunhofer HHI. All features of the VVC Main10 features are supported. Currently (as of 19 Feb 2024), VVdeC is both more feature rich and much faster than FFmpeg’s ffvvc decoder, though it is nearly infeasible for any VVC decoder implementation to be faster/more efficient than the highly optimized dav1d AV1 decoder.

Installation

Arch Linux users may check the AUR for the vvdec and vvdec-git packages.

Compilation from source as shown belowe requires CMake.

Terminal window
git clone https://github.com/fraunhoferhhi/vvdec.git
cd vvdec
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
cmake --build .

Binaries will be available in bin/release-static/

For FFmpeg integration, see the installation section for VVenC earlier in this entry.

Decoding

There are several ways to decode VVC. Some are made simple by the VVCEasy project by Martin Eesmaa. If you have a newer version of FFmpeg since ffvvc was implemented, or you’ve built FFmpeg with libvvdec as shown above, it is as simple as running ffplay assuming the right FFplay binary is in your PATH:

FFplay VVC video
ffplay input.mp4

Extending this to MPV, if you’ve built MPV from source using a VVC MPV build script (1) (2), it is also a one-command solution assuming the right MPV binary is in your PATH:

VVC video playing through MPV
mpv input.mp4

The more manual process to play back VVC video is to pipe into several programs; MP4Box beta/nightly/git, VVdeC, and a video player of choice summonable via CLI (MPV, VLC, ffplay) are required.

MP4Box -> VVdeC --> FFmpeg (without libvvdec support)
mp4box input.mp4 -raw vvc1:output=temp.266 && vvdecapp -v 0 -b temp.266 -o - | ffmpeg -video_size 1920x804 -framerate 24 -pixel_format yuv420p10le -f rawvideo -i - -i input.mp4 -c copy -map 0:v -map 1:a -f nut - | mpv -

Adjust the double input.mp4, -video_size for resolution, -framerate, -pixel_format, and mpv (Video player) accordingly, if not then your video will just play garbled glitches.

:::info Temp File You might see a new file appearing called temp.266 upon running the command. This is completely normal as mp4box needs to output the raw bitstream so vvdec will be able to decode it properly. :::