libplacebo is, in a nutshell, the core rendering algorithms and ideas of mpv rewritten as an independent library. As of today, libplacebo contains a large assortment of video processing shaders, focusing on both quality and performance. These include features such as the following:
Every attempt was made to provide these features at a high level of abstraction, taking away all the messy details of GPU programming, color spaces, obscure subsampling modes, image metadata manipulation, and so on. Expert-level functionality is packed into easy-to-use functions like pl_frame_from_avframe and pl_render_image.
libplacebo currently supports Vulkan (including MoltenVK), OpenGL, and Direct3D 11. It currently has the following minimum hardware requirements:
For more documentation, including an introduction to the API, see the project website.
This project grew out of an interest to accomplish the following goals:
libmpv.It has since been adopted by VLC as their optional Vulkan-based video output path, and is provided as a Vulkan-based video filter in the FFmpeg project.
These screenshots from the included plplay demo program highlight just some of the features supported by the libplacebo rendering code, all of which are adjustable dynamically during video playback.
When cloning libplacebo, make sure to provide the --recursive flag:
git clone --recursive https://code.videolan.org/videolan/libplacebo
Alternatively (on an existing clone):
git submodule update --init
Doing either of these pulls in a handful of bundled 3rdparty dependencies. Alternatively, they can be provided via the system.
libplacebo is built using the meson build system. You can build the project using the following steps:
DIR=./build
meson $DIR
ninja -C$DIR
To rebuild the project on changes, re-run ninja -Cbuild. If you wish to install the build products to the configured prefix (typically /usr/local/), you can run ninja -Cbuild install. Note that this is normally ill-advised except for developers who know what they’re doing. Regular users should rely on distro packages.
In principle, libplacebo has no mandatory dependencies — only optional ones. However, to get a useful version of libplacebo, you most likely want to build with support for either opengl, vulkan or d3d11. libplacebo built without these can still be used (e.g. to generate GLSL shaders such as the ones used in VLC), but the usefulness is severely impacted since most components will be missing, impaired or otherwise not functional.
A full list of optional dependencies each feature requires:
glslang + its related libraries (e.g. libSPIRV.so)liblcms2libdoviglad2 (*)libshaderclibvulkan, python3-jinja2 (*)libxxhash(*) This dependency is bundled automatically when doing a recursive clone.
libplacebo was founded and primarily developed by Niklas Haas (@haasn), but it would not be possible without the contributions of others, especially support for windows.
libplacebo is currently available under the terms of the LGPLv2.1 (or later) license. However, it’s possible to release it under a more permissive license (e.g. BSD2) if a use case emerges. Please open an issue if you have a use case for a BSD2-licensed libplacebo.