Closed moliyadi closed 3 years ago
Does the crash have a stack trace? Also, what endpoint is used for streaming? I didn't see the SDP in the above logs.
TRANS_BY_GPT3
getDisplayMedia
, and then the publish interface of SRS is called for streaming. The publish interface also returns the SDP information of the answer correctly.TRANS_BY_GPT3
@xiaozhihong, do you think this part in the log is the SDP information sent by the streaming client and the response from SRS?
[2021-11-05 09:28:23.917][Trace][1][ae621h67] RTC remote offer: v=0\r\no=- 1372008797419425428 2 IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\na=group:BUNDLE 0\r\na=extmap-allow-mixed\r\na=msid-semantic: WMS\r\nm=video 9 UDP/TLS/RTP/SAVPF 96 97 98 99 100 101 102 121 127 120 125 107 108 109 35 36 124 119 123 118 114 115 116\r\nc=IN IP4 0.0.0.0\r\na=rtcp:9 IN IP4 0.0.0.0\r\na=ice-ufrag:lUjZ\r\na=ice-pwd:1Jmj74OhzbvwFfqWCjD6VIzW\r\na=ice-options:trickle\r\na=fingerprint:sha-256 48:F3:43:90:3B:47:3B:75:A9:81:50:35:60:7C:18:E5:32:1E:58:B2:C8:6E:91:4A:5F:01:84:B3:A6:07:AB:4B\r\na=setup:actpass\r\na=mid:0\r\na=extmap:1 urn:ietf:params:rtp-hdrext:toffset\r\na=extmap:2 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time\r\na=extmap:3 urn:3gpp:video-orientation\r\na=extmap:4 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01\r\na=extmap:5 http://www.webrtc.org/experiments/rtp-hdrext/playout-delay\r\na=extmap:6 http://www.webrtc.org/experiments/rtp-hdrext/video-content-type\r\na=extmap:7 http://www.webrtc.org/experiments/rtp-hdrext/video-timing\r\na=extmap:8 http://www.webrtc.org/experiments/rtp-hdrext/color-space\r\na=extmap:9 urn:ietf:params:rtp-hdrext:sdes:mid\r\na=extmap:10 urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id\r\na=extmap:11 urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id\r\na=sendrecv\r\na=msid:- 0d40516c-a535-42f4-bd17-116e9bd96992\r\na=rtcp-mux\r\na=rtcp-rsize\r\na=rtpmap:96 VP8/90000\r\na=rtcp-fb:96 goog-remb\r\na=rtcp-fb:96 transport-cc\r\na=rtcp-fb:96 ccm fir\r\na=rtcp-fb:96 nack\r\na=rtcp-fb:96 nack pli\r\na=rtpmap:97 rtx/90000\r\na=fmtp:97 apt=96\r\na=rtpmap:98 VP9/90000\r\na=rtcp-fb:98 goog-remb\r\na=rtcp-fb:98 transport-cc\r\na=rtcp-fb:98 ccm fir\r\na=rtcp-fb:98 nack\r\na=rtcp-fb:98 nack pli\r\na=fmtp:98 profile-id=0\r\na=rtpmap:99 rtx/90000\r\na=fmtp:99 apt=98\r\na=rtpmap:100 VP9/90000\r\na=rtcp-fb:100 goog-remb\r\na=rtcp-fb:100 transport-cc\r\na=rtcp-fb:100 ccm fir\r\na=rtcp-fb:100 nack\r\na=rtcp-fb:100 nack pli\r\na=fmtp:100 profile-id=2\r\na=rtpmap:101 rtx/90000\r\na=fmtp:101 apt=100\r\na=rtpmap:102 H264/90000\r\na=rtcp-fb:102 goog-remb\r\na=rtcp-fb:102 transport-cc\r\na=rtcp-fb:102 ccm fir\r\na=rtcp-fb:102 nack\r\na=rtcp-fb:102 nack pli\r\na=fmtp:102 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42001f\r\na=rtpmap:121 rtx/90000\r\na=fmtp:121 apt=102\r\na=rtpmap:127 H264/90000\r\na=rtcp-fb:127 goog-remb\r\na=rtcp-fb:127 transport-cc\r\na=rtcp-fb:127 ccm fir\r\na=rtcp-fb:127 nack\r\na=rtcp-fb:127 nack pli\r\na=fmtp:127 level-asymmetry-allowed=1;packetization-mode=0;profile-level-id=42001f\r\na=rtpmap:120 rtx/90000\r\na=fmtp:120 apt=127\r\na=rtpmap:125 H264/90000\r\na=rtcp-fb:125 goog-remb\r\na=rtcp-fb:125 transport-cc\r\na=rtcp-fb:125 ccm fir\r\na=rtcp-fb:125 nack\r\na=rtcp-fb:125 nack pli\r\na=fmtp:125 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f\r\na=rtpmap:107 rtx/90000\r\na=fmtp:107 apt=125\r\na=rtpmap:108 H264/90000\r\na=rtcp-fb:108 goog-remb\r\na=rtcp-fb:108 transport-cc\r\na=rtcp-fb:108 ccm fir\r\na=rtcp-fb:108 nack\r\na=rtcp-fb:108 nack pli\r\na=fmtp:108 level-asymmetry-allowed=1;packetization-mode=0;profile-level-id=42e01f\r\na=rtpmap:109 rtx/90000\r\na=fmtp:109 apt=108\r\na=rtpmap:35 AV1X/90000\r\na=rtcp-fb:35 goog-remb\r\na=rtcp-fb:35 transport-cc\r\na=rtcp-fb:35 ccm fir\r\na=rtcp-fb:35 nack\r\na=rtcp-fb:35 nack pli\r\na=rtpmap:36 rtx/90000\r\na=fmtp:36 apt=35\r\na=rtpmap:124 H264/90000\r\na=rtcp-fb:124 goog-remb\r\na=rtcp-fb:124 transport-cc\r\na=rtcp-fb:124 ccm fir\r\na=rtcp-fb:124 nack\r\na=rtcp-fb:124 nack pli\r\na=fmtp:124 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=4d0032\r\na=rtpmap:119 rtx/90000\r\na=fmtp:119 apt=124\r\na=rtpmap:123 H264/90000\r\na=rtcp-fb:123 goog-remb\r\na=rtcp-fb:123 transport-cc\r\na=rtcp-fb:123 ccm fir\r\na=rtcp-fb:123 nack\r\na=rtcp-fb:123 nack pli\r\na=fmtp:123 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=640032\r\na=rtpmap:118 rtx/90000\r\na=fmtp:118 apt=123\r\na=rtpmap:114 red/90000\r\na=rtpmap:115 rtx/90000\r\na=fmtp:115 apt=114\r\na=rtpmap:116 ulpfec/90000\r\na=ssrc-group:FID 584504130 2927640742\r\na=ssrc:584504130 cname:U7Xe2VU55+SsZQBV\r\na=ssrc:584504130 msid:- 0d40516c-a535-42f4-bd17-116e9bd96992\r\na=ssrc:584504130 mslabel:-\r\na=ssrc:584504130 label:0d40516c-a535-42f4-bd17-116e9bd96992\r\na=ssrc:2927640742 cname:U7Xe2VU55+SsZQBV\r\na=ssrc:2927640742 msid:- 0d40516c-a535-42f4-bd17-116e9bd96992\r\na=ssrc:2927640742 mslabel:-\r\na=ssrc:2927640742 label:0d40516c-a535-42f4-bd17-116e9bd96992\r\n
[2021-11-05 09:28:23.917][Trace][1][ae621h67] RTC local answer: v=0\r\no=SRS/4.0.191(Leo) 50079456 2 IN IP4 0.0.0.0\r\ns=SRSPublishSession\r\nt=0 0\r\na=ice-lite\r\na=group:BUNDLE 0\r\na=msid-semantic: WMS 123456/4a1a397s1\r\nm=video 9 UDP/TLS/RTP/SAVPF 125 114\r\nc=IN IP4 0.0.0.0\r\na=ice-ufrag:93s9h299\r\na=ice-pwd:x8q60e9k2664321422394607221p9126\r\na=fingerprint:sha-256 AC:D5:1F:32:23:EC:04:4B:0A:C9:1E:6F:54:46:E8:17:A0:0C:0F:D0:E2:5E:F3:CD:A9:10:9F:6B:4F:46:05:8D\r\na=setup:passive\r\na=mid:0\r\na=extmap:4 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01\r\na=recvonly\r\na=rtcp-mux\r\na=rtcp-rsize\r\na=rtpmap:125 H264/90000\r\na=rtcp-fb:125 transport-cc\r\na=rtcp-fb:125 nack\r\na=rtcp-fb:125 nack pli\r\na=fmtp:125 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f\r\na=rtpmap:114 red/90000\r\na=candidate:0 1 udp 2130706431 192.168.124.211 8000 typ host generation 0\r\n
TRANS_BY_GPT3
@xiaozhihong Do you think this part in the log is the SDP information sent by the streaming client and replied by SRS?
[2021-11-05 09:28:23.917][Trace][1][ae621h67] RTC remote offer: v=0\r\no=- 1372008797419425428 2 IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\na=group:BUNDLE 0\r\na=extmap-allow-mixed\r\na=msid-semantic: WMS\r\nm=video 9 UDP/TLS/RTP/SAVPF 96 97 98 99 100 101 102 121 127 120 125 107 108 109 35 36 124 119 123 118 114 115 116\r\nc=IN IP4 0.0.0.0\r\na=rtcp:9 IN IP4 0.0.0.0\r\na=ice-ufrag:lUjZ\r\na=ice-pwd:1Jmj74OhzbvwFfqWCjD6VIzW\r\na=ice-options:trickle\r\na=fingerprint:sha-256 48:F3:43:90:3B:47:3B:75:A9:81:50:35:60:7C:18:E5:32:1E:58:B2:C8:6E:91:4A:5F:01:84:B3:A6:07:AB:4B\r\na=setup:actpass\r\na=mid:0\r\na=extmap:1 urn:ietf:params:rtp-hdrext:toffset\r\na=extmap:2 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time\r\na=extmap:3 urn:3gpp:video-orientation\r\na=extmap:4 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01\r\na=extmap:5 http://www.webrtc.org/experiments/rtp-hdrext/playout-delay\r\na=extmap:6 http://www.webrtc.org/experiments/rtp-hdrext/video-content-type\r\na=extmap:7 http://www.webrtc.org/experiments/rtp-hdrext/video-timing\r\na=extmap:8 http://www.webrtc.org/experiments/rtp-hdrext/color-space\r\na=extmap:9 urn:ietf:params:rtp-hdrext:sdes:mid\r\na=extmap:10 urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id\r\na=extmap:11 urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id\r\na=sendrecv\r\na=msid:- 0d40516c-a535-42f4-bd17-116e9bd96992\r\na=rtcp-mux\r\na=rtcp-rsize\r\na=rtpmap:96 VP8/90000\r\na=rtcp-fb:96 goog-remb\r\na=rtcp-fb:96 transport-cc\r\na=rtcp-fb:96 ccm fir\r\na=rtcp-fb:96 nack\r\na=rtcp-fb:96 nack pli\r\na=rtpmap:97 rtx/90000\r\na=fmtp:97 apt=96\r\na=rtpmap:98 VP9/90000\r\na=rtcp-fb:98 goog-remb\r\na=rtcp-fb:98 transport-cc\r\na=rtcp-fb:98 ccm fir\r\na=rtcp-fb:98 nack\r\na=rtcp-fb:98 nack pli\r\na=fmtp:98 profile-id=0\r\na=rtpmap:99 rtx/90000\r\na=fmtp:99 apt=98\r\na=rtpmap:100 VP9/90000\r\na=rtcp-fb:100 goog-remb\r\na=rtcp-fb:100 transport-cc\r\na=rtcp-fb:100 ccm fir\r\na=rtcp-fb:100 nack\r\na=rtcp-fb:100 nack pli\r\na=fmtp:100 profile-id=2\r\na=rtpmap:101 rtx/90000\r\na=fmtp:101 apt=100\r\na=rtpmap:102 H264/90000\r\na=rtcp-fb:102 goog-remb\r\na=rtcp-fb:102 transport-cc\r\na=rtcp-fb:102 ccm fir\r\na=rtcp-fb:102 nack\r\na=rtcp-fb:102 nack pli\r\na=fmtp:102 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42001f\r\na=rtpmap:121 rtx/90000\r\na=fmtp:121 apt=102\r\na=rtpmap:127 H264/90000\r\na=rtcp-fb:127 goog-remb\r\na=rtcp-fb:127 transport-cc\r\na=rtcp-fb:127 ccm fir\r\na=rtcp-fb:127 nack\r\na=rtcp-fb:127 nack pli\r\na=fmtp:127 level-asymmetry-allowed=1;packetization-mode=0;profile-level-id=42001f\r\na=rtpmap:120 rtx/90000\r\na=fmtp:120 apt=127\r\na=rtpmap:125 H264/90000\r\na=rtcp-fb:125 goog-remb\r\na=rtcp-fb:125 transport-cc\r\na=rtcp-fb:125 ccm fir\r\na=rtcp-fb:125 nack\r\na=rtcp-fb:125 nack pli\r\na=fmtp:125 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f\r\na=rtpmap:107 rtx/90000\r\na=fmtp:107 apt=125\r\na=rtpmap:108 H264/90000\r\na=rtcp-fb:108 goog-remb\r\na=rtcp-fb:108 transport-cc\r\na=rtcp-fb:108 ccm fir\r\na=rtcp-fb:108 nack\r\na=rtcp-fb:108 nack pli\r\na=fmtp:108 level-asymmetry-allowed=1;packetization-mode=0;profile-level-id=42e01f\r\na=rtpmap:109 rtx/90000\r\na=fmtp:109 apt=108\r\na=rtpmap:35 AV1X/90000\r\na=rtcp-fb:35 goog-remb\r\na=rtcp-fb:35 transport-cc\r\na=rtcp-fb:35 ccm fir\r\na=rtcp-fb:35 nack\r\na=rtcp-fb:35 nack pli\r\na=rtpmap:36 rtx/90000\r\na=fmtp:36 apt=35\r\na=rtpmap:124 H264/90000\r\na=rtcp-fb:124 goog-remb\r\na=rtcp-fb:124 transport-cc\r\na=rtcp-fb:124 ccm fir\r\na=rtcp-fb:124 nack\r\na=rtcp-fb:124 nack pli\r\na=fmtp:124 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=4d0032\r\na=rtpmap:119 rtx/90000\r\na=fmtp:119 apt=124\r\na=rtpmap:123 H264/90000\r\na=rtcp-fb:123 goog-remb\r\na=rtcp-fb:123 transport-cc\r\na=rtcp-fb:123 ccm fir\r\na=rtcp-fb:123 nack\r\na=rtcp-fb:123 nack pli\r\na=fmtp:123 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=640032\r\na=rtpmap:118 rtx/90000\r\na=fmtp:118 apt=123\r\na=rtpmap:114 red/90000\r\na=rtpmap:115 rtx/90000\r\na=fmtp:115 apt=114\r\na=rtpmap:116 ulpfec/90000\r\na=ssrc-group:FID 584504130 2927640742\r\na=ssrc:584504130 cname:U7Xe2VU55+SsZQBV\r\na=ssrc:584504130 msid:- 0d40516c-a535-42f4-bd17-116e9bd96992\r\na=ssrc:584504130 mslabel:-\r\na=ssrc:584504130 label:0d40516c-a535-42f4-bd17-116e9bd96992\r\na=ssrc:2927640742 cname:U7Xe2VU55+SsZQBV\r\na=ssrc:2927640742 msid:- 0d40516c-a535-42f4-bd17-116e9bd96992\r\na=ssrc:2927640742 mslabel:-\r\na=ssrc:2927640742 label:0d40516c-a535-42f4-bd17-116e9bd96992\r\n [2021-11-05 09:28:23.917][Trace][1][ae621h67] RTC local answer: v=0\r\no=SRS/4.0.191(Leo) 50079456 2 IN IP4 0.0.0.0\r\ns=SRSPublishSession\r\nt=0 0\r\na=ice-lite\r\na=group:BUNDLE 0\r\na=msid-semantic: WMS 123456/4a1a397s1\r\nm=video 9 UDP/TLS/RTP/SAVPF 125 114\r\nc=IN IP4 0.0.0.0\r\na=ice-ufrag:93s9h299\r\na=ice-pwd:x8q60e9k2664321422394607221p9126\r\na=fingerprint:sha-256 AC:D5:1F:32:23:EC:04:4B:0A:C9:1E:6F:54:46:E8:17:A0:0C:0F:D0:E2:5E:F3:CD:A9:10:9F:6B:4F:46:05:8D\r\na=setup:passive\r\na=mid:0\r\na=extmap:4 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01\r\na=recvonly\r\na=rtcp-mux\r\na=rtcp-rsize\r\na=rtpmap:125 H264/90000\r\na=rtcp-fb:125 transport-cc\r\na=rtcp-fb:125 nack\r\na=rtcp-fb:125 nack pli\r\na=fmtp:125 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f\r\na=rtpmap:114 red/90000\r\na=candidate:0 1 udp 2130706431 192.168.124.211 8000 typ host generation 0\r\n
Yes, you're right, I missed that haha. The stack trace is important. Let's see if we can print the stack trace.
TRANS_BY_GPT3
@xiaozhihong
Is the stack information you mentioned supposed to be saved in srs.log
? I checked the content saved in srs.log
and it is the same as what I initially pasted in the issue. The last print of SRS is this line [2021-11-05 09:28:45.659][Trace][1][5j7co0d1] ignore attribute=, value=
, and then the process disappears.
If there are any other ways to obtain the stack information you mentioned, please let me know or provide a reference link. I will do my best to obtain it. Thank you.
TRANS_BY_GPT3
@xiaozhihong I tried saving the core, this is the corresponding stack information, please see if it helps, thank you.
GNU gdb (Ubuntu 9.2-0ubuntu1~20.04) 9.2
Copyright (C) 2020 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 objs/srs...
[New LWP 1994678]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `./objs/srs -c conf/srs.conf'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 SrsRtcSource::get_track_desc (this=0x562e2208f210, type=..., media_name=...) at src/app/srs_app_rtc_source.cpp:662
662 if (stream_desc_->audio_track_desc_->media_->name_ == media_name) {
(gdb)
(gdb) where
#0 SrsRtcSource::get_track_desc (this=0x562e2208f210, type="audio", media_name="opus") at src/app/srs_app_rtc_source.cpp:662
#1 0x0000562e1fdc0a7a in SrsRtcConnection::negotiate_play_capability (this=0x562e21fc85e0, ruc=0x562e222e93a0, sub_relations=std::map with 0 elements)
at src/app/srs_app_rtc_conn.cpp:3214
#2 0x0000562e1fdb9a1c in SrsRtcConnection::add_player (this=0x562e21fc85e0, ruc=0x562e222e93a0, local_sdp=...) at src/app/srs_app_rtc_conn.cpp:2025
#3 0x0000562e1fdf33fd in SrsRtcServer::do_create_session (this=0x562e21dde6b0, ruc=0x562e222e93a0, local_sdp=..., session=0x562e21fc85e0)
at src/app/srs_app_rtc_server.cpp:500
#4 0x0000562e1fdf3207 in SrsRtcServer::create_session (this=0x562e21dde6b0, ruc=0x562e222e93a0, local_sdp=..., psession=0x562e222e8cd0)
at src/app/srs_app_rtc_server.cpp:478
#5 0x0000562e1fe0adc2 in SrsGoApiRtcPlay::do_serve_http (this=0x562e21eace00, w=0x562e222e9a40, r=0x562e21f3b360, res=0x562e21fcc7b0)
at src/app/srs_app_rtc_api.cpp:190
#6 0x0000562e1fe09854 in SrsGoApiRtcPlay::serve_http (this=0x562e21eace00, w=0x562e222e9a40, r=0x562e21f3b360) at src/app/srs_app_rtc_api.cpp:49
#7 0x0000562e1fc77cad in SrsHttpServeMux::serve_http (this=0x562e21dde000, w=0x562e222e9a40, r=0x562e21f3b360) at src/protocol/srs_http_stack.cpp:727
#8 0x0000562e1fc78af6 in SrsHttpCorsMux::serve_http (this=0x562e2226e990, w=0x562e222e9a40, r=0x562e21f3b360) at src/protocol/srs_http_stack.cpp:875
#9 0x0000562e1fd4d843 in SrsHttpConn::process_request (this=0x562e21f28720, w=0x562e222e9a40, r=0x562e21f3b360, rid=1) at src/app/srs_app_http_conn.cpp:233
#10 0x0000562e1fd4d46e in SrsHttpConn::process_requests (this=0x562e21f28720, preq=0x562e222e9b18) at src/app/srs_app_http_conn.cpp:206
#11 0x0000562e1fd4cff9 in SrsHttpConn::do_cycle (this=0x562e21f28720) at src/app/srs_app_http_conn.cpp:160
#12 0x0000562e1fd4c9d0 in SrsHttpConn::cycle (this=0x562e21f28720) at src/app/srs_app_http_conn.cpp:105
#13 0x0000562e1fcf77a8 in SrsFastCoroutine::cycle (this=0x562e22173850) at src/app/srs_app_st.cpp:262
#14 0x0000562e1fcf784c in SrsFastCoroutine::pfn (arg=0x562e22173850) at src/app/srs_app_st.cpp:277
#15 0x0000562e1fe1564f in _st_thread_main () at sched.c:363
#16 0x0000562e1fe15f08 in st_thread_create (start=0x562e1fcf7828 <SrsFastCoroutine::pfn(void*)>, arg=0x562e22173850, joinable=1, stk_size=65536) at sched.c:694
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
(gdb)
TRANS_BY_GPT3
Crashes definitely need to be resolved. The server should not crash just because the client provides an input; this could be considered as a form of attack. π
TRANS_BY_GPT3
@moliyadi Excuse me, have you solved the issue of the shared screen not playing? I'm seeking advice on how to fix it.
TRANS_BY_GPT3
@luojq661 After reporting this bug last year, the new version of SRS has already fixed this crash issue. If you are unable to play, it may not be caused by this problem. You can check whether the sdp generated by the playback end createOffer contains unnecessary audio tracks. If the number or order of tracks in the requested sdp and the returned sdp do not match, it will also cause playback failure.
TRANS_BY_GPT3
- SRS is running in docker mode, and the above log is the complete log printed by SRS from startup to triggering SRS crash during playback;
- Streaming is done using Chrome, based on srs.sdk.js, by using
getDisplayMedia
to obtain the video stream of the shared screen, and then calling SRS's publish interface for streaming. The publish interface also returns the answer's SDP information normally;- If there is a way to obtain the crash stack trace, I can try to reproduce it and get it. Thank you;
Streaming is done using Chrome, based on srs.sdk.js, by using getDisplayMedia
to obtain the video stream of the shared screen, and then calling SRS's publish interface for streaming. The publish interface also returns the answer's SDP information normally. Can you share this code? Thank you!
TRANS_BY_GPT3
@linkewei0580 Roughly, the logic can be referred to as follows
// Configure constraints
self.screenConstraints = {
audio: false,
video: {
width: 1280,
height: 720,
frameRate: 30
}
};
// Create PeerConnection
self.prepareShareStream = async function (shareConstraints) {
if (self.pc === null) {
self.pc = new RTCPeerConnection(null);
}
var stream = await navigator.mediaDevices.getDisplayMedia(shareConstraints);
console.log('prepareShareStream:', stream, shareConstraints);
// @see https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection/addStream#Migrating_to_addTrack
stream.getTracks().forEach(function (track) {
console.log('prepareShareStream_track:', track);
self.pc.addTrack(track);
// Notify about local track when stream is ok.
self.ontrack && self.ontrack({
track: track
});
});
}
// Start streaming
self.publishStream = async function (url) {
var conf = self.__internal.prepareUrl(url);
if (self.pc === null) {
console.log("publishStream error: not prepare stream");
return "";
}
var offer = await self.pc.createOffer();
await self.pc.setLocalDescription(offer);
var session = await new Promise(function (resolve, reject) {
// @see https://github.com/rtcdn/rtcdn-draft
var data = {
api: conf.apiUrl,
tid: conf.tid,
streamurl: conf.streamUrl,
clientip: null,
sdp: offer.sdp
};
console.log("Generated offer: ", data);
axios({
method: "POST",
url: conf.apiUrl,
data: JSON.stringify(data),
contentType: 'application/json',
dataType: 'json'
}).then(function (response) {
var data = response.data;
console.log("Got answer: ", data);
if (data.code) {
reject(data);
return;
}
resolve(data);
}).catch(function (reason) {
reject(reason);
});
});
await self.pc.setRemoteDescription(
new RTCSessionDescription({
type: 'answer',
sdp: session.sdp
})
);
session.simulator = conf.schema + '//' + conf.urlObject.server + ':' + conf.port + '/rtc/v1/nack/';
return session;
}
TRANS_BY_GPT3
Thank you!
ζε―δΌ
Sender: moliyadi Sent: 2023-04-11 21:28 Recipient: ossrs/srs CC: linkewei0580; Mention Subject: Re: [ossrs/srs] Unable to play Chrome screen sharing via WebRTC to SRS, and playing causes SRS crash (Issue #2719) @linkewei0580, you can refer to the following logic for configuration constraints. self.screenConstraints = { audio: false, video: { width: 1280, height: 720, frameRate: 30 } }; // Create PeerConnection self.prepareShareStream = async function (shareConstraints) { if (self.pc === null) { self.pc = new RTCPeerConnection(null); } var stream = await navigator.mediaDevices.getDisplayMedia(shareConstraints); console.log('prepareShareStream:', stream, shareConstraints); // @see https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection/addStream#Migrating_to_addTrack stream.getTracks().forEach(function (track) { console.log('prepareShareStream_track:', track); self.pc.addTrack(track); // Notify about local track when stream is ok. self.ontrack && self.ontrack({ track: track }); }); } // Live streaming self.publishStream = async function (url) { var conf = self.__internal.prepareUrl(url); if (self.pc === null) { console.log("publishStream error: not prepare stream"); return ""; } var offer = await self.pc.createOffer(); await self.pc.setLocalDescription(offer); var session = await new Promise(function (resolve, reject) { // @see https://github.com/rtcdn/rtcdn-draft var data = { api: conf.apiUrl, tid: conf.tid, streamurl: conf.streamUrl, clientip: null, sdp: offer.sdp }; console.log("Generated offer: ", data); axios({ method: "POST", url: conf.apiUrl, data: JSON.stringify(data), contentType: 'application/json', dataType: 'json' }).then(function (response) { var data = response.data; console.log("Got answer: ", data); if (data.code) { reject(data); return; } resolve(data); }).catch(function (reason) { reject(reason); }); }); await self.pc.setRemoteDescription( new RTCSessionDescription({ type: 'answer', sdp: session.sdp }) ); session.simulator = conf.schema + '//' + conf.urlObject.server + ':' + conf.port + '/rtc/v1/nack/'; return session; }
β Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>
TRANS_BY_GPT3
Description
main config for srs.
@see full.conf for detail config.
listen 1935; max_connections 1000;
srs_log_tank file;
srs_log_file ./objs/srs.log;
daemon on; http_api { enabled on; listen 1985; } http_server { enabled on; listen 8080; dir ./objs/nginx/html; } rtc_server { enabled on; listen 8000;
@see https://github.com/ossrs/srs/wiki/v4_CN_WebRTC#config-candidate
} vhost defaultVhost { hls { enabled on; } http_remux { enabled on; mount [vhost]/[app]/[stream].flv; } rtc { enabled on;
@see https://github.com/ossrs/srs/wiki/v4_CN_WebRTC#rtmp-to-rtc
}
screenConstraints = { video: { width: 1280, height: 720, frameRate: 30 } }