obs-gstreamer

obs-gstreamer 0.4.1

bobbytj

New Member
Has the GStreamer runtime "bin" directory added to the Windows PATH variable? E.g. can you run `gst-inspect-1.0` from any directory?
Yes - Gstreamer bin is in the system PATH and all contained binaries can be run from any “place” from within the cmd shell. Any ideas what could be the issue?
 

Shween

New Member
Hello Everybody.

Hope all is well!

I am not new to OBS, and I am definitely not a complete novice when it comes to "complex" features, but this Gstreamer protocol has my mind and soul completely destroyed.

I was sent here because I heard this was the end-all to get the lowest latency RTSP Signal from an IP Security Camera or the like.

I literally know nothing about this protocol, or how "pipelines" are supposed to be compiled or tested, and I cannot find any documentation on it that I can actually understand.

All I want to do is use this IP camera and get the best possible latency.

I have tried almost every pipline combination could find in this, and select few other forums.

I also use a Dahua Variant camera, with the rtsp link of: rtsp://admin:<password>@<ipaddress>:554/cam/realmonitor?channel=1&subtype=0

I just see a black screen, and have no idea to know where it is breaking!

It seems I have installed the Runtime correctly for the plugin shows in OBS, and although I still know nothing on how that technically works, apparently the 1 YouTube Video I followed at least got me to that point. ->This Video Here<-

May an angel please help save my soul! I am officially stumped.

xD Thank you all.
 

Tuna

Member
You don't write anything about what you are actually doing. The README of the plugin's project even has an example for RTSP cameras. This plugin is not fire and forget. For the correct results you will need to dive into the GStreamer documentation and the features of the elements you are going to use sooner or later. Especially when it comes to "minimal latency" and what impact it has on potential jitter etc pp.
 

Shween

New Member
Tuna Thank you for your reply!
In full Honesty, I had been up many hours straight just copying and pasting and modifying the code that I found on the plugin page, within this forum, and a few other forums as well.

Gonna be doing some heavy research tonight. I am seeing that people are getting good results. I am quite interested in this concept.

I hope to maintain etiquette here, I beg mercy!

As I try to understand this framework, I will try and document my findings as well.

And a Bump for Love!

Cheers!
 

Shween

New Member
Okay So As much as I have dug around. I am going to start from my starting point.

This is my current OBS Pipeline String template taken Straight from ReadMe.md
Code:
rtspsrc location=rtspt://admin:Look@Me!@192.168.1.108:554/cam/realmonitor?channel=1&subtype=0 name=bin ! queue ! rtph265depay ! nvdec ! gldownload ! watchdog timeout=10000 ! video. bin. ! queue ! rtpmpadepay ! mpegaudioparse ! mpg123audiodec ! audio.


This My cameras Source RTSP ID [Dahua RTSP]:
Code:
rtsp:// [USER] : [PASS] @ [ADDRESS] : [RTSP PORT] /cam/realmonitor?channel= [CH] &subtype=[STREAM TYPE]


RTSP URL that works in MediaSource and VLC Source
Code:
rtsp://admin:Look@Me!@192.168.1.108:554/cam/realmonitor?channel=1&subtype=0


Also attached as an image are my IP cameras output settings.

CamSetting.PNG




And Port Settings

Cam2.PNG


I am able to view the RTSP stream link Thru VLC and Mediasource just fine (with wild latency of course).

I am also able to input all of the other ReadMe.md examples into the pipeline string entry, and they all work!

I am getting absolute no video feed from. What could I try?
 

Shween

New Member
Again Not to Spam: But I installed Gstreamer in Windows 10 according to This Demonstration <-Video Link

Also Another update: Does this error mean anything to you?
Code:
ERROR: from element /GstPipeline:pipeline0/GstURIDecodeBin:uridecodebin0/GstRTSPSrc:source: Unauthorized



This is the current pipeline:
Code:
uridecodebin uri=rtsp://admin:Look@Me!@192.168.1.108:554/cam/realmonitor?channel=1&subtype=0 name=bin ! queue ! video.



