Merge pull request #184651 from PedroHLC/obs-gstreamer-0.3.4

obs-gstreamer: 0.3.3 -> 0.3.4
This commit is contained in:
Thiago Kenji Okada 2022-08-03 19:06:37 +01:00 committed by GitHub
commit 554304bff5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 36 additions and 9 deletions

View file

@ -10,22 +10,41 @@
stdenv.mkDerivation rec {
pname = "obs-gstreamer";
version = "0.3.3";
version = "0.3.4";
src = fetchFromGitHub {
owner = "fzwoch";
repo = "obs-gstreamer";
rev = "v${version}";
hash = "sha256-KhSBZcV2yILTf5+aNoYWDfNwPiJoyYPeIOQMDFvOusg=";
hash = "sha256-CDtWe4bx1M06nfqvVmIZaLQoKAsXFnG0Xy/mhiSbMgU=";
};
nativeBuildInputs = [ pkg-config meson ninja ];
buildInputs = with gst_all_1; [ gstreamer gst-plugins-base obs-studio ];
# - 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 =
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-plugins-ugly
gst-vaapi
];
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";
maintainers = with maintainers; [ ahuzik ];
maintainers = with maintainers; [ ahuzik pedrohlc ];
license = licenses.gpl2Plus;
platforms = [ "x86_64-linux" "i686-linux" ];
};

View file

@ -1,4 +1,4 @@
{ obs-studio, symlinkJoin, makeWrapper }:
{ lib, obs-studio, symlinkJoin, makeWrapper }:
{ plugins ? [] }:
@ -8,11 +8,19 @@ symlinkJoin {
nativeBuildInputs = [ makeWrapper ];
paths = [ obs-studio ] ++ plugins;
postBuild = ''
wrapProgram $out/bin/obs \
--set OBS_PLUGINS_PATH "$out/lib/obs-plugins" \
--set OBS_PLUGINS_DATA_PATH "$out/share/obs/obs-plugins"
'';
postBuild = with lib;
let
# Some plugins needs extra environment, see obs-gstreamer for an example.
pluginArguments =
lists.concatMap (plugin: plugin.obsWrapperArguments or []) plugins;
wrapCommand = [
"wrapProgram"
"$out/bin/obs"
''--set OBS_PLUGINS_PATH "$out/lib/obs-plugins"''
''--set OBS_PLUGINS_DATA_PATH "$out/share/obs/obs-plugins"''
] ++ pluginArguments;
in concatStringsSep " " wrapCommand;
inherit (obs-studio) meta;
passthru = obs-studio.passthru // {