Hello,
I’m encountering a problem with high latency (approximately 700 ms) when transmitting a video stream through a GStreamer pipeline that uses udpsrc, tsdemux, h264parse and webrtcsink. The stream is in MPEG-TS format and does not include an audio track. Using the following pipeline results in about 700 ms latency:
gst-launch-1.0 udpsrc address=224.0.0.1 port=3000 ! tsdemux latency=0 ! video/x-h264 ! h264parse config-interval=-1 ! avdec_h264 ! x264enc tune=zerolatency ! queue ! webrtcsink run-signalling-server=true
I also tried splitting the pipeline into two parts and relaying the stream through a local UDP port, which effectively eliminates the latency:
gst-launch-1.0 udpsrc address=224.0.0.1 port=3001 ! queue ! tsdemux ! h264parse ! rtph264pay ! udpsink host=127.0.0.1 port=3003 sync=false
gst-launch-1.0 udpsrc port=3003 caps="application/x-rtp, encoding-name=H264, clock-rate=90000, payload=96" ! rtph264depay ! avdec_h264 ! x264enc tune=zerolatency ! webrtcsink run-signalling-server=true
However, I prefer not to use two separate pipelines with an extra UDP relay as it feels like a workaround. Adjusting buffer parameters for queue and udpsrc doesn’t affect the overall latency in the single pipeline.
What could be the reason for the inherent latency in the single pipeline, given that latency parameters on tsdemux settings are set to 0?
Thank you for your help!