Full Debug String
Code:
C:\Users\OMW>gst-launch-1.0 uridecodebin uri=rtsp://admin:Look@Me!@192.168.1.108:554/cam/realmonitor?channel=1&subtype=0 name=bin ! queue ! video.
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Progress: (open) Opening Stream
Pipeline is PREROLLED ...
Prerolled, waiting for progress to finish...
Progress: (connect) Connecting to rtsp://admin:Look@Me!@192.168.1.108:554/cam/realmonitor?channel=1
Progress: (open) Retrieving server options
ERROR: from element /GstPipeline:pipeline0/GstURIDecodeBin:uridecodebin0/GstRTSPSrc:source: Unauthorized
Additional debug info:
../gst/rtsp/gstrtspsrc.c(6658): gst_rtspsrc_send (): /GstPipeline:pipeline0/GstURIDecodeBin:uridecodebin0/GstRTSPSrc:source:
Unauthorized (401)
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
Freeing pipeline ...
'subtype' is not recognized as an internal or external command,
operable program or batch file.
 

Shween

New Member
Haha again not to Spam, I thought it was Dahua, but the Camera is an Amcrest IP Security Camera?

Is it possible it is not compatible?
 

Shween

New Member
GAHHH Now I think I really broke something.....

This is the latest in errors:
ERROR: pipeline could not be constructed: no element "C:".

I accidentally click on a default application after I ran a command at one point. And now it seems Gstreamer cannot initialize in Command Line.

I have reinstalled Gstreamer as well.

Oh Man..... Should I quit now?
 

Shween

New Member
Goodness Me...... So I have figured out a 'Workaround'

it seems i must now put ".exe" after the launch command

so instead of:
gst-launch-1.0

I use:
gst-launch-1.0.exe

and it begins to 'work' again

now this is my error string:
Code:
gst-launch-1.0.exe uridecodebin uri=rtsp://admin:Look@Me!@192.168.1.108:554/cam/realmonitor?channel=1&subtype=0 name=bin ! queue ! video.
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Progress: (open) Opening Stream
Pipeline is PREROLLED ...
Prerolled, waiting for progress to finish...
Progress: (connect) Connecting to rtsp://admin:Look@Me!@192.168.1.108:554/cam/realmonitor?channel=1
Progress: (open) Retrieving server options
ERROR: from element /GstPipeline:pipeline0/GstURIDecodeBin:uridecodebin0/GstRTSPSrc:source: Unauthorized
Additional debug info:
../gst/rtsp/gstrtspsrc.c(6658): gst_rtspsrc_send (): /GstPipeline:pipeline0/GstURIDecodeBin:uridecodebin0/GstRTSPSrc:source:
Unauthorized (401)
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
Freeing pipeline ...
'subtype' is not recognized as an internal or external command,
operable program or batch file.

sorry for all the 'updates'

im really pulling my hair out here. One issue has created many. I hope this is all still able to be interpreted :-/
 

Shween

New Member
Whoa Whoa Whao Okay Guys. Hold the Phone:

Could this be a bug or omission of feature in Gstreamer???

This rtsp link cannot be parsed it seems due to the Ampersand "&" in the URL

Supposedly, %26 should do the trick officially.

Check out this Image from another Forum
Bug..PNG


Perhaps as a "Security Camera" this Rtsp link containing an '&' is made to avoid possible exploits?
Confirm?
Deny?
Paradox?
 

Shween

New Member
I also have a dahua camera with similar issues. I cannot get the rtspsrc pipeline working. If I use the following pipeline in the gstreamer plugin, it works:
uridecodebin uri=rtspt://admin:<password>@<ipaddress>/cam/realmonitor?channel=1&subtype=0 name=bin ! queue ! video.

The following pipeline does not work:
rtspsrc location=rtspt://admin:<password>@<ipaddress>/cam/realmonitor?channel=1&subtype=0 latency=100 ! rtph264depay ! h264parse ! nvh264dec ! videoconvert ! video.

If I use gst-launch-1.0 command line tool with both pipelines, BOTH fail with the same messages.

I'm pretty sure it is the & (ampersand) which causes the issue, but I've tried to escape it in all possible ways and combinations I could find on the net, all without success. I've tried single- and double quotes around rtspt://admin:<password>@<ipaddress>/cam/realmonitor?channel=1&subtype=0
I've tried %26, "%26", '%26', \&, ^& "&", '&', "\&", '\&', "^&", '^&', &&, '&&', "&&", \&& and various combinations thereof including single- and double quotes around rtspt://admin:<password>@<ipaddress>/cam/realmonitor?channel=1&subtype=0
I just always get either one of the following 2 "error messages" reported by gst-launch-1.0

