Files
nixpkgs/pkgs/applications/video/obs-studio/plugins/obs-vaapi/default.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

72 lines
1.7 KiB
Nix

{
lib,
stdenv,
fetchFromGitHub,
gst_all_1,
pciutils,
pkg-config,
meson,
ninja,
obs-studio,
}:
stdenv.mkDerivation rec {
pname = "obs-vaapi";
version = "0.4.2";
src = fetchFromGitHub {
owner = "fzwoch";
repo = "obs-vaapi";
rev = version;
hash = "sha256-ykiLsHL3hoe0ibxMxp4zrqeSeQfgnJfNg7Yb5i9HDJQ=";
};
nativeBuildInputs = [
pkg-config
meson
ninja
];
buildInputs = with gst_all_1; [
gstreamer
gst-plugins-base
obs-studio
pciutils
];
# - We need "getLib" instead of default derivation, otherwise it brings gstreamer-bin;
# - without gst-plugins-base it won't even show proper errors in logs;
# - Without gst-plugins-bad it won't find element "vapostproc";
# - gst-vaapi adds "VA-API" to "Encoder type";
# Tip: "could not link appsrc to videoconvert1" can mean a lot of things, enable GST_DEBUG=2 for help.
passthru.obsWrapperArguments =
let
gstreamerHook =
package: "--prefix GST_PLUGIN_SYSTEM_PATH_1_0 : ${lib.getLib package}/lib/gstreamer-1.0";
in
with gst_all_1;
map gstreamerHook [
gstreamer
gst-plugins-base
gst-plugins-bad
gst-vaapi
];
# Fix output directory
postInstall = ''
mkdir $out/lib/obs-plugins
mv $out/lib/obs-vaapi.so $out/lib/obs-plugins/
'';
meta = {
description = "OBS Studio VAAPI support via GStreamer";
homepage = "https://github.com/fzwoch/obs-vaapi";
changelog = "https://github.com/fzwoch/obs-vaapi/releases/tag/${version}";
maintainers = with lib.maintainers; [
ahuzik
pedrohlc
];
license = lib.licenses.gpl2Plus;
inherit (obs-studio.meta) platforms;
};
}