obs-gstreamer

obs-gstreamer 0.4.1

cibc-redding

New Member
I've read through all the posts here as well as documentation I could find on gstreamer. We're running OBS in Mac OS 10.15 (Catalina). I've installed gstream runtime using Homebrew, and I've copied the obs-gstreamer.so file to plugins folder of OBS.

The gstream source still doesn't show in OBS, and I think it's because my path isn't set.

This is from OBS log:

Code:
os_dlopen(/Applications/OBS.app/Contents/PlugIns/obs-gstreamer.so->/Applications/OBS.app/Contents/PlugIns/obs-gstreamer.so): dlopen(/Applications/OBS.app/Contents/PlugIns/obs-gstreamer.so, 257): Library not loaded: /opt/local/lib/libgstreamer-1.0.0.dylib
11:47:43.177:   Referenced from: /Applications/OBS.app/Contents/PlugIns/obs-gstreamer.so
11:47:43.177:   Reason: image not found
11:47:43.177:
11:47:43.177: Module '/Applications/OBS.app/Contents/PlugIns/obs-gstreamer.so' not loaded

For the life of me I can't figure out how to set the PATH that several refer to. It seems that everything I see posted relates to a Windows installation. How do I set the path in Mac OS?
 

Tuna

Member
Try installing GStreamer via macports. Latest versions of homebrew changed install locations and therefore are not found by the pre-built binary. Or, as always, build and link the plugin yourself to the GStreamer libraries you have installed.
 

sperok

New Member
Are there any known issues using a tee in the gstreamer plugin pipeline to feed an opencv based analytics sink? The sink does not modify the video but does use websockets to switch scenes in OBS based on what it observes. The goal is to avoid video buffer copies in the analytics pipeline.
 

LuigiE.Poletti

New Member
I've read through all the posts here as well as documentation I could find on gstreamer. We're running OBS in Mac OS 10.15 (Catalina). I've installed gstream runtime using Homebrew, and I've copied the obs-gstreamer.so file to plugins folder of OBS.

The gstream source still doesn't show in OBS, and I think it's because my path isn't set.

This is from OBS log:

Code:
os_dlopen(/Applications/OBS.app/Contents/PlugIns/obs-gstreamer.so->/Applications/OBS.app/Contents/PlugIns/obs-gstreamer.so): dlopen(/Applications/OBS.app/Contents/PlugIns/obs-gstreamer.so, 257): Library not loaded: /opt/local/lib/libgstreamer-1.0.0.dylib
11:47:43.177:   Referenced from: /Applications/OBS.app/Contents/PlugIns/obs-gstreamer.so
11:47:43.177:   Reason: image not found
11:47:43.177:
11:47:43.177: Module '/Applications/OBS.app/Contents/PlugIns/obs-gstreamer.so' not loaded

For the life of me I can't figure out how to set the PATH that several refer to. It seems that everything I see posted relates to a Windows installation. How do I set the path in Mac OS?

I have same problem, have you find some solution?
 

jann2021

New Member
Hi,
obs-gstreamer is great but... I can't have audio and video sync with low delay... If I check "sync applink to clock audio/video" audio/video is synchronized but delay is bigger than in vlc source.
I'm using this command:
Code:
uridecodebin uri=rtsp://user:password@ip/live latency=100 name=src src. ! queue !  video. src. ! queue ! audio.

running:
Code:
gst-launch-1.0 rtspsrc location=rtsp://user:password@ip/live latency=100 name=src src. ! queue ! rtph264depay ! h264parse ! avdec_h264 ! videoconvert ! autovideosink src. ! decodebin ! audioconvert ! autoaudiosink
from command line works fine - almost no delay and audio and video is synchronized.

So - the plugin is working ok as far as low video delay, but for me is useless as far as audio+video low delay. My camera is Dahua.

Anybody is using this plugin to have audio&video stream with low delay and can share with me a solution?
 
Hi,
obs-gstreamer is great but... I can't have audio and video sync with low delay... If I check "sync applink to clock audio/video" audio/video is synchronized but delay is bigger than in vlc source.
I'm using this command:
Code:
uridecodebin uri=rtsp://user:password@ip/live latency=100 name=src src. ! queue !  video. src. ! queue ! audio.

running:
Code:
gst-launch-1.0 rtspsrc location=rtsp://user:password@ip/live latency=100 name=src src. ! queue ! rtph264depay ! h264parse ! avdec_h264 ! videoconvert ! autovideosink src. ! decodebin ! audioconvert ! autoaudiosink
from command line works fine - almost no delay and audio and video is synchronized.

So - the plugin is working ok as far as low video delay, but for me is useless as far as audio+video low delay. My camera is Dahua.

Anybody is using this plugin to have audio&video stream with low delay and can share with me a solution?

Try playing with all combinations of sync to source and sync to sink. If not set right, latency will stick to 2 seconds. If you have only one camera, try without sync. It brought back latency for me from 2000ms ( 2 seconds) to about 400ms.
 

TheGodlyNoob

New Member
hey guys, I tried setting it up yesterday and so far it's working great besides that the audio is not in sync with the video.

I send my stream to an RTMP server I setup with NGINX on my raspberry pi and then I receive it into my OBS Gstreamer source.

The audio sometimes starts crackling really bad/starts having really bad robotic audio and it is delayed 2+ seconds ( at random ).

When I use VLC source I have no audio delay from the RTMP feed so it's probably something I need to add in the pipeline.

Here is what I am using currently :

uridecodebin uri=rtmp://rtmpserver name=bin latency=100 ! queue ! video. bin. ! queue ! audio.
 

jann2021

New Member
Try playing with all combinations of sync to source and sync to sink. If not set right, latency will stick to 2 seconds. If you have only one camera, try without sync. It brought back latency for me from 2000ms ( 2 seconds) to about 400ms.

Hi,
I have two cameras but only one is with audio. I've tried combinations with time stamps and sync. No success. The only success is small video delay. Audio is not working with gstreamer. I've tested it on linux and windows 10.
But gst-launch is playing as it should so it's not gstreamer problem but obs-gstreamer plugin or some magic configuration. Can you share johny yours gstreamer source path? or print screen with all settings?
 

jwoods09

New Member
Hi, @Tuna -
Thanks for the great plugin. I had a ton of problems with my stream from an IP camera in OBS freezing and using your plugin has seemed to resolve it. However, after about 6 hours, the stream in OBS goes black. After researching, I do have VLC installed as well. That fixed the black screen, but it was freezing. Your plugin fixed the freezing but now its going black. LOL. Do you have any thoughts on how I could resolve this? Im running OBS 26.1.1 on XUBUNTU installed on a mini pc.

I appreciate your willingness to help everyone here!

PS: Im VERY new to streaming so I apologize if I haven't provided enough information to help me LOL.
 

adalbert

New Member
Hi,
after working for a while with this nice plugin on various PCs, I often found installing GStreamer every time and setting all paths pretty frustrating and time consuming. So I think i found a way to make an easy and clean solution for portable setups (you have everything in one directory - OBS, obs-gstreamer and GStreamer runtime). That should work for Windows PCs.

1. Unzip OBS-Studio-26.1-Full-x64 (i found 26.1.1 to not work) to OBS directory. Create gstreamer folder inside that directory.
2. Copy contents from C:\gstreamer\1.0\mingw_x86_64a\ into gstreamer directory inside OBS directory.
3. Extract obs-gstreamer.dll into OBS\obs-plugins\64bit directory.

Now create file run_obs_gstreamer.bat inside OBS directory:
Code:
cd /D "%~dp0"
cd gstreamer
SET GSTREAMER_1_0_ROOT_MINGW_X86_64=%cd%
cd bin
SET PATH=%cd%
SET GST_PLUGIN_PATH=%cd%
cd..
cd..
cd bin
cd 64bit
start obs64.exe
It will set all required variables on the runtime, and enable GStreamer just for that OBS installation. To run OBS with GStreamer, simply double click that BAT file. You can even create a shortcut for that BAT file, set the OBS icon and put it on your desktop.
If you want to also have all scenes and profiles saved inside the OBS directory (so you can use it on external drive and move between PCs), create empty portable_mode.txt file inside OBS directory and inside BIN directory (probably only one is really required).

If you zip OBS directory and put on your USB drive or cloud storage, in theory it should work out of the box on any Windows PC.
 

Attachments

  • obs_gstreamer_dirs.png
    obs_gstreamer_dirs.png
    39.6 KB · Views: 137

Paul-Tahoe

New Member
It seems like a few people have made this work on a Mac but none of them have really shared how exactly. What little is out there says Macport but then doesn't really say how or what. There is a prebuilt but then people say that doesn't work.

After much trial and mostly error. I did finally make it work with the prebuilt. I had to create a symbolic link from the gstream libraries to where the prebuilt thinks they are. Probably easiest to do from a terminal window.

  1. Download GStream and install. https://gstreamer.freedesktop.org/download/#macos
    I used 1.18.3 runtime installer. It probably won't let you install it and you'll have to go to System Preferences => Security General tab and allow it to install.
  2. Get the prebuilt: https://github.com/fzwoch/obs-gstreamer/releases/tag/v0.3.0 (or whatever the latest version is) download obs-gstreamer.zip and expand
  3. From the terminal window logged in as an administrator create directories needed for the plugin in obs (obs-gstreamer and bin)
    sudo mkdir -p /Library/Application\ Support/obs-studio/plugins/obs-gstreamer/bin
  4. Copy obs.gstreamer.so from expanded directory in step 2. (obs-gstreamer/macos). If you downloaded it and expanded it in your download directory then from the terminal
    sudo cp ~/Downloads/obs-gstreamer/macos/obs-gstreamer.so /Library/Application\ Support/obs-studio/plugins/obs-gstreamer/bin
  5. Create directories and symlink from gstream libraries to where the plugin is expecting them
    sudo mkdir -p /opt/local
    sudo ln -s /Library/Frameworks/GStreamer.framework/Versions/1.0/lib /opt/local/
  6. Open OBS. You may get a message about obs-gstreamer.so not being OK. Cancel. Quit OBS go to System Preferences => Security General tab and allow it. Open OBS again. Now you should see GStreamer Source in the sources.
  7. Add a GStreamer Source. Uncheck both Sync options. Put in a pipeline. For us using PTZOptics camera without audio (we have a separate mixer), it was this:
    uridecodebin uri=rtsp://192.168.2.88/1 name=bin ! queue ! video.