Message 1:
WARNING: erroneous pipeline: No sink-element named "(NULL)" - omitting link

Message 2:
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Progress: (open) Opening Stream
Pipeline is PREROLLED ...
Prerolled, waiting for progress to finish...
Progress: (connect) Connecting to rtspt://admin:<password>@<ipaddress>/cam/realmonitor?channel=1
Progress: (open) Retrieving server options
Progress: (open) Retrieving media info
ERROR: from element /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0: Not found
Additional debug info:
../gst/rtsp/gstrtspsrc.c(6621): gst_rtspsrc_send (): /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0:
Not Found (404)
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
Freeing pipeline ...
'"subtype=0"' is not recognized as an internal or external command,
operable program or batch file.


Any suggestions?
Thank you


Hey @superdiy, I'm hoping finding the solution to this will begin to fix many problems!
 

Shween

New Member
[SOLVED?]

Happy New Year All!

First, after a few days of absolute mind racking, I need to say, You all here are an endlessly brilliant group!

So, after futting around trying to mess with a camera on my laptop to test compatibility, I decided to just move onto the main rig.

Installed GStreamer, and set up the Environment Paths as Previous.

Installed OBS Plugin dll.

Hey @superdiy;
And for the Dahua Cams, I picked it up after re-re-re-re-re-re-reading This Post by @camfix HERE to use **+** in the place of an ampersand"&" in my pipeline.

It Worked!

Then I tried it with the Ampersand again.....

IT WORKED!?

This is now my code:
Code:
rtspsrc location=rtspt://admin:password@192.168.1.107:554/cam/realmonitor?channel=1&subtype=0 latency=0 ! rtpjitterbuffer latency=10 ! rtph264depay ! h264parse ! nvh264dec ! queue ! video.

Like I said, this is working remarkably well!

I am not exactly sure what this pipeline is commanding other than a basic understanding, so i was wondering if someone might be so kind as to explain the flow of this pipeline (I will also be referencing the API)

Also, what other parameters could I add to this pipeline to make it more efficient, and also bring in the audio from the camera source.

You are a remarkably brilliant group of people, and a wicked shout-out to @Tuna for this plugin.

This is truly a revolutionary advancement for the platform. Nothing but praise!

I would be interested to know what you make of this? o.O
 

Tuna

Member
Happy New Year. Sounds plausible you had to escape the ampersand somehow.

For specific options you should refer to the GStreamer documentation. Alternatively you can check available options for each element with the gst-inspect tool - e.g. "gst-inspect-1.0 rtspsrc".

Iirc the rtspsrc already has a jitterbuffer internally, so may not reuire an additional one.

For adding the audio I recommend looking at the examples again and read https://gstreamer.freedesktop.org/d...aunch.html?gi-language=c#pipeline-description - then you hopefully have an idea what these pipeline desciptions do and how to craft them. It it basically connecting another path fropm the rtspsrc to the the audio destination.
 

superdiy

New Member
Hey @superdiy;
And for the Dahua Cams, I picked it up after re-re-re-re-re-re-reading This Post by @camfix HERE to use **+** in the place of an ampersand"&" in my pipeline.

It Worked!

Then I tried it with the Ampersand again.....

IT WORKED!?

Thank you @Shween

I've managed to get the "gst-launch-1.0" command to work by using the "**+**" instead of the "&" in the pipelines. Somebody also said in another thread that "video." should be replaced by "fakevideosink" (without the "." at the end) when the pipeline is used with "gst-launch-1.0".

Seems like the "&" does not have to be replaced in the pipeline in @Tuna's gstreamer plugin in OBS though - pipelines work successfully with "&" in gstreamer plugin in OBS.

I finally managed to get my "rtspsrc " pipelines working in OBS after replacing "nvh264dec" with "avdec_h264" - I know too little to know why.

I've also tried "d3d11h264dec" as a decoder, but without any luck - what still boggles my mind is that:
  1. d3d11h264dec - works with gst-launch-1.0, but does not work with the gstreamer plugin in OBS
  2. nvh264dec - neither works with gst-launch-1.0 nor with the gstreamer plugin in OBS
I also thought that if something works successfully with gst-launch-1.0, it will work in OBS, but that seems to be a flawed assumption.

