summaryrefslogtreecommitdiffstats
path: root/pkgs/applications/video
diff options
context:
space:
mode:
authorPedroHLC ☭ <root@pedrohlc.com>2023-01-26 17:14:28 -0300
committerPedroHLC ☭ <root@pedrohlc.com>2023-01-27 07:48:05 -0300
commit1ab7d2b8506639e18b44038e4b79702dcdb7150f (patch)
treefd3185551940c2cd8e394468a7243095d4b5d008 /pkgs/applications/video
parent04dda0c57d831640b70c653938ca571f95f757b6 (diff)
obs-studio-plugins.obs-vaapi: init at 0.1.0
Diffstat (limited to 'pkgs/applications/video')
-rw-r--r--pkgs/applications/video/obs-studio/plugins/default.nix2
-rw-r--r--pkgs/applications/video/obs-studio/plugins/obs-vaapi/default.nix49
-rw-r--r--pkgs/applications/video/obs-studio/wrapper.nix2
3 files changed, 52 insertions, 1 deletions
diff --git a/pkgs/applications/video/obs-studio/plugins/default.nix b/pkgs/applications/video/obs-studio/plugins/default.nix
index ad37c503c0ab..eb57866d50cb 100644
--- a/pkgs/applications/video/obs-studio/plugins/default.nix
+++ b/pkgs/applications/video/obs-studio/plugins/default.nix
@@ -30,6 +30,8 @@
obs-source-record = callPackage ./obs-source-record.nix { };
+ obs-vaapi = callPackage ./obs-vaapi { };
+
obs-vkcapture = callPackage ./obs-vkcapture.nix {
obs-vkcapture32 = pkgsi686Linux.obs-studio-plugins.obs-vkcapture;
};
diff --git a/pkgs/applications/video/obs-studio/plugins/obs-vaapi/default.nix b/pkgs/applications/video/obs-studio/plugins/obs-vaapi/default.nix
new file mode 100644
index 000000000000..7a8e19325090
--- /dev/null
+++ b/pkgs/applications/video/obs-studio/plugins/obs-vaapi/default.nix
@@ -0,0 +1,49 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, gst_all_1
+, pciutils
+, pkg-config
+, meson
+, ninja
+, obs-studio
+}:
+
+stdenv.mkDerivation rec {
+ pname = "obs-vaapi";
+ version = "0.1.0";
+
+ src = fetchFromGitHub {
+ owner = "fzwoch";
+ repo = pname;
+ rev = version;
+ hash = "sha256-qA4xVVShkp40QHp2HmmRzVxQaBwskRpUNEULKetVMu8=";
+ };
+
+ 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; builtins.map gstreamerHook [
+ gstreamer
+ gst-plugins-base
+ gst-plugins-bad
+ gst-vaapi
+ ];
+
+ meta = with lib; {
+ description = "OBS Studio VAAPI support via GStreamer";
+ homepage = "https://github.com/fzwoch/obs-vaapi";
+ maintainers = with maintainers; [ ahuzik pedrohlc ];
+ license = licenses.gpl2Plus;
+ platforms = [ "x86_64-linux" "i686-linux" ];
+ };
+}
diff --git a/pkgs/applications/video/obs-studio/wrapper.nix b/pkgs/applications/video/obs-studio/wrapper.nix
index 5303991f1fb9..62bc80d26df3 100644
--- a/pkgs/applications/video/obs-studio/wrapper.nix
+++ b/pkgs/applications/video/obs-studio/wrapper.nix
@@ -24,7 +24,7 @@ symlinkJoin {
"$out/bin/obs"
''--set OBS_PLUGINS_PATH "${pluginsJoined}/lib/obs-plugins"''
''--set OBS_PLUGINS_DATA_PATH "${pluginsJoined}/share/obs/obs-plugins"''
- ] ++ pluginArguments;
+ ] ++ lists.unique pluginArguments;
in ''
${concatStringsSep " " wrapCommandLine}