ofxGStreamer for RTSP - long delay and "sync-off"

Now that I have my multiple RTSP streams coming into OFX, i’m noticing that my video streams have very (10-15s) long delays. I’m tweaking the gstreamer pipeline to see if I can make it any better.

Here is my pipeline definition:

 gstPipeline = "rtspsrc location=rtsp:// latency=0 buffer-mode=auto ! rtph264depay ! h264parse ! avdec_h264 ! videoconvert ! videoscale ! video/x-raw,width=640,height=480"

I have experimented with the latency and buffer-mode options to no avail.

My questions are:

  1. Any recommendations about other ways to setup this pipeline?
  2. I see online that some recommend setting sync=false for the sink (so at the end of one’s gst-launch command’s pipeline definition; since the sink is not part of the pipeline definition in ofxGstreamer, can can I set sync=false?

Hi @batchku
I have not used GStreamer for streaming purposes, but if you have all the computers in a local network I would suggest you to use ofxNDI. It works really well with very little lag. NDI is now an industry standard for streaming digital video within local networks. It is really stable and reliable.

I’m aware of NDI and ofxNDI.
The challenge is that very few small form factor and robust (burning man ready) NDI cameras are available. Most run $2k+. As a low cost workaround, I have the NDI solution working well off a Raspberry Pi 3B+ and the stream reliability/latency/quality is indeed far superior.

The reason I want RTSP is that my ideal camera is a UniFi G4 Pro 4k camera which does stream over RTSP. The problem is that the latency is 10+ seconds and the stream get lost after some hours…

I think the latency in the go-pro is also heavy on its encode, on the camera. I have tried tested older models with RTSP and the latency was very high (8+ seconds) over wifi.

A USB camera attached to the raspeberry pi might be your best option for low latency and good quality.

Thanks @fresla.

I am using UnfFi G4 Pro camera not go pros. Im also using a wired gigabit Ethernet network not Wi-Fi.

A requirement is that the cameras be network cameras, so no USB.

The RPi solution works and is very low latency; it uses the RPi camera module, not USB.

The 10 sec latency doesn’t make sense in this configuration…