Finally all of the following pipelines work on my setup:
  • uridecodebin uri=rtspt://<user>:<password>@192.168.0.108/cam/realmonitor?channel=1&subtype=0 name=bin ! queue ! video.
  • rtspsrc location=rtspt://<user>:<password>@192.168.0.108/cam/realmonitor?channel=1&subtype=0 latency=100 ! rtph264depay ! h264parse ! avdec_h264 ! videoconvert ! video.
  • rtspsrc location=rtspt://<user>:<password>@192.168.0.108/cam/realmonitor?channel=1&subtype=0 latency=0 ! rtpjitterbuffer latency=10 ! rtph264depay ! h264parse ! avdec_h264 ! videoconvert ! video.
BUT, I also found that if you want any latency option to have an effect (on video), you have to ensure that "Sync to clock (video)" is checked, otherwise the latency values are ignored - don't know if somebody else can confirm this perhaps?

Thank you for all the help up until now.
 

adamchapin

New Member
Hi, wondering if there is a zero latency version of the uridecodebin like there is for the rtspsrc? I tried putting in latency=0 and it didn't work. Examples below.

uridecodebin uri="rtsp://USER:PASS@IP_ADDRESS/cam/realmonitor?channel=4&subtype=0&unicast=true&proto=Onvif" ! queue ! video.

rtspsrc location="rtsp://USER:PASS@IP_ADDRESS/cam/realmonitor?channel=4&subtype=0&unicast=true&proto=Onvif" latency=0 buffer-mode=auto ! rtph264depay ! h264parse ! d3d11h264dec ! video.

Thanks
 
I'm having issues running frei0r plugins on Windows. GStreamer itself works fine - I have it in my PATH, it runs, I'm able to construct pipelines and they are working as intended etc. But when trying to use frei0r-filter-hqdn3d anywhere in the pipeline, I get this error in the log:
Cannot start GStreamer: no element "frei0r-filter-hqdn3d"

So clearly gstreamer doesn't seem to see this filter, although the libgstfrei0r.dll is properly installed along with everything else, and physically present in my c:\gstreamer\1.0\mingw_x86_64\lib\gstreamer-1.0\. I'm also 100% sure the rest of gstreamer is running absolutely fine, only frei0r plugins aren't working.

Reading this page and this one, I only have two ideas:
  • I have the MinGW x86-64 version (as required by obs-gstreamer) and installation instructions are specific to the paths from the MSVC one. I've tried different environment variables mentioned in the manual to point gstreamer to the plugins directory just in case some paths are hardcoded, all to no avail.
  • frei0r filters are part of GStreamer's plugins-bad set. Could it be they have some dependencies on Windows that aren't mentioned in the manual? Maybe something related to MinGW in particular?
Any other ideas?
 

TVEngineer

New Member
I am using a PTZoptics camera in RTSP mode using the example pipeline for video all works as expected. The camera also has audio input to the camera that is muxd into the rtsp stream as AAC at 128kbps. I need an audio pipeline that will work with the example video pipeline for this AAC audio stream. Any usable combination that actually works would be greatly appreciated.
 

Tuna

Member
I am using a PTZoptics camera in RTSP mode using the example pipeline for video all works as expected. The camera also has audio input to the camera that is muxd into the rtsp stream as AAC at 128kbps. I need an audio pipeline that will work with the example video pipeline for this AAC audio stream. Any usable combination that actually works would be greatly appreciated.
The README has examples that decodes audio and video, no?
 

TVEngineer

New Member
using decodebin to try to find the correct pipeline.
gst-launch-1.0 rtspsrc location=rtsp://192.168.111.16:554/1 latency=0 name=src src. ! decodebin ! videoconvert ! autovideosink src. ! decodebin ! audioconvert ! autoaudiosink
says Missing element: MPEG-4 AAC decoder
Failed to load plugin 'C:\gstreamer\1.0\mingw_x86_64\lib\gstreamer-1.0\libgstassrender.dll'
Failed to load plugin 'C:\gstreamer\1.0\mingw_x86_64\lib\gstreamer-1.0\libgstwavpack.dll'

gst-launch-1.0 rtspsrc location=rtsp://192.168.111.16:554/1 latency=0 name=src src. ! decodebin ! videoconvert ! autovideosink
works fine for the video
Internet searches show that many others have had difficulty trying to find a working MPEG-4 AAC decoder.
Any suggestions how to correct the gstreamer installation or the pipeline? or does gstreamer not support AAC audio?
 
Top