I've had some people ask for help with getting the GStreamer plugin working in OBS on Linux. I'm not really sure what application people are using this for and may be entirely different from mine, but I'll give what I did to try and help.
What I'm doing is using multiple Android phones (although I guess they could be iPhones) and using the Larix Broadcaster app. I'm connecting these phones and the box running OBS onto the same LAN network. The multiple Android phones will provide different video feeds into OBS and from best I can tell, the video between the multiple devices is synchronized. Note: when I say multiple, I'm only referring to two devices - I assume it would scale upward.
I should also note that I'm not really using this setup. Originally I thought I might want to have multiple cameras setup and be able to switch angles in my broadcast. Using nginx and RTMP I was not able to get this in sync - one video was always a little bit ahead of the other, so switching between angles wasn't really feasible. So I began chasing a white rabbit to try and figure out how to accomplish this. And in the meantime I found that one single camera worked well enough. Further, trying to manage multiple cameras for my one-man production crew proved to be a bit daunting. So my desire to find a multi-camera solution turned more into a quest of "how can this be done?" instead of actually applying it in production.
The first thing you need to know is the local IP address of the box running OBS. Should be a 192.168.X.Y or 10.X.Y.Z IP address - for me, it's 192.168.0.40 - but everyone's network setup is going to be different. I'm going to refer to this as
%boxip% in these instructions.
Start out by downloading the Gstreamer plugin from:
An OBS Studio source plugin to feed GStreamer launch pipelines into OBS Studio. This plugin has interesting use cases but may be difficult to understand and is clunky use if you are not familiar with GStreamer. Experimental prebuilt 64 Bit...
obsproject.com
You'll want to click the Go to download button and download the obs-gstreamer.zip file.
Next, unzip the obs-gstreamer.zip file and since we're only interested in the Linux library, you can just do:
unzip obs-gstreamer.zip linux/obs-gstreamer.so
Next, you want to create the plugin path for the GStreamer plugin:
mkdir -p ~/.config/obs-studio/plugins/obs-gstreamer/bin/64bit
And finally move the obs-gstreamer.so library into this directory:
mv linux/obs-gstreamer.so ~/.config/obs-studio/plugins/obs-gstreamer/bin/64bit
The Gstreamer plugin has now been installed.
Now, start OBS and in your desired scene click the Add button and add a GStreamer Source element
In the Pipeline area for this GStreamer Source element put:
srtsrc uri="srt://%boxip%:%port%?mode=listener" ! decodebin name=bin ! queue ! video. bin. ! queue ! audio.
Here - again
%boxip% refers to the local IP address of this Linux box you are running.
The
%port% can really be anything - but it's important to remember what this is.
Also, if you are using multiple devices, each device is going to use a different port. So these ports identify which device the feed is coming from.
I tend to start my port numbering at 7001 - I don't know why. I think that's what someone in this thread used 7001 so that's where I got my start.
Say you have an inside recording device and an outside recording device. The inside recording device might be sending out on port 7001 and the outside recording device might be sending out on port 7002. When you create these Gstreamer Elements and set their Pipeline area, you need to know which port is being referred to by each device so you set the element correctly.
That's really about it in OBS.
On your phone or devices - I'm using Larix Broadcaster, but I'm sure other SRT broadcasters would work.
In Larix Broadcaster create a new connection - name it something that you can recognize.
Set the URL to:
srt://%boxip%:%port%
Again -
%boxip% is the IP address of the Linux box running OBS
%port% is the port number referring to the specific GStreamer Source element you want this video to be seen at.
Click Save and make sure that new Connection is enabled.
Then go back to the camera screen in Larix Broadcaster and hit record.
The video from the phone should be displayed in the GStreamer Source element in OBS.
You can then create additional GStreamer Source elements and use the same Pipeline statement - just change the
%port% to reflect the the different streamer device source. And setup Larix Broadcaster on other devices again specifying the different
%port% to reflect this video stream.