From 01d55f3469b275a1aabf6d1cf2f8f2aa95af8a16 Mon Sep 17 00:00:00 2001 From: Jade Lovelace Date: Sat, 21 Dec 2024 20:39:55 -0800 Subject: [PATCH] vlc: pin ffmpeg to 4.x to fix VAAPI MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It turns out that https://github.com/NixOS/nixpkgs/pull/343567 did not go far enough. It appears that in fact, this is an upstream bug that Fedora people found: https://discussion.fedoraproject.org/t/vlc-not-exposing-va-api-as-a-hardware-acceleration-option/101133 Upstream bug in VLC: https://code.videolan.org/videolan/vlc/-/issues/26772 I don't like this change. However, I have tested it, and it does fix VAAPI on my machine, making it reappear in the menu as an acceleration option. ยป result/bin/vlc ~/test.mp4 VLC media player 3.0.21 Vetinari (revision 3.0.21-0-gdd8bfdbabe8) [000000002efd0520] main libvlc: Running vlc with the default interface. Use 'cvlc' to use vlc without interface. [00007f35c4004e00] gl gl: Initialized libplacebo v5.264.1 (API v264) libva info: VA-API version 1.22.0 libva info: Trying to open /run/opengl-driver/lib/dri/iHD_drv_video.so libva info: Found init function __vaDriverInit_1_22 libva info: va_openDriver() returns 0 [00007f35dcc1b710] avcodec decoder: Using Intel iHD driver for Intel(R) Gen Graphics - 24.3.4 () for hardware decoding --- pkgs/by-name/vl/vlc/package.nix | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/vl/vlc/package.nix b/pkgs/by-name/vl/vlc/package.nix index 965415665364..7b31afc60d4a 100644 --- a/pkgs/by-name/vl/vlc/package.nix +++ b/pkgs/by-name/vl/vlc/package.nix @@ -12,7 +12,11 @@ fetchpatch, fetchurl, # Please unpin FFmpeg on the next upstream release. - ffmpeg_6, + # Currently FFmpeg is pinned to 4.x because VAAPI acceleration is broken when + # building with newer versions: + # https://code.videolan.org/videolan/vlc/-/issues/26772 + # This is intentional by upstream but VLC 4.0 will support newer FFmpeg. + ffmpeg_4, flac, fluidsynth, freefont_ttf, @@ -139,7 +143,7 @@ stdenv.mkDerivation (finalAttrs: { avahi dbus faad2 - ffmpeg_6 + ffmpeg_4 flac fluidsynth fribidi