depot/third_party/nixpkgs/pkgs/applications/video/obs-studio/plugins/obs-gstreamer.nix
Default email bcb2f287e1 Project import generated by Copybara.
GitOrigin-RevId: d603719ec6e294f034936c0d0dc06f689d91b6c3
2024-06-20 20:27:18 +05:30

54 lines
1.6 KiB
Nix

{ lib
, stdenv
, fetchFromGitHub
, gst_all_1
, pkg-config
, meson
, ninja
, obs-studio
}:
stdenv.mkDerivation rec {
pname = "obs-gstreamer";
version = "0.4.0";
src = fetchFromGitHub {
owner = "fzwoch";
repo = pname;
rev = "v${version}";
hash = "sha256-C4yee7hzkSOjIeaacLaTGPzZ1qYdYtHK5a3m9gz2pPI=";
};
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-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
];
# Fix output directory
postInstall = ''
mkdir $out/lib/obs-plugins
mv $out/lib/obs-gstreamer.so $out/lib/obs-plugins/
'';
meta = with lib; {
description = "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 pedrohlc ];
license = licenses.gpl2Plus;
platforms = platforms.linux;
};
}