Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

obs-studio: add support for srt protocol #116173

Closed
wants to merge 1 commit into from
Closed

obs-studio: add support for srt protocol #116173

wants to merge 1 commit into from

Conversation

BenediktSeidl
Copy link

Motivation for this change

https://obsproject.com/wiki/ advertises support of SRT Protocol, and the nixos package, but the nix package does not include support for the SRT Protocol.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of obs in ./result/bin/
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@r-rmcgibbo
Copy link

Result of nixpkgs-review pr 116173 at 0cef0e9 run on x86_64-linux 1

1 package failed to build (new failures):
5 packages built successfully:

@@ -24395,7 +24395,9 @@ in

oberon-risc-emu = callPackage ../misc/emulators/oberon-risc-emu { };

obs-studio = libsForQt5.callPackage ../applications/video/obs-studio { };
obs-studio = libsForQt5.callPackage ../applications/video/obs-studio {
ffmpeg = ffmpeg-full.override { srt = srt; };
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did we already check if inherit srt works here?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried it and it did not work. As I have absolutely no idea how to debug the error message i switched back to the override version.

diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 906e90a8249..6f9433dace7 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -24395,7 +24395,9 @@ in
 
   oberon-risc-emu = callPackage ../misc/emulators/oberon-risc-emu { };
 
-  obs-studio = libsForQt5.callPackage ../applications/video/obs-studio { };
+  obs-studio = libsForQt5.callPackage ../applications/video/obs-studio {
+    ffmpeg = ffmpeg-full { inherit srt; };
+  };
 
   obs-wlrobs = callPackage ../applications/video/obs-studio/wlrobs.nix { };
[nix-shell:~/Code/nixpkgs]$ nix-build -A obs-studio --show-trace
error: while evaluating the attribute 'buildInputs' of the derivation 'obs-studio-26.1.2' at /home/obs/Code/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:192:11:
while evaluating 'getOutput' at /home/obs/Code/nixpkgs/lib/attrsets.nix:482:23, called from undefined position:
while evaluating anonymous function at /home/obs/Code/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:143:17, called from undefined position:
attempt to call something which is not a function but a set, at /home/obs/Code/nixpkgs/pkgs/top-level/all-packages.nix:24399:14

@MatthewCroughan
Copy link
Contributor

@SuperSandro2000 I was going to submit a patch that changes the build inputs of obs-studio from ffmpeg to ffmpeg-full. Would this be better? That works fine.

However, obs-studio isn't the only package effected by this. So is mpv, which also allows you to listen and call srt streams.

mpv srt://0.0.0.0:9000?mode=listener

You can then use obs-studio to stream to this by putting the following in as a stream url:

srt://127.0.0.1:9000?mode=caller.

Maybe we should just be compiling srt into ffmpeg by default? There are going to be applications that need this functionality going forward.

@MatthewCroughan
Copy link
Contributor

Essentially, this patch should be added to ffmpeg as well as ffmpeg-full 47801af

@SuperSandro2000
Copy link
Member

@ofborg eval

@SuperSandro2000
Copy link
Member

I was going to submit a patch that changes the build inputs of obs-studio from ffmpeg to ffmpeg-full. Would this be better? That works fine.

That would cleanup the package a bit and we could also do this here.

Maybe we should just be compiling srt into ffmpeg by default? There are going to be applications that need this functionality going forward.

I am not sure if this is needed in the default ffmpeg and if that feature is widely used. ffmpeg is probably pretty big already and we should only include it if it is a common feature expected to work.

@stale
Copy link

stale bot commented Oct 30, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Oct 30, 2021
@fpletz
Copy link
Member

fpletz commented Jan 18, 2022

SRT support in ffmpeg is now enabled by default: #120577

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md 10.rebuild-darwin: 0 10.rebuild-linux: 1-10 12. first-time contribution
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants