obs-gstreamer

obs-gstreamer 0.4.1

SirRoadDog

New Member
I am trying to get a series of ancient Foscam IP cameras (models FI9821P V2 and FI9821W V2) to show up in OBS using obs-gstreamer via RTSP. These cameras are pre-H.264/H.265, and that seems to be where most of the examples for configuring IP cameras with obs-gstreamer focus.

I am able to get these cameras to appear in OBS using both the Media Source and the VLC Video Source options, using the following command string:
rtsp://username:password@10.10.10.100:88/videoMain
Unfortunately, the lag when using those two methods is nearly 2000ms, and it is my understanding that Gstreamer may help with the lag.

I have attempted a few variations on the Pipeline field command string of obs-gstreamer's Gstreamer Source ("rtspsrc location=...", "uridecodebin uri=...", etc), and so far only time I've gotten obs-gstreamer to show video from the cameras is using a Pipeline command string of:
playbin uri=rtsp://username:password@10.10.10.100:88/videoMain
However, this does not show the video in OBS, but rather opens an external video window labeled "Direct3D11 renderer" and displays the RTSP stream there.

Since my Foscams are capable of displaying their RTSP streams in OBS via Media Source and VLC Video Source, and since obs-gstreamer is capable of displaying their RTSP stream in an external window (but not in OBS itself), it seems to me that my issue is not a technical limitation but rather a limited understanding of the gstreamer Pipeline configuration options.

Any assistance from users with more gstreamer configuration experience would be welcome.
 

Tuna

Member
The README has a very basic syntax example for RTSP that is codec agnostic. Not sure why this would not work in your case.
You may have to give username and pasword via rtspsrc properties instead of being part of the uri.
 
Last edited:

SirRoadDog

New Member
Thank you for your prompt response and for making me recheck the obvious. I had the following Pipeline command string written in my notes as one that I had tried and discarded, but for whatever reason, when I tried it just now, it worked:
Code:
uridecodebin uri=rtsp://username:password@10.10.10.100:88/videoMain name=bin ! queue ! video. bin. ! queue ! audio.

Now that I am seeing video through obs-gstreamer, I have two other issues.

Issue 1 is latency. My workaround method had been to establish a full screen stream of the camera using VLC and then import that into OBS as a Window Capture source. Using the (admittedly kludgy) Windows Capture method, I am seeing a latency of about 500ms. Using the Gstreamer Source method with the default rtsp command string above, I am seeing a latency of about 1100ms. Can you offer some suggestions towards reducing that latency?

Issue 2 is that the stream seems to go to sleep. When I cut to a scene with the Gstreamer Source, the stream stays black for about 800ms, then it goes to green for another 800ms, and then it finally shows the "live" stream (with its 1100ms latency in tact). Thoughts on how to keep the stream active so that it's available immediately when I cut to that scene? For what it's worth, using the Windows Capture method keeps the stream alive and available for immediate viewing upon cutting to the scene.

Thanks for your help on this.
 

Tuna

Member
There are a lot of options in the plugin already. One of them controls the hidden behavior for example.
Many others control some other behaviors of the pipeline. You need to read some GStreamer basics and understand how it works and set the options to what _you_ want. This is a fundamental approach of this plugin you can construct things for your goals - but it cannot do it for you.
More options may be exposed by element properties. It may result in you having to modify the pipeline to your needs.
 

isgulkov

New Member
I'm sorry, but is it at all possible to build this on Mac without XCode?

The error I'm getting from meson setup .. is this:

Code:
Run-time dependency libobs found: NO (tried pkgconfig, framework and cmake)

