fzwoch / obs-gstreamer

GStreamer OBS Studio plugin
GNU General Public License v2.0
353 stars 34 forks source link

Gstreamer pipeline #107

Closed tsuna6 closed 1 year ago

tsuna6 commented 1 year ago

Hi, i just tried to put this string in gstreamer pipeline

gst-launch-1.0 rtspsrc location="rtsp://admin:*****@IPADDRESS:554" latency=10 ! rtph264depay ! h264parse ! omxh264dec ! autovideosink

i'm using hikvision camera, but it wont displayed in gstreamer. do you have some reference gstreamer pipeline that i can try to use it ?

Thanks

fzwoch commented 1 year ago

The README of the project list some RTSP examples. The used URLs may be down by now though.

One common caveat is that rtspsrc uses user-id and user-pw properties for authentication - That is because the URI itself may be important for the server to select a stream, so havem them in the URI scheme may break things.

Are you sure you have hardware that uses an OMX decoder?

tsuna6 commented 1 year ago

I'm just using :

just a simple connection. any idea ?

fzwoch commented 1 year ago

Use gst-launch-1.0 from a command line to test things. They may give some better idea what may be wrong.

But these are more setup or general GStreamer related things..

tsuna6 commented 1 year ago

you mean command prompt?

i text it, and the result is :

ERROR: pipeline could not be constructed: empty pipeline not allowed.

tsuna6 commented 1 year ago

also when i text gst-launch-1.0 --version in cmd, the result is

gst-launch-1.0 version 1.22.5 GStreamer 1.22.5 Unknown package origin

fzwoch commented 1 year ago

It feels like you want to read up on GStreamer and it pipelines. Without that knowledge you will go nowhere with this plugin. You should be able to create pipelines and playback the camera with the gst-launch-1.0 tool before you adapt the pipeline for this plugin to make it work with OBS.

tsuna6 commented 1 year ago

Hi, i try again with this code in cmd, and it works

gst-launch-1.0 rtspsrc location="rtsp://admin:*****@IPAddress:554" latency=10 ! rtph264depay ! h264parse ! decodebin ! autovideosink

but why when i try this on gstreamer OBS, it's not working ? please advice me about this. Thanks.

fzwoch commented 1 year ago

Replacing autovideosink with video. (note the dot) should do it.

kamalmostafa commented 1 year ago

Important note: Be sure that you are NOT including the "gst-launch-1.0" command itself in the obs-gstreamer plugin pipeline field -- that's just for command-line testing! But since you've got it working on the command line with gst-launch-1.0, it should certainly be possible to get it working within the obs-gstreamer plugin as well.

I have had great success using the obs-gstreamer plugin with my HikVision camera (including its audio feed) with the following pipeline:

rtspsrc latency=1600 location=rtsp://admin:*****@192.168.1.***/Streaming/Channels/101  name=bin
  bin. ! parsebin ! nvh264sldec ! videoconvert ! video.
  bin. ! parsebin ! decodebin ! audioconvert ! audio.

And a simpler ("video-only, no audio") version of my obs-gstreamer plugin pipeline might look like this:

rtspsrc latency=1600 location=rtsp://admin:*****@192.168.1.***/Streaming/Channels/101   ! parsebin ! nvh264sldec ! videoconvert ! video.

A similar pipeline to might work for you. (Be sure to notice the terminating "video." in both examples, just as was mentioned by @fzwoch).

Good luck!