WebRTC: Possible medias length assertion with webrtcbin

Mandar Joshi emailmandar at gmail.com
Mon Nov 2 03:45:56 UTC 2020


Hello everyone,
I am trying to build a conference engine with WebRTC using GStremer 1.14.5
on Ubuntu 18.04. Been referring to the webrtc-sendrecv.c as an example.
Right now, I am trying to stream audio and video to and from the same Linux
box.

I am having trouble with set-remote-description on webrtcbin. I get this
error after receiving a SDP Answer from the browser.

ERROR:gstwebrtcbin.c:1152:_check_if_negotiation_is_needed: assertion
failed: (trans->mline < gst_sdp_message_medias_len
(webrtc->current_remote_description->sdp))
  >Aborted (core dumped)

A GStreamer peer to GStreamer peer works when both have equal number of
streams (medias, is it?) i.e. Just video or just audio or both audio and
video.

Here is the SDP Answer received from the browser. I think I am messing up
the negotiation somewhere. I would really appreciate some help
understanding what’s happening.

v=0
o=mozilla...THIS_IS_SDPARTA-82.0 810706521954309706 0 IN IP4 0.0.0.0
s=-
t=0 0
a=fingerprint:sha-256
C6:C3:86:8E:CB:D2:14:9C:C1:4A:B8:72:8D:60:00:08:34:51:33:79:FE:2D:39:4A:7C:E6:F5:97:92:5D:97:C4
a=ice-options:trickle
a=msid-semantic:WMS *
m=video 9 UDP/TLS/RTP/SAVPF 96
c=IN IP4 0.0.0.0
a=sendrecv
a=fmtp:96 max-fs=12288;max-fr=60
a=ice-pwd:4d7d2212bcd5f1f467855683f036f700
a=ice-ufrag:0594f02a
a=mid:video0
a=msid:{1d029bf1-6123-4b39-be26-68202dad363f}
{7c72666b-94ec-422b-8cc6-5010b8aa73ab}
a=rtcp-fb:96 nack pli
a=rtcp-mux
a=rtcp-rsize
a=rtpmap:96 VP8/90000
a=setup:active
a=ssrc:1864073429 cname:{4dad80e7-eb43-4706-8934-4a2d51202c21}
m=audio 9 UDP/TLS/RTP/SAVPF 97
c=IN IP4 0.0.0.0
a=sendrecv
a=fmtp:97 maxplaybackrate=48000;stereo=1;useinbandfec=1
a=ice-pwd:4d7d2212bcd5f1f467855683f036f700
a=ice-ufrag:0594f02a
a=mid:audio1
a=msid:{1d029bf1-6123-4b39-be26-68202dad363f}
{4607068a-ba2b-4d70-8561-12f13013b345}
a=rtcp-mux
a=rtpmap:97 opus/48000/2
a=setup:active
a=ssrc:4273581052 cname:{4dad80e7-eb43-4706-8934-4a2d51202c21}

Here is the C code I’m using for set-remote-description.

static void c_peer_set_sdp_answer (CPeer *cpeer, Conference *conf, gchar
*sdp_answer) {
{
  g_message ("Setting SDP Answer: %s", sdp_answer);
  int ret;
  GstSDPMessage *sdp;
  GstWebRTCSessionDescription *answer;
  GstPromise *promise;

  ret = gst_sdp_message_new (&sdp);
  g_assert_cmphex (ret, ==, GST_SDP_OK);
  ret = gst_sdp_message_parse_buffer ((guint8 *) sdp_answer, strlen
(sdp_answer), sdp);
  g_assert_cmphex (ret, ==, GST_SDP_OK);

  answer = gst_webrtc_session_description_new (GST_WEBRTC_SDP_TYPE_ANSWER,
sdp);
  g_assert_nonnull (answer);

  promise = gst_promise_new ();

  //This is where things go wrong
  g_signal_emit_by_name (conf->webrtcbin, "set-remote-description", answer,
promise);

  gst_promise_interrupt (promise);
  gst_promise_unref (promise);
}

Is there something I could be missing in the process before
set-remote-description?
May be in set-local-description?

>From the GST_DEBUG=4 level logs, is this something I need to look into?
0:00:41.148395569  9264 0x55dc1f3b9590 INFO               webrtcbin
gstwebrtcbin.c:2795:_set_description_task:<webrtcbin> Attempting to set
remote answer in the have-local-offer state

Here is the link to the what seems to be the relevant section of the logs
https://pastebin.com/aiPMsZgG

Regards
Mandar
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20201102/29c6d381/attachment.htm>


More information about the gstreamer-devel mailing list