Merge pull request #212836 from PedroHLC/obs-gstreamer-0.4.0

obs-gstreamer: 0.3.5 -> 0.4.0; obs-vaapi: init at 0.1.0
This commit is contained in:
Nick Cao 2023-01-27 18:58:31 +08:00 committed by GitHub
commit 449bb45c17
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 61 additions and 7 deletions

View file

@ -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;
};

View file

@ -10,13 +10,13 @@
stdenv.mkDerivation rec {
pname = "obs-gstreamer";
version = "0.3.5";
version = "0.4.0";
src = fetchFromGitHub {
owner = "fzwoch";
repo = "obs-gstreamer";
repo = pname;
rev = "v${version}";
hash = "sha256-zP1MMoXLp+gp0fjVbWi/Wse6I8u9/K2IeSew3OjkCkE=";
hash = "sha256-C4yee7hzkSOjIeaacLaTGPzZ1qYdYtHK5a3m9gz2pPI=";
};
nativeBuildInputs = [ pkg-config meson ninja ];
@ -25,7 +25,6 @@ stdenv.mkDerivation rec {
# - 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 "h264parse";
# - gst-vaapi adds "VA-API" to "Encoder type";
# - gst-plugins-ugly adds "x264" to "Encoder type";
# Tip: "could not link appsrc to videoconvert1" can mean a lot of things, enable GST_DEBUG=2 for help.
passthru.obsWrapperArguments =
@ -36,11 +35,15 @@ stdenv.mkDerivation rec {
gstreamer
gst-plugins-base
gst-plugins-bad
gst-plugins-ugly
gst-vaapi
];
# Fix output directory
postInstall = ''
mkdir $out/lib/obs-plugins
mv $out/lib/obs-gstreamer.so $out/lib/obs-plugins/
'';
meta = with lib; {
description = "An OBS Studio source, encoder and video filter plugin to use GStreamer elements/pipelines in OBS Studio";
homepage = "https://github.com/fzwoch/obs-gstreamer";

View file

@ -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" ];
};
}

View file

@ -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}