Good luck. It seems like it shouldn't this hard. I guess is someone were to rebuild the .so with what the current GStream pkg installs into and create the directories above the .so so it can just be plopped in the pluggin directory...
 

avico

New Member
Hi there, I'm using OBS under jetson nano, it works ok, but when I install obs-gstreamer OBS Crashed with this output,
if I remove gstreamer pluggin the problem dissapear. Any suggestion?

QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
Attempted path: share/obs/obs-studio/locale/en-US.ini
Attempted path: /usr/share/obs/obs-studio/locale/en-US.ini
Attempted path: share/obs/obs-studio/locale.ini
Attempted path: /usr/share/obs/obs-studio/locale.ini
Attempted path: share/obs/obs-studio/locale/es-ES.ini
Attempted path: /usr/share/obs/obs-studio/locale/es-ES.ini
info: Using preferred locale 'es-ES'
Attempted path: share/obs/obs-studio/themes/Dark.qss
Attempted path: /usr/share/obs/obs-studio/themes/Dark.qss
info: Physical Cores: 4, Logical Cores: 4
info: Physical Memory: 3956MB Total, 525MB Free
info: Kernel Version: Linux 4.9.140-tegra
info: Distribution: "Ubuntu" "20.04"
info: Window System: X11.0, Vendor: The X.Org Foundation, Version: 1.20.9
info: Portable mode: false
Attempted path: share/obs/obs-studio/themes/Dark/no_sources.svg
Attempted path: /usr/share/obs/obs-studio/themes/Dark/no_sources.svg
QMetaObject::connectSlotsByName: No matching signal for on_advAudioProps_clicked()
QMetaObject::connectSlotsByName: No matching signal for on_advAudioProps_destroyed()
QMetaObject::connectSlotsByName: No matching signal for on_actionGridMode_triggered()
QMetaObject::connectSlotsByName: No matching signal for on_program_customContextMenuRequested(QPoint)
info: OBS 25.0.3+dfsg1-2 (linux)
info: ---------------------------------
info: ---------------------------------
info: audio settings reset:
samples per sec: 44100
speakers: 2
info: ---------------------------------
info: Initializing OpenGL...
info: Loading up OpenGL on adapter NVIDIA Corporation NVIDIA Tegra X1 (nvgpu)/integrated
info: OpenGL loaded successfully, version 3.3.0 NVIDIA 32.3.1, shading language 3.30 NVIDIA via Cg compiler
info: ---------------------------------
info: video settings reset:
base resolution: 1920x1080
output resolution: 1280x720
downscale filter: Bicubic
fps: 30/1
format: NV12
YUV mode: 601/Partial
info: NV12 texture support not available
info: Audio monitoring device:
name: Por defecto
id: default
info: ---------------------------------
warning: Failed to load 'en-US' text for module: 'decklink-ouput-ui.so'
libDeckLinkAPI.so: no se puede abrir el archivo del objeto compartido: No existe el archivo o el directorio
warning: A DeckLink iterator could not be created. The DeckLink drivers may not be installed
info: No blackmagic support
info: FFMPEG VAAPI supported
info: obs-gstreamer build: 2b6aa8d
*** buffer overflow detected ***: terminated
Abortado
 

alvanfleet

New Member
I still can't figure out why this isn't working for me. I'm assuming my pipeline must be incorrect as I think I've got all the other components in the right places. I'm attempting to use,

uridecodebin uri=rtsp://10.3.29.94:554/main name=bin ! queue ! video.

Admittedly, I don't really know what I'm doing. I'll answer any questions you have to help me figure this out.
 

Tuna

Member
I have frame render losses when closing gstreamer sources (obs & gstreamer current stable):
https://wetransfer.com/downloads/aa...a51390d8e23dbb094fcb9bb920210328164211/c6dc3e (40mb.mp4)

This is un / known bug, or something that I misconfigure?
Speculating here. Perhaps OBS calls the stop/destroy synchronously. In your case the GStreamer will send a TEARDOWN to your RTSP server. This probably takes some time during OBS may be stalled. As check you may want to try to untick the "stop pipeline when hidden" checkbox.
 
Top