obs-gstreamer

obs-gstreamer 0.4.1

vodamerc

New Member
Ok, I am getting somewhere. The following pipeline works with gst-launch directly, but not in OBS. I just get no picture.

gst-launch-1.0 -v srtsrc uri="srt://xxxxxx.xxxxxxxx:8890?streamid=xxxxxx" ! decodebin name=bin ! capssetter caps="video/x-raw,format=NV12,colorimetry=bt709" ! queue ! autovideosink

The pipeline I'm using in OBS is:

srtsrc uri="srt://xxxxxx.xxxxxxxx:8890?streamid=xxxxxx" ! decodebin name=bin ! capssetter caps="video/x-raw,format=NV12,colorimetry=bt709" ! queue ! video.

Unfortunately doesnt work. However it works the moment I take out the capssetter.

Same issue with RTSP:

rtspsrc location=srt://xxxxxx.xxxxxxxx:8890?streamid=xxxxxx latency=200 ! queue ! rtph265depay ! h265parse ! d3d11h265dec ! capssetter caps="video/x-raw,format=NV12,colorimetry=bt709" ! video.
 

vodamerc

New Member
Disregard rtsp url being wrong above. That was me masking it for the forum incorrectly.

OBS log is showing: 15:53:59.823: [obs-gstreamer] GStreamer Source: Internal data stream error.

What I don't understand is why it works flawlessly via GST-Launch.
 

vodamerc

New Member
Sorry for the spam, but here's the GST Debug 3 output


Code:
0:06:25.029661000 30920 000001CB6E5DBF00 WARN                  srtsrc gstsrtsrc.c:227:gst_srt_src_fill:<srtsrc4> discont detected 1096517083 (expected: 0)
0:06:26.608852600 30920 000001CB6E5DB040 WARN           basetransform gstbasetransform.c:1373:gst_base_transform_setcaps:<video> transform could not transform video/x-raw(memory:D3D11Memory), format=(string)NV12, width=(int)3840, height=(int)2160, interlace-mode=(string)progressive, multiview-mode=(string)mono, multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono, pixel-aspect-ratio=(fraction)1/1, colorimetry=(string)bt709, framerate=(fraction)2997/100 in anything we support
0:06:26.608906000 30920 000001CB6E5DB040 WARN           basetransform gstbasetransform.c:1373:gst_base_transform_setcaps:<video> transform could not transform video/x-raw(memory:D3D11Memory), format=(string)NV12, width=(int)3840, height=(int)2160, interlace-mode=(string)progressive, multiview-mode=(string)mono, multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono, pixel-aspect-ratio=(fraction)1/1, colorimetry=(string)bt709, framerate=(fraction)2997/100 in anything we support
0:06:26.608922900 30920 000001CB6E5DB040 WARN                GST_PADS gstpad.c:4392:gst_pad_peer_query:<queue4:src> could not send sticky events
0:06:26.610052200 30920 000001CB6E5DB040 WARN           basetransform gstbasetransform.c:1373:gst_base_transform_setcaps:<video> transform could not transform video/x-raw(memory:D3D11Memory), format=(string)NV12, width=(int)3840, height=(int)2160, interlace-mode=(string)progressive, multiview-mode=(string)mono, multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono, pixel-aspect-ratio=(fraction)1/1, colorimetry=(string)bt709, framerate=(fraction)2997/100 in anything we support
0:06:26.610074900 30920 000001CB6E5DB040 WARN                GST_PADS gstpad.c:4392:gst_pad_peer_query:<queue4:src> could not send sticky events
0:06:26.634029600 30920 000001CB6E5DB040 WARN           basetransform gstbasetransform.c:1373:gst_base_transform_setcaps:<video> transform could not transform video/x-raw(memory:D3D11Memory), format=(string)NV12, width=(int)3840, height=(int)2160, interlace-mode=(string)progressive, multiview-mode=(string)mono, multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono, pixel-aspect-ratio=(fraction)1/1, colorimetry=(string)bt709, framerate=(fraction)2997/100 in anything we support
0:06:26.634084300 30920 000001CB6E5DB040 WARN           basetransform gstbasetransform.c:1373:gst_base_transform_setcaps:<video> transform could not transform video/x-raw(memory:D3D11Memory), format=(string)NV12, width=(int)3840, height=(int)2160, interlace-mode=(string)progressive, multiview-mode=(string)mono, multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono, pixel-aspect-ratio=(fraction)1/1, colorimetry=(string)bt709, framerate=(fraction)2997/100 in anything we support
0:06:26.634128600 30920 000001CB6E5DB040 WARN           basetransform gstbasetransform.c:1373:gst_base_transform_setcaps:<video> transform could not transform video/x-raw(memory:D3D11Memory), format=(string)NV12, width=(int)3840, height=(int)2160, interlace-mode=(string)progressive, multiview-mode=(string)mono, multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono, pixel-aspect-ratio=(fraction)1/1, colorimetry=(string)bt709, framerate=(fraction)2997/100 in anything we support
0:06:26.634166600 30920 000001CB6E5DB040 WARN           basetransform gstbasetransform.c:1373:gst_base_transform_setcaps:<video> transform could not transform video/x-raw(memory:D3D11Memory), format=(string)NV12, width=(int)3840, height=(int)2160, interlace-mode=(string)progressive, multiview-mode=(string)mono, multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono, pixel-aspect-ratio=(fraction)1/1, colorimetry=(string)bt709, framerate=(fraction)2997/100 in anything we support
0:06:26.634204200 30920 000001CB6E5DB040 WARN           basetransform gstbasetransform.c:1373:gst_base_transform_setcaps:<video> transform could not transform video/x-raw(memory:D3D11Memory), format=(string)NV12, width=(int)3840, height=(int)2160, interlace-mode=(string)progressive, multiview-mode=(string)mono, multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono, pixel-aspect-ratio=(fraction)1/1, colorimetry=(string)bt709, framerate=(fraction)2997/100 in anything we support
0:06:26.650749600 30920 000001CB6E5DBF00 WARN                 basesrc gstbasesrc.c:3177:gst_base_src_loop:<srtsrc4> error: Internal data stream error.
0:06:26.650784200 30920 000001CB6E5DBF00 WARN                 basesrc gstbasesrc.c:3177:gst_base_src_loop:<srtsrc4> error: streaming stopped, reason not-negotiated (-4)
 

