From 3c91e92068fe657a19e729b8235e27ce6d4243ac Mon Sep 17 00:00:00 2001 From: Evan Richter Date: Tue, 23 Jan 2024 14:09:02 -0700 Subject: [PATCH 1/2] onevpl-intel-gpu: init at 23.4.3 --- pkgs/by-name/on/onevpl-intel-gpu/package.nix | 38 ++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 pkgs/by-name/on/onevpl-intel-gpu/package.nix diff --git a/pkgs/by-name/on/onevpl-intel-gpu/package.nix b/pkgs/by-name/on/onevpl-intel-gpu/package.nix new file mode 100644 index 000000000000..64e6f9d262f2 --- /dev/null +++ b/pkgs/by-name/on/onevpl-intel-gpu/package.nix @@ -0,0 +1,38 @@ +{ lib +, stdenv +, fetchFromGitHub +, cmake +, pkg-config +, libdrm +, libva +}: + +stdenv.mkDerivation rec { + pname = "onevpl-intel-gpu"; + version = "23.4.3"; + + outputs = [ "out" "dev" ]; + + src = fetchFromGitHub { + owner = "oneapi-src"; + repo = "oneVPL-intel-gpu"; + rev = "intel-onevpl-${version}"; + sha256 = "sha256-oDwDMUq6JpRJH5nbANb7TJLW7HRYA9y0xZxEsoepx/U="; + }; + + nativeBuildInputs = [ cmake pkg-config ]; + + buildInputs = [ libdrm libva ]; + + meta = { + description = "oneAPI Video Processing Library Intel GPU implementation"; + homepage = "https://github.com/oneapi-src/oneVPL-intel-gpu"; + changelog = "https://github.com/oneapi-src/oneVPL-intel-gpu/releases/tag/${src.rev}"; + license = [ lib.licenses.mit ]; + platforms = lib.platforms.linux; + # CMake adds x86 specific compiler flags in /builder/FindGlobals.cmake + # NOTE: https://github.com/oneapi-src/oneVPL-intel-gpu/issues/303 + broken = !stdenv.hostPlatform.isx86; + maintainers = [ lib.maintainers.evanrichter ]; + }; +} From 88add7e28ef9e6610619bac4752a11be0830a0d2 Mon Sep 17 00:00:00 2001 From: Philipp Jungkamp Date: Fri, 1 Sep 2023 00:28:34 +0200 Subject: [PATCH 2/2] ffmpeg: add withVPL option for libvpl Co-authored-by: Evan Richter --- pkgs/development/libraries/ffmpeg/generic.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkgs/development/libraries/ffmpeg/generic.nix b/pkgs/development/libraries/ffmpeg/generic.nix index a44501fea081..f666b08af8ee 100644 --- a/pkgs/development/libraries/ffmpeg/generic.nix +++ b/pkgs/development/libraries/ffmpeg/generic.nix @@ -92,6 +92,7 @@ , withVmaf ? withFullDeps && !stdenv.isAarch64 && lib.versionAtLeast version "5" # Netflix's VMAF (Video Multi-Method Assessment Fusion) , withVoAmrwbenc ? withFullDeps && withVersion3 # AMR-WB encoder , withVorbis ? withHeadlessDeps # Vorbis de/encoding, native encoder exists +, withVpl ? false # Hardware acceleration via intel libvpl , withVpx ? withHeadlessDeps && stdenv.buildPlatform == stdenv.hostPlatform # VP8 & VP9 de/encoding , withVulkan ? withFullDeps && !stdenv.isDarwin , withWebp ? withFullDeps # WebP encoder @@ -237,6 +238,7 @@ , libvdpau , libvmaf , libvorbis +, libvpl , libvpx , libwebp , libX11 @@ -319,6 +321,7 @@ assert withGPLv3 -> withGPL && withVersion3; * Build dependencies */ assert withPixelutils -> buildAvutil; +assert !(withMfx && withVpl); # incompatible features /* * Program dependencies */ @@ -529,6 +532,9 @@ stdenv.mkDerivation (finalAttrs: { (enableFeature withV4l2M2m "v4l2-m2m") (enableFeature withVaapi "vaapi") (enableFeature withVdpau "vdpau") + ] ++ optionals (versionAtLeast version "6.0") [ + (enableFeature withVpl "libvpl") + ] ++ [ (enableFeature withVidStab "libvidstab") # Actual min. version 2.0 (enableFeature withVmaf "libvmaf") (enableFeature withVoAmrwbenc "libvo-amrwbenc") @@ -643,6 +649,7 @@ stdenv.mkDerivation (finalAttrs: { ++ optionals withVmaf [ libvmaf ] ++ optionals withVoAmrwbenc [ vo-amrwbenc ] ++ optionals withVorbis [ libvorbis ] + ++ optionals withVpl [ libvpl ] ++ optionals withVpx [ libvpx ] ++ optionals withVulkan [ vulkan-headers vulkan-loader ] ++ optionals withWebp [ libwebp ]