meetecho / simple-whep-client

Simple WHEP Client (based on GStreamer's webrtcbin)
GNU General Public License v3.0
6 stars 2 forks source link

HTTP Error 406 #6

Closed OverSamu closed 5 months ago

OverSamu commented 11 months ago

Hi, we are trying the whep-client after installing the whep-server (and connecting it to Janus). However, when we attempt to connect, we receive the error "[406] Not Acceptable" from the server. To try to understand the cause, we removed lines 218-225 from the file simple-whep-server/src/server.js. Now, the client seems to progress but then ends with a "Segmentation fault (core dumped)" at line 768 of simple-whep-client/src/whep-client.c.

Last lines of the simple-whep-client logs, first attempt:

[WHEP] Configured jitter-buffer size (latency) for PeerConnection to 200ms
[WHEP] Starting the GStreamer pipeline
[ERR] [src/whep-client.c:whep_connect:402]  [406] Not Acceptable
[WHEP] Disconnecting from server (HTTP error)

Last lines of the simple-whep-client logs, second attempt:

[WHEP] Negotiation completed
[WHEP] ICE gathering started...
[WHEP] ICE connecting...
[WHEP] PeerConnection connecting...
[WHEP] ICE connected
[WHEP] ICE gathering completed
Segmentation fault (core dumped)
OverSamu commented 10 months ago

@lminiero Do you have any idea? Thanks in advance

lminiero commented 10 months ago

The WHEP client is obsolete, better use the WHEP functionality you can find in GStreamer as a module, or more simply use browsers to consume the media.

OverSamu commented 10 months ago

Hi, thanks for the reply. In these days we tried directly with the GStreamer client, as you advised. We used the whepsrc module. The request reaches the whep server correctly, but the audio stream is not opened. In the logs, "ICE Failed" is printed.

We then tried using the whep-sse branch. With this, ICE connects successfully, but we can't receive the audio stream. Unlike the main branch, in this case, the execution doesn't crash; we block it in the logs ourselves.

Logs of the connection to the main branch:

$ GST_DEBUG=3 gst-launch-1.0 whepsrc use-link-headers="true" ice-transport-policy="all" stun-server="stun://stun.l.google.com:19302"  whep-endpoint=http://janus-whep.local/whep/endpoint/918273645430 audio-caps="application/x-rtp,media=audio,encoding-name=OPUS,payload=96,clock-rate=48000"  ! queue ! audioconvert ! autoaudiosink

Setting pipeline to PAUSED ...
0:00:00.060087628 22219 0x55e49d5bf5e0 WARN               webrtcbin gstwebrtcbin.c:3532:sdp_media_from_transceiver:<webrtcbin0> Caps application/x-rtp, media=(string)audio, encoding-name=(string)OPUS, payload=(int)96, clock-rate=(int)48000, rtcp-fb-transport-cc=(boolean)true are missing ssrc
Pipeline is live and does not need PREROLL ...
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
Redistribute latency...
0:00:00.294006810 22219 0x7eff20000fb0 FIXME                default gstutils.c:4036:gst_pad_create_stream_id_internal:<nicesrc0:src> Creating random stream-id, consider implementing a deterministic way of creating a stream-id
0:00:00.294074776 22219 0x55e49d5bf5e0 ERROR                default gstsdpmessage.c:3812:gst_sdp_media_set_media_from_caps: ignoring stream without media type
0:00:00.294117746 22219 0x55e49d5bf5e0 ERROR              webrtcbin gstwebrtcbin.c:3500:sdp_media_from_transceiver:<webrtcbin0> Failed to build media from caps video/x-vp8, rtcp-fb-transport-cc=(boolean)true for transceiver <webrtctransceiver1>
0:00:02.455613156 22219 0x7eff04005810 WARN                 whepsrc net/webrtchttp/src/whepsrc/imp.rs:744:gstwebrtchttp::whepsrc::imp::WhepSrc::parse_endpoint_response::{{closure}}:<whepsrc0> Redirecting endpoint to https://janus-whep.local/whep/endpoint/918273645430
0:00:02.613127902 22219 0x55e49d5bf5e0 ERROR                default webrtcsdp.c:606:_get_final_setup: remote SDP has the same 'a=setup:actpass' attribute. This is not legal
0:00:02.613160822 22219 0x55e49d5bf5e0 WARN               webrtcbin gstwebrtcbin.c:6671:_set_description_task:<webrtcbin0> returning error: Cannot intersect direction attributes for media 0
ERROR: from element /GstPipeline:pipeline0/GstWhepSrc:whepsrc0: GStreamer encountered a general resource error.
Additional debug info:
net/webrtchttp/src/whepsrc/imp.rs(481): gstwebrtchttp::whepsrc::imp::WhepSrc::setup_webrtcbin::{{closure}} (): /GstPipeline:pipeline0/GstWhepSrc:whepsrc0:
ICE failed
Execution ended after 0:00:07.978005818
Setting pipeline to NULL ...
0:00:08.068358271 22219 0x55e49d5ee700 ERROR                whepsrc net/webrtchttp/src/whepsrc/imp.rs:1070:gstwebrtchttp::whepsrc::imp::WhepSrc::terminate_session:<whepsrc0> Error on DELETE request : Error None (Some("Old Canceller should not exist")) at net/webrtchttp/src/utils.rs:98
ERROR: from element /GstPipeline:pipeline0/GstWhepSrc:whepsrc0: GStreamer encountered a general resource error.
Additional debug info:
net/webrtchttp/src/whepsrc/imp.rs(510): gstwebrtchttp::whepsrc::imp::WhepSrc::setup_webrtcbin::{{closure}} (): /GstPipeline:pipeline0/GstWhepSrc:whepsrc0:
PeerConnection failed
Freeing pipeline ...

Logs of the connection to the whep-sse branch:

$ GST_DEBUG=3 gst-launch-1.0 whepsrc use-link-headers="true" ice-transport-policy="all" stun-server="stun://stun.l.google.com:19302"  whep-endpoint=http://janus-whep.local/whep/endpoint/918273645430 audio-caps="application/x-rtp,media=audio,encoding-name=OPUS,payload=96,clock-rate=48000"  ! queue ! audioconvert ! autoaudiosink

Setting pipeline to PAUSED ...
0:00:00.064501564 17593 0x5588c33a44d0 WARN               webrtcbin gstwebrtcbin.c:3532:sdp_media_frPipeline is live and does not need PREROLL ...
om_transceiver:<webrtcbin0> Caps application/x-rtp, media=(string)audio, encoding-name=(string)OPUS, payload=(int)96, clock-rate=(int)48000, rtcp-fb-transport-cc=(boolean)true are missing ssrc
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
Redistribute latency...
0:00:00.142114459 17593 0x7f0ed0000d90 FIXME                default gstutils.c:4036:gst_pad_create_stream_id_internal:<nicesrc0:src> Creating random stream-id, consider implementing a deterministic way of creating a stream-id
0:00:00.142148744 17593 0x7f0ed0000d90 WARN                GST_PADS gstpad.c:4361:gst_pad_peer_query:<nicesrc0:src> could not send sticky events
0:00:00.142297895 17593 0x5588c33a44d0 ERROR                default gstsdpmessage.c:3812:gst_sdp_media_set_media_from_caps: ignoring stream without media type
0:00:00.142346579 17593 0x5588c33a44d0 ERROR              webrtcbin gstwebrtcbin.c:3500:sdp_media_from_transceiver:<webrtcbin0> Failed to build media from caps video/x-vp8, rtcp-fb-transport-cc=(boolean)true for transceiver <webrtctransceiver1>
0:00:02.461635899 17593 0x5588c33a44d0 WARN               webrtcbin gstwebrtcbin.c:3532:sdp_media_from_transceiver:<webrtcbin0> Caps application/x-rtp, media=(string)audio, encoding-name=(string)OPUS, payload=(int)96, clock-rate=(int)48000, rtcp-fb-transport-cc=(boolean)true are missing ssrc
0:00:02.461692092 17593 0x5588c33a44d0 ERROR                default gstsdpmessage.c:3812:gst_sdp_media_set_media_from_caps: ignoring stream without media type
0:00:02.461713259 17593 0x5588c33a44d0 ERROR              webrtcbin gstwebrtcbin.c:3500:sdp_media_from_transceiver:<webrtcbin0> Failed to build media from caps video/x-vp8, rtcp-fb-transport-cc=(boolean)true for transceiver <webrtctransceiver1>
0:00:02.461730367 17593 0x5588c33a44d0 WARN               webrtcbin gstwebrtcbin.c:3532:sdp_media_from_transceiver:<webrtcbin0> Caps application/x-rtp, media=(string)audio, encoding-name=(string)OPUS, payload=(int)96, clock-rate=(int)48000, rtcp-fb-transport-cc=(boolean)true are missing ssrc
0:00:02.461787240 17593 0x5588c33a44d0 ERROR                default gstsdpmessage.c:3812:gst_sdp_media_set_media_from_caps: ignoring stream without media type
0:00:02.461805818 17593 0x5588c33a44d0 ERROR              webrtcbin gstwebrtcbin.c:3500:sdp_media_from_transceiver:<webrtcbin0> Failed to build media from caps video/x-vp8, rtcp-fb-transport-cc=(boolean)true for transceiver <webrtctransceiver3>
^Chandling interrupt.
Interrupt: Stopping pipeline ...
Execution ended after 1:39:31.199297209
Setting pipeline to NULL ...
Freeing pipeline ...

Do you have any other tips for us? Thanks in advance

lminiero commented 7 months ago

@OverSamu FYI, I made the WHEP client compliant with sending offers: see #9 if you're still interested.

OverSamu commented 6 months ago

Hi @lminiero, the whep-offer version seems to work correctly. I will test it better in the next few weeks and will let you know if I notice anything particular. Thank you!

OverSamu commented 5 months ago

I'm closing the issue since everything is now working correctly. Thank you