193.3. libva-2.24.1
VA-API — hardware video decode and encode
2.24.1-1 · MIT · 0.1 SBU · 961.3 KiB, 44 files · 42_graphics, 7 of 189 · ports/core/gpu/libva
Homepage: https://github.com/intel/libva
libva is the VA-API loader: the library a program calls to decode or encode video on the GPU. It opens a display (a DRM render node or a Wayland connection), loads the VA-API driver for the GPU behind it from /usr/lib/dri (iHD or i965 for Intel, Mesa’s Gallium driver for AMD, nouveau and virgl) and passes every call through. ffmpeg, mpv, GStreamer, Kodi, VLC, OBS Studio, Qt Multimedia, Qt WebEngine and Chromium reach the hardware decoders through it. Which driver serves which GPU, and how to see what a machine offers, is in Media, colour and time.
Depends on: meson, ninja, libdrm, wayland.
Required by (17): chromium, fastfetch, ffmpeg, gst-plugins-bad, intel-media-driver, kodi, kpipewire, libva-intel-driver, libva-utils, mesa, mpv, obs-studio, opencv, qt6-qtmultimedia, qt6-qtwebengine, thunderbird, vlc.
Sources: libva-2.24.1.tar.gz (299.1 KiB). Every step kpkg takes applies to this port.
Optional, off in KDOS. These switches in build.sh turn off a feature whose library is a port here. The recipe may turn each off on purpose, or because the library was not yet a port when the recipe was written; this list cannot tell which.
-Dwith_x11=no, line 15: libX11 (explained with the switches below)
Install: script/chroot/exec.sh bash -c 'source script/phases/42_graphics/phase.env && kpkg install libva'
build.sh:
meson setup build \
--prefix=/usr --libdir=lib \
--buildtype=release \
-Dwith_x11=no \
-Dwith_glx=no \
-Dwith_win32=no \
-Dwith_wayland=yes \
-Ddisable_drm=false \
-Denable_docs=false
meson compile -C build
DESTDIR=$PKG meson install --no-rebuild -C build
-Dwith_wayland=yes— Buildslibva-wayland, the Wayland display, and makes wayland a requirement rather than a probe.-Ddisable_drm=false— Buildslibva-drm, the display opened on a DRM render node with no window system at all. This is upstream’s default, named here. The option is a boolean,disable_drm, where the others arewith_*choices, and meson refuses an option name it does not know.-Dwith_x11=no— Builds nolibva-x11, the X11 display. Every consumer here reaches VA-API through a DRM render node or a Wayland display: ffmpeg through DRM, mpv built with-Dvaapi-x11=disabled, Kodi on its Wayland platform, and Chromium, whose VA-API wrapper loadslibvaandlibva-drmalone. A program under Xwayland that wantslibva-x11gets no hardware decoding. Onauto, the default, the X11 display would be built whenever libX11, libXext, libXfixes and libxcb with its DRI3 extension are in the root, none of which is in this port’sdepends.-Dwith_glx=no— Builds nolibva-glx, the GLX texture interop, which needs the X11 display.-Dwith_win32=no— Builds no Windows display; onautothe probe finds nothing on Linux.-Denable_docs=false— Builds no Doxygen API reference, upstream’s default.
Libraries: libva-drm.so, libva-wayland.so, libva.so.
Directories: /usr/include/va, /usr/share/licenses/libva.
libva tries the Intel drivers in order, iHD from intel-media-driver before i965 from libva-intel-driver, so each machine loads the one that serves it. When no driver loads, ffmpeg and mpv fall back to software decoding without saying so; vainfo, from libva-utils, shows which profiles the loaded driver offers.