Webrtcbin SDP negotiation error `gst_sdp_media_get_port: assertion 'media != NULL' failed` (regression from 1.14 -> 1.16)
I've implemented a streaming server based on the gstwebrtc-demos:
https://github.com/aiden-ct/gstwebrtc-demos/tree/aiden/add-streaming-demo
(there's a README.md in the streamer/
directory with directions on how to run)
On gstreamer 1.14, the system works (albeit there are some bugs I was hoping to alleviate by moving to a newer gst version); I get a successful SDP offer negotiation, and the video renders in the browser:
Runing in Gst 1.14 - OK
$ gdb streaming-app-debug
GNU gdb (Ubuntu 8.1-0ubuntu3) 8.1.0.20180409-git
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from streaming-app-debug...done.
(gdb) run
Starting program: /home/aiden/Work/mlb/software/gstwebrtc-demos/streamer/gst/streaming-app-debug
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Connecting to server...
[New Thread 0x7fffea2b8700 (LWP 19593)]
[New Thread 0x7fffe9ab7700 (LWP 19594)]
[New Thread 0x7fffe92b6700 (LWP 19595)]
[New Thread 0x7fffe8ab5700 (LWP 19596)]
[New Thread 0x7fffdbfff700 (LWP 19597)]
[New Thread 0x7fffdb3a3700 (LWP 19598)]
[New Thread 0x7fffda995700 (LWP 19599)]
[New Thread 0x7fffd9b66700 (LWP 19600)]
[New Thread 0x7fffc6c6f700 (LWP 19606)]
> GET HTTP/1.1
> Soup-Debug-Timestamp: 1560521600
> Soup-Debug: SoupSession 1 (0x555555a08220), SoupMessage 1 (0x555555a240c0), SoupSocket 1 (0x55555580c4e0)
> Host: localhost:8443
> Upgrade: websocket
> Connection: Upgrade
> Sec-WebSocket-Key: dIq2lO8W+DlqOmG5Zdidgw==
> Sec-WebSocket-Version: 13
> Accept-Encoding: gzip, deflate
< HTTP/1.1 101 Switching Protocols
< Soup-Debug-Timestamp: 1560521600
< Soup-Debug: SoupMessage 1 (0x555555a240c0)
< Upgrade: websocket
< Connection: Upgrade
< Sec-WebSocket-Accept: QcVkSY6CRJdrFVd+K6xilnAFCwI=
< Date: Fri, 14 Jun 2019 14:13:20 GMT
< Server: Python/3.6 websockets/7.0
Connected to signalling server
Registering with signalling server
Registered with server
[Thread 0x7fffc6c6f700 (LWP 19606) exited]
ERROR: no client session 246, server-state: 7, session_state: 1
[New Thread 0x7fffc6c6f700 (LWP 19608)]
[New Thread 0x7fffc5332700 (LWP 19609)]
(streaming-app-debug:19580): GLib-GObject-WARNING **: 15:13:23.404: ../../../../gobject/gsignal.c:3492: signal name 'create-data-channel' is invalid for instance '0x555555fea130' of type 'GstWebRTCBin'
WARNING: Could not create data channel, is usrsctp available?
(streaming-app-debug:19580): GLib-GObject-WARNING **: 15:13:23.405: ../../../../gobject/gsignal.c:2523: signal 'on-data-channel' is invalid for instance '0x555555fea130' of type 'GstWebRTCBin'
(streaming-app-debug:19580): GLib-GObject-WARNING **: 15:13:23.529: g_object_set_is_valid_property: object class 'GstWebRTCBin' has no property named 'bundle-policy'
Sending offer:
v=0
o=- 2086302116884277653 0 IN IP4 0.0.0.0
s=-
t=0 0
a=ice-options:trickle
[New Thread 0x7fffbbfff700 (LWP 19610)]
[New Thread 0x7fffbaf5b700 (LWP 19611)]
[New Thread 0x7fffba75a700 (LWP 19612)]
[New Thread 0x7fffb9f59700 (LWP 19613)]
Received SDP answer:
v=0
o=- 4074778530172724525 2 IN IP4 127.0.0.1
s=-
t=0 0
a=msid-semantic: WMS
[New Thread 0x7fffb9758700 (LWP 19615)]
Sending offer:
v=0
o=- 2590294066736743967 0 IN IP4 0.0.0.0
s=-
t=0 0
a=ice-options:trickle
m=video 9 UDP/TLS/RTP/SAVPF 96
c=IN IP4 0.0.0.0
a=setup:actpass
a=ice-ufrag:sTKQq/gk4b9IhhU2ax+Vobv5Q07glW5V
a=ice-pwd:Zbknockz+bZdH0FRVn51gstFdp0CDUFT
a=sendrecv
a=rtcp-mux
a=rtcp-rsize
a=rtpmap:96 H264/90000
a=rtcp-fb:96 nack
a=rtcp-fb:96 nack pli
a=framerate:30
a=fmtp:96 packetization-mode=1;sprop-parameter-sets=Z2QADaxWgUHz/wABAAEQAAADABAAAAMDyUA=,aM48MA==
a=mid:video0
a=fingerprint:sha-256 92:72:4B:B0:33:C6:C9:5B:E1:21:06:E2:25:B3:B1:C0:5D:E1:9A:BD:C1:04:D8:42:33:01:46:7B:24:88:76:89
Received SDP answer:
v=0
o=- 4074778530172724525 3 IN IP4 127.0.0.1
s=-
t=0 0
a=msid-semantic: WMS
m=video 9 UDP/TLS/RTP/SAVPF 96
c=IN IP4 0.0.0.0
a=rtcp:9 IN IP4 0.0.0.0
a=ice-ufrag:/OCf
a=ice-pwd:zHFEOH4tLraxcD7pNjgbHw7H
a=ice-options:trickle
a=fingerprint:sha-256 7E:34:CE:4D:F1:D7:68:73:DE:C1:DC:75:0A:BD:CC:5A:E6:1D:20:47:FA:B9:EE:F2:07:AC:F7:0A:5D:27:55:4D
a=setup:active
a=mid:video0
a=recvonly
a=rtcp-mux
a=rtcp-rsize
a=rtpmap:96 H264/90000
a=rtcp-fb:96 nack
a=rtcp-fb:96 nack pli
a=fmtp:96 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f
However, on 1.16, I get an error:
(streaming-app-debug:5339): CRITICAL **: 15:10:40.768: gst_sdp_media_get_port: assertion 'media != NULL' failed
The full output is:
Runing in Gst 1.16 - FAILS
$ gdb streaming-app-debug
GNU gdb (Ubuntu 8.3-0ubuntu1) 8.3
Copyright (C) 2019 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from streaming-app-debug...
(gdb) run
Starting program: /home/aiden/gstwebrtc-demos/streamer/gst/streaming-app-debug
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Connecting to server...
[New Thread 0x7ffff49fa700 (LWP 5343)]
[New Thread 0x7ffff41f9700 (LWP 5344)]
[New Thread 0x7ffff39f8700 (LWP 5345)]
[New Thread 0x7ffff31f7700 (LWP 5346)]
[New Thread 0x7ffff2864700 (LWP 5347)]
[New Thread 0x7ffff2063700 (LWP 5348)]
[New Thread 0x7ffff1862700 (LWP 5349)]
[New Thread 0x7ffff0bf0700 (LWP 5350)]
[New Thread 0x7fffe3fff700 (LWP 5351)]
[New Thread 0x7fffe3514700 (LWP 5352)]
[New Thread 0x7fffe2c3c700 (LWP 5353)]
> GET HTTP/1.1
> Soup-Debug-Timestamp: 1560521434
> Soup-Debug: SoupSession 1 (0x5555557f3220), SoupMessage 1 (0x55555580f8e0), SoupSocket 1 (0x5555555b9c30)
> Host: localhost:8443
> Upgrade: websocket
> Connection: Upgrade
> Sec-WebSocket-Key: HfGZ6AYQAFA1BueM0YxRSA==
> Sec-WebSocket-Version: 13
> Accept-Encoding: gzip, deflate
< HTTP/1.1 101 Switching Protocols
< Soup-Debug-Timestamp: 1560521434
< Soup-Debug: SoupMessage 1 (0x55555580f8e0)
< Upgrade: websocket
< Connection: Upgrade
< Sec-WebSocket-Accept: fNDyaQKcr/qQM8+xfr0q9pnJjp8=
< Date: Fri, 14 Jun 2019 14:10:34 GMT
< Server: Python/3.7 websockets/7.0
Connected to signalling server
Registering with signalling server
Registered with server
ERROR: no client session 396, server-state: 7, session_state: 1
[New Thread 0x7fffe11eb700 (LWP 5358)]
** (streaming-app-debug:5339): CRITICAL **: 15:10:40.743: gst_webrtc_bin_create_data_channel: assertion 'webrtc->priv->is_closed != TRUE' failed
WARNING: Could not create data channel, is usrsctp available?
[New Thread 0x7fffe09ea700 (LWP 5359)]
Sending offer:
v=0
o=- 232983092207812582 0 IN IP4 0.0.0.0
s=-
t=0 0
a=ice-options:trickle
a=group:BUNDLE
Received SDP answer:
v=0
o=- 2698857652951140917 2 IN IP4 127.0.0.1
s=-
t=0 0
a=group:BUNDLE
a=msid-semantic: WMS
** (streaming-app-debug:5339): CRITICAL **: 15:10:40.768: gst_sdp_media_get_port: assertion 'media != NULL' failed
**
ERROR:gstwebrtcbin.c:1229:_check_if_negotiation_is_needed: assertion failed: (trans->mline < gst_sdp_message_medias_len (webrtc->current_local_description->sdp))
Thread 14 "gst-pc-ops" received signal SIGABRT, Aborted.
[Switching to Thread 0x7fffe09ea700 (LWP 5359)]
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
50 ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) backtrace
#0 0x00007ffff7a5fed7 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1 0x00007ffff7a41535 in __GI_abort () at abort.c:79
#2 0x00007ffff7c22dc3 in () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3 0x00007ffff7c7ddba in g_assertion_message_expr () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#4 0x00007fffe359858c in () at /usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstwebrtc.so
#5 0x00007fffe359912f in () at /usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstwebrtc.so
#6 0x00007fffe358edff in () at /usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstwebrtc.so
#7 0x00007ffff7c559b8 in g_main_context_dispatch () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#8 0x00007ffff7c55da8 in () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#9 0x00007ffff7c560a2 in g_main_loop_run () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#10 0x00007fffe3592c4d in () at /usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstwebrtc.so
#11 0x00007ffff7c7eb4d in () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#12 0x00007ffff7386182 in start_thread (arg=<optimised out>) at pthread_create.c:486
#13 0x00007ffff7b39b1f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
Can anyone give me pointers on what I'm doing wrong?