Facing difficulties in starting webrtc stream

Hey community,
I have been using gstreamer for nvidia omniverse, which outputs the video from 9020 and audio from 9021 via udp. all the rendering is being done in remote server. so i wanted to start a webrtc stream from the udp source to port forward the stream from ssh to my local machine and view it my local browser.
so i have built the webrtc plugin in rust from source by following the official documentation.
but when i started the stream and tried opening the localhost:8080 in my browser, it didn’t connect. so after going over the docs, i found the default stream is available at 8443. so when i tried opening the same. i found some errors in the log.
command:

GST_DEBUG=2 gst-launch-1.0 -v udpsrc port=9020 caps="application/x-rtp" ! rtpjitterbuffer drop-on-latency=true latency=20 ! rtph264depay ! h264parse ! avdec_h264 ! videoconvert ! queue ! webrtcsink run-signalling-server=true run-web-server=true

here is the log of the command :

user@r770:~/sagi/gst-plugins-rs/net/webrtc$ GST_DEBUG=2 gst-launch-1.0 -v udpsrc port=9020 caps="application/x-rtp" ! rtpjitterbuffer dr
op-on-latency=true latency=20 ! rtph264depay ! h264parse ! avdec_h264 ! videoconvert ! queue ! webrtcsink run-signalling-server=true run-w
eb-server=true
Setting pipeline to PAUSED …
Pipeline is live and does not need PREROLL …
Pipeline is PREROLLED …
Setting pipeline to PLAYING …
/GstPipeline:pipeline0/GstUDPSrc:udpsrc0.GstPad:src: caps = application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264
/GstPipeline:pipeline0/GstRtpJitterBuffer:rtpjitterbuffer0.GstPad:sink: caps = application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264
New clock: GstSystemClock
/GstPipeline:pipeline0/GstRtpJitterBuffer:rtpjitterbuffer0.GstPad:src: caps = application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264
/GstPipeline:pipeline0/GstRtpH264Depay:rtph264depay0: extensions = < >
/GstPipeline:pipeline0/GstRtpH264Depay:rtph264depay0.GstPad:sink: caps = application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264
/GstPipeline:pipeline0/GstRtpH264Depay:rtph264depay0.GstPad:src: caps = video/x-h264, stream-format=(string)avc, alignment=(string)au, codec_data=(buffer)0142c029ffe100196742c029959005005bb016e0202034a000007d00003a98108001000468cb8f20, level=(string)4.1, profile=(string)constrained-baseline
Redistribute latency…
/GstPipeline:pipeline0/GstH264Parse:h264parse0.GstPad:src: caps = video/x-h264, stream-format=(string)avc, alignment=(string)au, codec_data=(buffer)0142c029ffe100196742c029959005005bb016e0202034a000007d00003a98108001000468cb8f20, level=(string)4.1, profile=(string)constrained-baseline, pixel-aspect-ratio=(fraction)1/1, width=(int)1280, height=(int)720, framerate=(fraction)60/1, coded-picture-structure=(string)frame, chroma-format=(string)4:2:0, bit-depth-luma=(uint)8, bit-depth-chroma=(uint)8, colorimetry=(string)1:3:5:1, parsed=(boolean)true
Redistribute latency…
/GstPipeline:pipeline0/avdec_h264:avdec_h264-0.GstPad:sink: caps = video/x-h264, stream-format=(string)avc, alignment=(string)au, codec_data=(buffer)0142c029ffe100196742c029959005005bb016e0202034a000007d00003a98108001000468cb8f20, level=(string)4.1, profile=(string)constrained-baseline, pixel-aspect-ratio=(fraction)1/1, width=(int)1280, height=(int)720, framerate=(fraction)60/1, coded-picture-structure=(string)frame, chroma-format=(string)4:2:0, bit-depth-luma=(uint)8, bit-depth-chroma=(uint)8, colorimetry=(string)1:3:5:1, parsed=(boolean)true
/GstPipeline:pipeline0/GstH264Parse:h264parse0.GstPad:sink: caps = video/x-h264, stream-format=(string)avc, alignment=(string)au, codec_data=(buffer)0142c029ffe100196742c029959005005bb016e0202034a000007d00003a98108001000468cb8f20, level=(string)4.1, profile=(string)constrained-baseline
Redistribute latency…
/GstPipeline:pipeline0/avdec_h264:avdec_h264-0.GstPad:src: caps = video/x-raw, format=(string)I420, width=(int)1280, height=(int)720, interlace-mode=(string)progressive, pixel-aspect-ratio=(fraction)1/1, chroma-site=(string)jpeg, colorimetry=(string)1:3:5:1, framerate=(fraction)60/1
/GstPipeline:pipeline0/GstVideoConvert:videoconvert0.GstPad:src: caps = video/x-raw, format=(string)I420, width=(int)1280, height=(int)720, interlace-mode=(string)progressive, pixel-aspect-ratio=(fraction)1/1, chroma-site=(string)jpeg, colorimetry=(string)1:3:5:1, framerate=(fraction)60/1
/GstPipeline:pipeline0/GstQueue:queue0.GstPad:sink: caps = video/x-raw, format=(string)I420, width=(int)1280, height=(int)720, interlace-mode=(string)progressive, pixel-aspect-ratio=(fraction)1/1, chroma-site=(string)jpeg, colorimetry=(string)1:3:5:1, framerate=(fraction)60/1
/GstPipeline:pipeline0/GstVideoConvert:videoconvert0.GstPad:sink: caps = video/x-raw, format=(string)I420, width=(int)1280, height=(int)720, interlace-mode=(string)progressive, pixel-aspect-ratio=(fraction)1/1, chroma-site=(string)jpeg, colorimetry=(string)1:3:5:1, framerate=(fraction)60/1
/GstPipeline:pipeline0/GstVideoConvert:videoconvert0.GstPad:sink: caps = video/x-raw, format=(string)I420, width=(int)1280, height=(int)720, interlace-mode=(string)progressive, pixel-aspect-ratio=(fraction)1/1, chroma-site=(string)jpeg, colorimetry=(string)1:3:5:1, framerate=(fraction)60/1
/GstPipeline:pipeline0/GstWebRTCSink:webrtcsink0.GstWebRTCSinkPad:video_0.GstProxyPad:proxypad0: caps = video/x-raw, format=(string)I420, width=(int)1280, height=(int)720, interlace-mode=(string)progressive, pixel-aspect-ratio=(fraction)1/1, chroma-site=(string)jpeg, colorimetry=(string)1:3:5:1, framerate=(fraction)60/1
/GstPipeline:pipeline0/GstWebRTCSink:webrtcsink0/GstClockSync:clocksync0.GstPad:src: caps = video/x-raw, format=(string)I420, width=(int)1280, height=(int)720, interlace-mode=(string)progressive, pixel-aspect-ratio=(fraction)1/1, chroma-site=(string)jpeg, colorimetry=(string)1:3:5:1, framerate=(fraction)60/1
/GstPipeline:pipeline0/GstWebRTCSink:webrtcsink0/GstAppSink:appsink0.GstPad:sink: caps = video/x-raw, format=(string)I420, width=(int)1280, height=(int)720, interlace-mode=(string)progressive, pixel-aspect-ratio=(fraction)1/1, chroma-site=(string)jpeg, colorimetry=(string)1:3:5:1, framerate=(fraction)60/1
/GstPipeline:pipeline0/GstWebRTCSink:webrtcsink0/GstClockSync:clocksync0.GstPad:sink: caps = video/x-raw, format=(string)I420, width=(int)1280, height=(int)720, interlace-mode=(string)progressive, pixel-aspect-ratio=(fraction)1/1, chroma-site=(string)jpeg, colorimetry=(string)1:3:5:1, framerate=(fraction)60/1
/GstPipeline:pipeline0/GstWebRTCSink:webrtcsink0.GstWebRTCSinkPad:video_0: caps = video/x-raw, format=(string)I420, width=(int)1280, height=(int)720, interlace-mode=(string)progressive, pixel-aspect-ratio=(fraction)1/1, chroma-site=(string)jpeg, colorimetry=(string)1:3:5:1, framerate=(fraction)60/1
Redistribute latency…
0:00:00.546315155 1043786 0x7d1398001770 WARN basesink gstbasesink.c:3805:gst_base_sink_chain_unlocked: warning: Internal data flow problem.
0:00:00.546336841 1043786 0x7d1398001770 WARN basesink gstbasesink.c:3805:gst_base_sink_chain_unlocked: warning: Received buffer without a new-segment. Assuming timestamps start from 0.
Got context from element ‘nvh264enc0’: gst.cuda.context=context, gst.cuda.context=(GstCudaContext)“(GstCudaContext)\ cudacontext2”, cuda-device-id=(uint)0;
error: XDG_RUNTIME_DIR is invalid or not set in the environment.
0:00:01.017260104 1043786 0x7d13a0c8e960 ERROR gldisplay gstgldisplay_gbm.c:219:gst_gl_display_gbm_setup_drm: No connected DRM connector found
0:00:01.017272251 1043786 0x7d13a0c8e960 WARN gldisplay gstgldisplay_gbm.c:453:gst_gl_display_gbm_new: Failed to initialize DRM
Got context from element ‘nvh264enc0’: gst.gl.GLDisplay=context, gst.gl.GLDisplay=(GstGLDisplay)“(GstGLDisplayGBM)\ gldisplaygbm0”;
0:00:01.055836460 1043786 0x7d130802e090 WARN basesink gstbasesink.c:3805:gst_base_sink_chain_unlocked: warning: Internal data flow problem.
0:00:01.055852890 1043786 0x7d130802e090 WARN basesink gstbasesink.c:3805:gst_base_sink_chain_unlocked: warning: Received buffer without a new-segment. Assuming timestamps start from 0.
0:00:01.111312915 1043786 0x7d1398001470 WARN vpxenc gstvpxenc.c:1863:gst_vpx_enc_set_format: “Failed to set VP8E_SET_NOISE_SENSITIVITY”: incapable (details: (NULL))
0:00:01.111435363 1043786 0x7d1398001470 WARN vpxenc gstvpxenc.c:1878:gst_vpx_enc_set_format: “Failed to set VP8E_SET_TOKEN_PARTIONS”: incapable (details: (NULL))
0:00:01.138318215 1043786 0x7d1398001470 WARN basesink gstbasesink.c:3805:gst_base_sink_chain_unlocked: warning: Internal data flow problem.
0:00:01.138334348 1043786 0x7d1398001470 WARN basesink gstbasesink.c:3805:gst_base_sink_chain_unlocked: warning: Received buffer without a new-segment. Assuming timestamps start from 0.
0:00:01.140871159 1043786 0x7d12f8003e20 WARN basesink gstbasesink.c:3805:gst_base_sink_chain_unlocked: warning: Internal data flow problem.
0:00:01.140886837 1043786 0x7d12f8003e20 WARN basesink gstbasesink.c:3805:gst_base_sink_chain_unlocked: warning: Received buffer without a new-segment. Assuming timestamps start from 0.
0:00:01.153359393 1043786 0x7d1398002520 ERROR av1enc gstav1enc.c:542:gst_av1_codec_error: Failed to initialize encoder: Invalid parameter g_threads out of range [..MAX_NUM_THREADS]
0:00:01.153382994 1043786 0x7d1398002520 WARN videoencoder gstvideoencoder.c:773:gst_video_encoder_setcaps: rejected caps video/x-raw, format=(string)I420, width=(int)1280, height=(int)720, interlace-mode=(string)progressive, pixel-aspect-ratio=(fraction)1/1, chroma-site=(string)jpeg, colorimetry=(string)1:3:5:1, framerate=(fraction)60/1
0:00:01.153463817 1043786 0x7d1398002520 ERROR av1enc gstav1enc.c:542:gst_av1_codec_error: Failed to initialize encoder: Invalid parameter g_threads out of range [..MAX_NUM_THREADS]
0:00:01.153471097 1043786 0x7d1398002520 WARN videoencoder gstvideoencoder.c:773:gst_video_encoder_setcaps: rejected caps video/x-raw, format=(string)I420, width=(int)1280, height=(int)720, interlace-mode=(string)progressive, pixel-aspect-ratio=(fraction)1/1, chroma-site=(string)jpeg, colorimetry=(string)1:3:5:1, framerate=(fraction)60/1
0:00:01.153536334 1043786 0x7d1398002520 ERROR av1enc gstav1enc.c:542:gst_av1_codec_error: Failed to initialize encoder: Invalid parameter g_threads out of range [..MAX_NUM_THREADS]
0:00:01.153543039 1043786 0x7d1398002520 WARN videoencoder gstvideoencoder.c:773:gst_video_encoder_setcaps: rejected caps video/x-raw, format=(string)I420, width=(int)1280, height=(int)720, interlace-mode=(string)progressive, pixel-aspect-ratio=(fraction)1/1, chroma-site=(string)jpeg, colorimetry=(string)1:3:5:1, framerate=(fraction)60/1
0:00:01.153555067 1043786 0x7d1398002520 WARN basesrc gstbasesrc.c:3177:gst_base_src_loop: error: Internal data stream error.
0:00:01.153559819 1043786 0x7d1398002520 WARN basesrc gstbasesrc.c:3177:gst_base_src_loop: error: streaming stopped, reason not-negotiated (-4)
0:00:01.153614591 1043786 0x7d1398002520 ERROR av1enc gstav1enc.c:542:gst_av1_codec_error: Failed to initialize encoder: Invalid parameter g_threads out of range [..MAX_NUM_THREADS]
0:00:01.153621617 1043786 0x7d1398002520 WARN videoencoder gstvideoencoder.c:773:gst_video_encoder_setcaps: rejected caps video/x-raw, format=(string)I420, width=(int)1280, height=(int)720, interlace-mode=(string)progressive, pixel-aspect-ratio=(fraction)1/1, chroma-site=(string)jpeg, colorimetry=(string)1:3:5:1, framerate=(fraction)60/1
0:00:01.153667470 1043786 0x7d1398002520 ERROR av1enc gstav1enc.c:542:gst_av1_codec_error: Failed to initialize encoder: Invalid parameter g_threads out of range [..MAX_NUM_THREADS]
0:00:01.153674740 1043786 0x7d1398002520 WARN videoencoder gstvideoencoder.c:773:gst_video_encoder_setcaps: rejected caps video/x-raw, format=(string)I420, width=(int)1280, height=(int)720, interlace-mode=(string)progressive, pixel-aspect-ratio=(fraction)1/1, chroma-site=(string)jpeg, colorimetry=(string)1:3:5:1, framerate=(fraction)60/1
0:00:01.153717155 1043786 0x7d1398002520 ERROR av1enc gstav1enc.c:542:gst_av1_codec_error: Failed to initialize encoder: Invalid parameter g_threads out of range [..MAX_NUM_THREADS]
0:00:01.153723691 1043786 0x7d1398002520 WARN videoencoder gstvideoencoder.c:773:gst_video_encoder_setcaps: rejected caps video/x-raw, format=(string)I420, width=(int)1280, height=(int)720, interlace-mode=(string)progressive, pixel-aspect-ratio=(fraction)1/1, chroma-site=(string)jpeg, colorimetry=(string)1:3:5:1, framerate=(fraction)60/1
0:00:01.153733639 1043786 0x7d1398002520 ERROR av1enc gstav1enc.c:542:gst_av1_codec_error: Failed to encode frame: Unspecified internal error g_threads out of range [..MAX_NUM_THREADS]
0:00:01.179393811 1043786 0x7d13a0c8e960 WARN webrtcsink net/webrtc/src/webrtcsink/imp.rs:3951:gstrswebrtc::webrtcsink::imp::BaseWebRTCSink::run_discovery_pipeline::{{closure}}: Error in discovery pipeline: Error {
structure: Some(
GstMessageError {
gerror: (GError) ((GError*) 0x7d12f0003140),
debug: (gchararray) “../libs/gst/base/gstbasesrc.c(3177): gst_base_src_loop (): /GstPipeline:pipeline5/GstAppSrc:appsrc4:\nstreaming stopped, reason not-negotiated (-4)”,
details: Structure(
details {
flow-return: (gint) -4,
},
),
},
),
source: Some(
(
Object {
inner: TypedObjectRef {
inner: 0x00007d13a0cc9840,
type: GstAppSrc,
},
},
“appsrc4”,
),
),
error: Error {
domain: gst-stream-error-quark,
code: 1,
message: “Internal data stream error.”,
},
debug: Some(
“../libs/gst/base/gstbasesrc.c(3177): gst_base_src_loop (): /GstPipeline:pipeline5/GstAppSrc:appsrc4:\nstreaming stopped, reason not-negotiated (-4)”,
),
details: Some(
details {
flow-return: (gint) -4,
},
),
}
0:00:01.179774888 1043786 0x7d13a0c8e960 WARN webrtcsink net/webrtc/src/webrtcsink/imp.rs:4087:gstrswebrtc::webrtcsink::imp::BaseWebRTCSink::lookup_caps::{{closure}}: Codec discovery pipeline failed: Internal data stream error.
2025-04-21T16:53:18.618768Z INFO ThreadId(01) gst_plugin_webrtc_signalling::server: New WebSocket connection this_id=4608e62b-da70-421b-bdc2-6224722bde95
2025-04-21T16:53:18.618993Z INFO ThreadId(01) gst_plugin_webrtc_signalling::server: Received message Ok(Text(Utf8Bytes(b"{"type":"list"}“)))
2025-04-21T16:53:18.619038Z INFO ThreadId(01) gst_plugin_webrtc_signalling::server: Received message Ok(Text(Utf8Bytes(b”{"type":"setPeerStatus","roles":["producer"],"meta":null,"peerId":"4608e62b-da70-421b-bdc2-6224722bde95"}“)))
2025-04-21T16:53:18.619063Z INFO ThreadId(01) gst_plugin_webrtc_signalling::handlers: registered as a producer peer_id=4608e62b-da70-421b-bdc2-6224722bde95
2025-04-21T16:53:48.620270Z INFO ThreadId(01) gst_plugin_webrtc_signalling::server: Received message Ok(Pong(b”“))
2025-04-21T16:54:18.622104Z INFO ThreadId(01) gst_plugin_webrtc_signalling::server: Received message Ok(Pong(b”“))
2025-04-21T16:54:23.639831Z WARN ThreadId(01) gst_plugin_webrtc_signalling::server: Error during the websocket handshake: WebSocket protocol error: No “Connection: upgrade” header
2025-04-21T16:54:24.959097Z WARN ThreadId(01) gst_plugin_webrtc_signalling::server: Error during the websocket handshake: WebSocket protocol error: No “Connection: upgrade” header
2025-04-21T16:54:25.285595Z WARN ThreadId(01) gst_plugin_webrtc_signalling::server: Error during the websocket handshake: WebSocket protocol error: No “Connection: upgrade” header
2025-04-21T16:54:26.750519Z WARN ThreadId(01) gst_plugin_webrtc_signalling::server: Error during the websocket handshake: WebSocket protocol error: No “Connection: upgrade” header
2025-04-21T16:54:32.066121Z WARN ThreadId(01) gst_plugin_webrtc_signalling::server: Error during the websocket handshake: WebSocket protocol error: No “Connection: upgrade” header
2025-04-21T16:54:33.253486Z WARN ThreadId(01) gst_plugin_webrtc_signalling::server: Error during the websocket handshake: WebSocket protocol error: No “Connection: upgrade” header
2025-04-21T16:54:48.623626Z INFO ThreadId(01) gst_plugin_webrtc_signalling::server: Received message Ok(Pong(b”“))
2025-04-21T16:55:04.766036Z WARN ThreadId(01) gst_plugin_webrtc_signalling::server: Error during the websocket handshake: WebSocket protocol error: No “Connection: upgrade” header
2025-04-21T16:55:18.624187Z INFO ThreadId(01) gst_plugin_webrtc_signalling::server: Received message Ok(Pong(b”“))
2025-04-21T16:55:48.629534Z INFO ThreadId(01) gst_plugin_webrtc_signalling::server: Received message Ok(Pong(b”“))
2025-04-21T16:56:06.426701Z WARN ThreadId(01) gst_plugin_webrtc_signalling::server: Error during the websocket handshake: WebSocket protocol error: No “Connection: upgrade” header
gst_plugin_webrtc_signalling::server: Received message Ok(Pong(b”"))
2025-04-21T16:59:48.637993Z INFO ThreadId(01) gst_plugin_webrtc_signalling::server: Error during the websocket handshake: WebSocket protocol error: No “Connection: upgrade” header