obs-gstreamer

obs-gstreamer 0.3.2

Yeahish

New Member
rtspsrc location="rtsp://user:pass@192.168.1.64:554/Streaming/Channels/101?transportmode=unicast&profile=Profile_1" ! autovideoconvert ! video.
I understand that the above code is wrong by itself. But my question is still how can I see what Capabilities these sinks have?

On another note, how can I convert the following pipeline it should be compatible with the plugin?
playbin uri=rtsp://localhost:8554/test uridecodebin0::source::latency=300
 

Tuna

Member
It supports many formats. Check the code if you want more details. Also there is video converter element internally too.

Problem with that peipleine is that it does not have and depacketizers nor decoders. That's why the examples use uridecodebin. Else you will have to insert these elements yourself which requires also some knowledge about used formats in the stream.
 

seriousplay

New Member
Okay, I'm struggling to get it to fully work, streaming from a Raspberry Pi to Windows 10. I'm so very close, but can't quite get over the last hurdle.
On the Pi:
raspivid -t 0 -w 1280 -h 720 -rot 180 -fps 30 -b 1700000 -o - | gst-launch-1.0 -v fdsrc ! h264parse config-interval=1 ! rtph264pay ! udpsink host = <Win10-IP> port=5000
OBS:
udpsrc port=5000 ! application/x-rtp, payload=96 ! rtpjitterbuffer ! rtph264depay ! avdec_h264 ! fpsdisplaysink sync=false text-overlay=false ! video.

This doesn't produce anything as is, but if I strip out the "! video." part of it, it will pop up a Direct3D11 Renderer window with the video stream. So, clearly, the stream is working. It just isn't pulling it into OBS.
I've tried a few differing strings, as well, to no avail.
udpsrc port=5000 ! h264parse ! avdec_h264 ! video.
This will lock the stream, so I can't run gst-launch from the command line. I'm pretty new to gstreamer, so I'm just learning the different possibilities. I've seen several different conversations on the issue, with several different strings to enter, none of which worked for me.

Any tips, or full strings to put into OBS, would be extremely helpful. TIA.
 

STEPHANVS

Member
Okay, I'm struggling to get it to fully work, streaming from a Raspberry Pi to Windows 10. I'm so very close, but can't quite get over the last hurdle.
On the Pi:
raspivid -t 0 -w 1280 -h 720 -rot 180 -fps 30 -b 1700000 -o - | gst-launch-1.0 -v fdsrc ! h264parse config-interval=1 ! rtph264pay ! udpsink host = <Win10-IP> port=5000
OBS:
udpsrc port=5000 ! application/x-rtp, payload=96 ! rtpjitterbuffer ! rtph264depay ! avdec_h264 ! fpsdisplaysink sync=false text-overlay=false ! video.

This doesn't produce anything as is, but if I strip out the "! video." part of it, it will pop up a Direct3D11 Renderer window with the video stream. So, clearly, the stream is working. It just isn't pulling it into OBS.
I've tried a few differing strings, as well, to no avail.
udpsrc port=5000 ! h264parse ! avdec_h264 ! video.
This will lock the stream, so I can't run gst-launch from the command line. I'm pretty new to gstreamer, so I'm just learning the different possibilities. I've seen several different conversations on the issue, with several different strings to enter, none of which worked for me.

Any tips, or full strings to put into OBS, would be extremely helpful. TIA.
Maybe you need a queue?

I moved from uridecodebin to
Code:
rtspsrc location=url ! rtpjitterbuffer ! rtph264depay ! h264parse ! avdec_h264 ! queue ! video.
as I wanted to test rtpjitterbuffer.
 

seriousplay

New Member
Okay, I removed the fpsdisplaysink and the rtpjitterbuffer pieces of the OBS side:
udpsrc port=5000 ! application/x-rtp, payload=96 ! rtph264depay ! avdec_h264 ! video.

...and it WORKED!!! Whoop whoop! Thank you guys, so much. I've been trying to get this going for a week and I knew I was close, but it took you getting me over that last hurdle. Sweet! Thank you thank you. And thank you for making such an awesome plugin for gstreamer. I can't tell you how excited I am to start using it in my church service.
 

STEPHANVS

Member
Trying to extract soundful information out of an Allen & Heath SQ5 connected via USB. Of course OBS cannot interpret the signal coming from the board so at the moment we are using ASIO plugin, which I am trying to substitute with gstreamer. I was able to get it to monitor with:
Code:
directsoundsrc device="deviceid" ! audio.
but it did not register any sound when video was recorded.

I would like to connect via wasapisrc but this I cannot get it to work.

