obs-gstreamer

obs-gstreamer 0.4.0

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.
 
Top