I'm trying to forward an RTSP stream to a web browser using WebRTC with GStreamer. It's mostly working, but I'm having a couple hiccups. The video stream has a clock on it so it's easy to see these issues:
I have viewed the RTSP stream directly in VLC and it plays perfectly, so I don't think there's an issue with the stream itself.
Here are a couple of pipelines I've been playing around with:
rtspsrc location=<rtspurl> is-live=true ! rtpjitterbuffer ! queue ! rtph264depay !
rtph264pay aggregate-mode=zero-latency config-interval=1 !
webrtcbin turn-server=<turnurl> bundle-policy=max-bundle name=webrtcbin
rtspsrc location=<rtspurl> is-live=true ! rtpjitterbuffer mode=0 ! queue ! parsebin !
rtph264pay aggregate-mode=zero-latency config-interval=-1 timestamp-offset=0 ! queue !
webrtcbin turn-server=<turnurl> bundle-policy=max-bundle name=webrtcbin
I've also tried just watching the stream with gstreamer. For instance:
gst-launch-1.0 rtspsrc location=<rtspurl> ! decodebin ! autovideosink
This does a lot better than the WebRTC pipelines. It still freezes, but not nearly as much. And I haven't noticed it showing an earlier video frame.
I've looked at all the example pipelines I can find as well as the different options for the elements in my pipelines, but I can't find anything that makes this better. Is there something I can try adding to my pipeline to take care of the issues?
you have to check network buffer size and network queue size, lower the buffer size if network speed is slow. One more thing is these players caches the small content to storage to ensure the continued playback without interruption, altering cache size can also help you.