vodamerc

New Member
I ended up solving this by adding the following before the capsetter.

Code:
 ! videorate ! video/x-raw !
 

LeeHockHin

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.
try this string

rtspsrc location=rtsp://username:password@10.10.10.100:554/Streaming/channels/101 latency=400 ! queue ! rtph265depay ! h265parse ! d3d11h265dec ! video.

where :554 is the standard RTSP port
and my CCTV camera stream is found under /Streaming/channels/101
 

vodamerc

New Member
Any chance of some explanation on the source options?

Specifically "Disable asynchronous state change in appsink"

Thanks
 

dbbrito

New Member
Friends, I'm sending SRT from the IRL Pro app on Android to OBS (windows) with the Pipeline:
srtclientsrc uri=srt://:8000 ! tsdemux ! h265parse ! avdec_h265 ! video.

The video arrives normally, but I'm sending from two phones, but it's not synchronized. Is there any information missing in the pipeline so that the two videos are synchronized?
Thanks
 

Tuna

Member
Friends, I'm sending SRT from the IRL Pro app on Android to OBS (windows) with the Pipeline:
srtclientsrc uri=srt://:8000 ! tsdemux ! h265parse ! avdec_h265 ! video.

The video arrives normally, but I'm sending from two phones, but it's not synchronized. Is there any information missing in the pipeline so that the two videos are synchronized?
Thanks
Pretty sure this would be a very difficult task.. probably not possible.

If at all, use one source, put both sources in that pipeline and use GStreamer's compositor and arrange both streams. Eventually it does some syncing with the correct options.
 
Last edited:

dbbrito

New Member
Hi people,
I am trying to use the gstreamer plugin (gstreamer-1.0-mingw-x86_64-1.22.1) in OBS and I am amazed. I have connected 3 android phone broacasting in srt with larix and they work flawlessly!! Perfect sync video and audio. I must give my congratulations to the authors.
My next step is to use the gstreamer to connect also my DSLR through UVC adapter (USB) connection. (720p/60 and audio). Can you suggest to me a pipeline for this purpose?
I have tried "gst-launch-1.0.exe -v ksvideosrc do-stats=TRUE ! videoconvert ! autovideosink" it opens the stream but in a separate window, not in OBS
Thanks in advance
Alex
Hello, how did you manage to do this synchronization? I've tried several ways, but I can't synchronize the 3 sources using Larix. Thank you.
 

AbbaTheHorse

New Member
Hi there

Firstly thank you for building and supporting this plugin, it's clear that it's bought a great deal of benefit to many people.

I've spent quite some time reading the posts of others, both here and across other platforms but have finally hit a blank and wondered if I might kinldy ask for help?

I have a Pi Zero 2W running GStreamer and have it streaming the onboard camera. The stream is being broadcast to a Windows PC on my network which I have also installed GStreamer on. I can view the Pi's video stream from the Windows PC using the following at the command prompt.

gst-launch-1.0 udpsrc port=5000 caps="application/x-rtp,media=video,encoding-name=H264,payload=96" ! rtph264depay ! decodebin ! videoconvert ! autovideosink

I can see the stream just fine, so I know both the PI and Windows PC are working correctly.

I have added the following to my PATH variable and have restarted the Windows PC

