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
 
Top