gst-device-monitor-1.0.exe gives:
Code:
Device found:

        name  : Line (SQ)
        class : Audio/Source
        caps  : audio/x-raw, format=F32LE, layout=interleaved, rate=48000, channels=32
        properties:
                device.api = wasapi
                device.strid = "\{0.0.1.00000000\}.\{26eacefd-7d3b-4c83-8aa9-4d43572937ae\}"
                wasapi.device.description = "Line\ \(SQ\)"
        gst-launch-1.0 wasapisrc device="\{0.0.1.00000000\}.\{26eacefd-7d3b-4c83-8aa9-4d43572937ae\}" ! ...
Do you have any idea how to capture channel 1 and 2?
 

Tuna

Member
Sound not in the recording is probably due to a bug with timestamps. You can tick "use pipeline timestamps" as a workaround. Or set the sound source to monitor.. can be another workaround.

No idea about wasapisrc source.
 
1. I guess there was a fix in my code that was not released yet. So you may want to try to build master by yourself, or wait as I may make another release soon (no schedule though) as v26 was recently released.

2. I cannot tell. There should not be a technical limitation to my knowledge to prevent this. Probably would require some debugging whats happening in this particular case.

ad 2. : Each stream needs some queue. Could it be that gstreamer supports no more than 5 queue's ? I read something like that in the multiqueue documentation, but not in the queue documentation. I will do some testing with queue2 as (extra) queue's.
 
So i did some additional testing. When I define 5 different streams within gstreamer, the 6th will not show up. After closing and restarting OBS, 5 of 6 streams show up, missing one at random. No matter if I use rtspsrc or uridecodebin, limit is 5 streams. Any ideas ? Thanks !
 

Tuna

Member
Screenshot from 2020-11-17 15-47-24.png


Took me a while to find an RTSP source on the internet. 6 streams don't seem to be a problem. Maybe it is a congestion problem with you network or something else limiting. I guess you will have to do some debugging why it fails.
 
Hello Tuna

Thanks for the prompt reply. Gstreamer in OBS gets increasingly popular, it fills up a gap... .

So I need to be more specific. i have 6 streams from 6 different camera’s.

A new scène with an existing 'working' stream works perfectly. I have 3 scenes with 1 same camera, no problem.

As long as i do not add the 6th camera. This last one will just not show up.

thanks !
 

Tuna

Member
As I said you need to debug a bit with the GST_DEBUG variable and examine the resulting logs. The example above makes 6 independen sources. They are not copied/reused, so logically they are 6 Independent ones, like your use case. Then again of course you haven't even posted a pipeline yet? Perhaps try rtspt:// as protocol - maybe your firewall's maximum port forwarding handles are exceeded. The reasons it may fail seem infinite..
 
Hello Tuna, so i did Some reading about gst_debug. But i am a bit confused.

Just add GST_DEBUG=2 at the beginning of the pipe line ? And where will the log show up? In the obs log ?

Sorry for asking but it really is a steep learning curve here ;-)
 
thanks Tuna !

one step further. I am running on win10. Found the following :

i have to set the following environment variables

set GST_DEBUG=5
set GST_DEBUG_FILE=c:\log\log.txt

directory c:\log exists and is writeable. But nothing shows up . No file at all.

Any hints ? Thnx again !
 
one step further.
- open the windows shell ( cmd.exe )
- make sure the folder "c:\log" exists and is writeable
- then type on the command prompt :

set GST_DEBUG=5
set GST_DEBUG_FILE=c:\log\log.txt

then

FROM THE SAME SHELL (this is important, because the environment variable just set, only exist here in this shell )

then

change path to folder where obs64.exe is found ( typical c:\program files\obs-studio\bin\64bit\ )

then

obs64 ENTER (start obs64.exe, from the command line)

OBS will start up and the logging starts flowing.

move on to the next level ;-)
 

GodFollower

New Member
Made an account just so I could chime in and say thanks a ton for the GStreamer plugin for OBS. Reduced our latency(both the consistent and the fluctuating) from our IP cams down to sub 100ms, much more manageable and easier to mix real-time.

Still tinkering with the jittering frames, but reading through this thread I have some ideas. It is not very noticeable, so we are functional as it stands. Just trying to fine tune it to get it as close to a full 30fps as possible.

Thanks again!
 
Made an account just so I could chime in and say thanks a ton for the GStreamer plugin for OBS. Reduced our latency(both the consistent and the fluctuating) from our IP cams down to sub 100ms, much more manageable and easier to mix real-time.

Still tinkering with the jittering frames, but reading through this thread I have some ideas. It is not very noticeable, so we are functional as it stands. Just trying to fine tune it to get it as close to a full 30fps as possible.

Thanks again!

Hello GodFollower, i am in the same fase as you describe. After adding 100ms latency and the rtpjitterbuffer and ticking ‘sync to source’ the slight stuttering disappears. At a price of a delay , now running on 750 ms audio delay.
 
Top