C:\gstreamer\1.0\msvc_x86_64\bin

I have then added the plugin obs-gstreamer.dll to

C:\Program Files\obs-studio\obs-plugins\64bit

When I launch OBS, I can't see GStreamer as an option under the source list. Looking at the OBS log file, I can see:

15:14:01.024: LoadLibrary failed for '../../obs-plugins/64bit/obs-gstreamer.dll': The specified module could not be found.

15:14:01.024: (126)

15:14:01.024: Module '../../obs-plugins/64bit/obs-gstreamer.dll' not loaded

Now, I know my path variable is correct (I've tested this from the command prompt in a different directory to GStreamer so I'm at a loss as to why the plugin hasn't loaded.

Is there something obvious I've missed?

Thank you to anyone who might be able to provide help.

Kind regards,

ATH
 

Tuna

Member
Hi there

Firstly thank you for building and supporting this plugin, it's clear that it's bought a great deal of benefit to many people.

I've spent quite some time reading the posts of others, both here and across other platforms but have finally hit a blank and wondered if I might kinldy ask for help?

I have a Pi Zero 2W running GStreamer and have it streaming the onboard camera. The stream is being broadcast to a Windows PC on my network which I have also installed GStreamer on. I can view the Pi's video stream from the Windows PC using the following at the command prompt.



I can see the stream just fine, so I know both the PI and Windows PC are working correctly.

I have added the following to my PATH variable and have restarted the Windows PC



I have then added the plugin obs-gstreamer.dll to



When I launch OBS, I can't see GStreamer as an option under the source list. Looking at the OBS log file, I can see:



Now, I know my path variable is correct (I've tested this from the command prompt in a different directory to GStreamer so I'm at a loss as to why the plugin hasn't loaded.

Is there something obvious I've missed?

Thank you to anyone who might be able to provide help.

Kind regards,

ATH

You probably missed that MinGW part:
Experimental prebuilt 64-bit Windows plugin is available. You still require the official GStreamer run-time (MinGW version) to be installed.
The prebuilt plugin is done with the MinGW SDK. If you wanted the MSVC one you would have to compile the plugin yourself with the MSVC SDK.
 

AbbaTheHorse

New Member
I apologise for needing to return and ask for more help, only I've hit another blocker having spent many hours reading docs and trying to debug things using ChatGPT.

In short, I am streaming from the PI using the following:

GST_DEBUG=2 gst-launch-1.0 libcamerasrc ! queue ! video/x-raw,width=800,height=600,framerate=30/1 ! videoconvert ! video/x-raw,format=I420 ! x264enc tune=zerolatency bitrate=500 speed-preset=superfast ! rtph264pay config-interval=1 pt=96 ! udpsink host=192.168.1.134 port=5000

I can view that from the Windows PC (192.168.1.134) on port 5000 in a command prompt using

gst-launch-1.0 udpsrc port=5000 caps="application/x-rtp,media=video,encoding-name=H264,payload=96" ! rtph264depay ! decodebin ! videoconvert ! autovideosink

I've closed the command prompt and the live view down and have added a GStreamer source into OBS on the Windows PC using many different pipelines, each created myself following the docs, or suggested by ChatGPT when trying to debug. The one I have currently is as follows (this doesn't appear to generate any errors in the OBS logs).

udpsrc port=5000 caps="application/x-rtp,media=video,encoding-name=H264,payload=96" ! rtph264depay ! h264parse ! avdec_h264 ! videoconvert ! video/x-raw,format=I420 ! appsink sync=false

In OBS, I can't see anything on the scene at all for the GStreamer plugin source, and I've tried to ensure that I've reset the scaling just incase the source was hidden somewhere (that said, when I select the source I can't see the red outline on the scene like I can for a couple of other sources I've added - such as a logo)

I've tried launching OBS from the command line using

set GST_DEBUG=4
"C:\Program Files\obs-studio\bin\64bit\obs64.exe"

And I've checked the current log for errors and can't see any GStreamer errors, with each source passing
09:50:31.131: Loaded scenes:

09:50:31.131: - scene 'Scene':

09:50:31.131: - source: 'BG colour' (color_source_v3)

09:50:31.131: - source: 'Side bar' (image_source)

09:50:31.131: - source: 'GStreamer Source' (gstreamer-source)

So I'm now a bit stuck :D

I did try capturing the output window that's launched by the command prompt and whilst this works in OBS, the source seems to freeze once I end the RDP session that I'm using to access the Windows PC.

Should anybody have any ideas, I'd be very grateful. Thank you once again,

ATH
 

Tuna

Member
Windows debbuging is always a pain.

However you did not read the README about what you have to do.
You are not supposed to add an appsink yourself, but instead connect your raw image to a named element called "video".
So replace the appsink with "video.". There are quite a few examples in that README.
 
Top