1. I do have the obs-studio sources with the libobs subdirectory (although the obs/obs.h directory structure doesn't exist there)
2. I also have the binary of the libobs library inside a precompiled OBS (at /Applications/OBS.app/Contents/Frameworks/libobs.framework)

I would try to build full OBS from source and do sudo make install, — in fact, I have, — but it says Building OBS Studio on macOS requires Xcode generator. which, as far as I can google, means that I need to have not just the command line tools which I obviously do, but the actual XCode (i.e. XCode.app, the 30-or-whatever-gig IDE) on my machine. Wtf? Over my dead body am I downloading that.

After looking through obs-studios's cmake file hierarchy I conclude that there is no option to just build libobs with simple make or whatever — you either build the complete thing with UI using XCode or don't build anything at all.

So, anyway, is there a way to point this "meson" thing to the libobs I already have? (as described in #1 and #2 above) I have tried to google this, but, as with every other boutique build system, any info on it (beyond its own source code) is extremely scarce.
 

Gee770

New Member
Hello,
I am streaming through udp on gstreamer and im trying to display the stream inside OBS but for some reason its only sinking it to d3d instead so its opening another window instead of showing the stream on the app itself. I tried using appsink but that didnt work and I got a blackscreen. Appsink doesnt even work using my usual terminal method. Is there a way to make my stream appear inside the app itself and not on a separate window?
 
Hello,
I am streaming through udp on gstreamer and im trying to display the stream inside OBS but for some reason its only sinking it to d3d instead so its opening another window instead of showing the stream on the app itself. I tried using appsink but that didnt work and I got a blackscreen. Appsink doesnt even work using my usual terminal method. Is there a way to make my stream appear inside the app itself and not on a separate window?
Can you share your gstreamer command? Gstreamer has a steep learning curve ….
 

Gee770

New Member
Can you share your gstreamer command? Gstreamer has a steep learning curve ….
Sender:
gst-launch-1.0 mfvideosrc device-index=0 ! video/x-raw,format=NV12,width=1600,height=1200,framerate=60/1 ! videoconvert ! x264enc tune=zerolatency bitrate=10000 key-int-max=10 speed-preset=superfast ! rtph264pay ! udpsink host=localip port=12345

Receiver on OBS:
udpsrc port=12345 ! application/x-rtp, encoding-name=H264 ! rtph264depay ! avdec_h264 ! videoconvert ! autovideosink
 

Tuna

Member
Sender:
gst-launch-1.0 mfvideosrc device-index=0 ! video/x-raw,format=NV12,width=1600,height=1200,framerate=60/1 ! videoconvert ! x264enc tune=zerolatency bitrate=10000 key-int-max=10 speed-preset=superfast ! rtph264pay ! udpsink host=localip port=12345

Receiver on OBS:
udpsrc port=12345 ! application/x-rtp, encoding-name=H264 ! rtph264depay ! avdec_h264 ! videoconvert ! autovideosink
From the Readme:
This plugins provides two media sinks named video and audio. These are the media sinks that hand over data to OBS Studio. So your pipeline should connect to these sinks.
There also some examples. The default pipeline in the plugin exercises this too.
 

Gee770

New Member
Alright adding !video. helped. The only thing is that whenever I restart my pc, I have to set delete the path for the plugins and set it again and also for some reason my original bin path that I had before doesnt work unless I have to manually delete the path to my plugins
 

Tuna

Member
Alright adding !video. helped. The only thing is that whenever I restart my pc, I have to set delete the path for the plugins and set it again and also for some reason my original bin path that I had before doesnt work unless I have to manually delete the path to my plugins
Not sure if i got it right. Assuming you are on Windows, you will have to set the bin path to GStreamer in the global PATH variable if you want it to be permanent.
 

Gee770

New Member
Not sure if i got it right. Assuming you are on Windows, you will have to set the bin path to GStreamer in the global PATH variable if you want it to be permanent.
Thats what I did but for some reason after I restart my pc, I have to delete my plugins path and add it again so it works. The bin path works fine only after I delete my plugins path
 

kamin1ii

New Member
Anybody could help me? I tried installing the mingw x64 version (the latest version) of gstreamer and set both system and user variables to its bin and also installed the plugin in the right folder of OBS and I get nothing... I tried installing older versions of both mingw gstreamer in its x64 installer and also an older version of OBS (with the plugin installed), still nothing...
 

kamin1ii

New Member
Anybody could help me? I tried installing the mingw x64 version (the latest version) of gstreamer and set both system and user variables to its bin and also installed the plugin in the right folder of OBS and I get nothing... I tried installing older versions of both mingw gstreamer in its x64 installer and also an older version of OBS (with the plugin installed), still nothing...
nvm I'm an idiot, instead of "system and user variables" there was a path variable inside both, and I just needed to put the bins there instead of creating a new variable
 

kamin1ii

New Member
Okay now my OBS will crash (either by not responding or bug the sources/preview to be unusable) whenever one of my Gstream sources is lagging behind by 10k+ ms and tries to restart, is it my end?
 

vodamerc

New Member
Is there any way to adjust the outputted YUV range and colorspace on the plugin? Much like on the built in OBS media source & OBS-NDI?

I have a hardware encoder that produces H265 SRT and RTSP feeds with the wrong colorspace and range.
 

Tuna

Member
Is there any way to adjust the outputted YUV range and colorspace on the plugin? Much like on the built in OBS media source & OBS-NDI?

I have a hardware encoder that produces H265 SRT and RTSP feeds with the wrong colorspace and range.
Which one in particular? The code is a bit dated, but I think colro range and 601/709 is handled.

Edit: Oh, you mean the encoder does a wrong signalling? I guess you can insert a "capssetter" element in the pipeline and change the signalling to your liking.
 
Last edited:
Top