ossrs / srs

SRS is a simple, high-efficiency, real-time media server supporting RTMP, WebRTC, HLS, HTTP-FLV, HTTP-TS, SRT, MPEG-DASH, and GB28181.
https://ossrs.io
MIT License
25.37k stars 5.34k forks source link

Chrome screen sharing is streamed to SRS via WebRTC, but clients cannot play it using the WebRTC protocol, and playing it will cause SRS to crash. #2719

Closed moliyadi closed 2 years ago

moliyadi commented 2 years ago

Note: Before asking a question, please read the FAQ (Please read FAQ before filing an issue) https://github.com/ossrs/srs/issues/2716

Description

Please describe your issue here.

  1. SRS version: v4.0.191

  2. SRS log:


[2021-11-05 09:28:04.317][Trace][1][00cx4q57] XCORE-SRS/4.0.191(Leo)
[2021-11-05 09:28:04.317][Trace][1][00cx4q57] config parse complete
[2021-11-05 09:28:04.317][Trace][1][00cx4q57] write log to console
[2021-11-05 09:28:04.317][Trace][1][00cx4q57][MAIN] SRS/4.0.191(Leo), MIT
[2021-11-05 09:28:04.317][Trace][1][00cx4q57] authors: https://github.com/ossrs/srs/blob/4.0release/trunk/AUTHORS.txt
[2021-11-05 09:28:04.317][Trace][1][00cx4q57] contributors: Winlin<winlin@vip.126.com> Winlin<winterserver@126.com> Winlin<chengli.ycl@alibaba-inc.com> Wenjie<zhaowenjie@tal.com> Wenjie<740936897@qq.com> Wenjie<wenjie.zhao@chinacache.com> xiangcheng.liu<liuxc0116@foxmail.com> naijia.liu<youngcow@youngcow.net> alcoholyi<alcoholyi@qq.com> byteman<wangchen2011@gmail.com> chad.wang<chad.wang.cn@gmail.com> suhetao<suhetao@gmail.com> Johnny<fengjihu@163.com> karthikeyan<keyanmca@gmail.com> StevenLiu<lq@chinaffmpeg.org> zhengfl<zhengfl_1989@126.com> tufang14<breadbean1449@gmail.com> allspace<allspace@gmail.com> niesongsong<nie950@gmail.com> rudeb0t<nimrod@themanxgroup.tw> CallMeNP<np.liamg@gmail.com> synote<synote@qq.com> lovecat<littlefawn@163.com> panda1986<542638787@qq.com> YueHonghui<hongf.yue@hotmail.com> ThomasDreibholz<dreibh@simula.no> JuntaoLiu<juntliu@gmail.com> RocFang<fangpeng1986@gmail.com> MakarovYaroslav<yaroslav.makarov.97@mail.ru> MirkoVelic<mvelic@inoxx.net> HuiZhang(huzhang2)<huzhang2@cisco.com> OtterWa<simpleotter23@gmail.com> walkermi<172192667@qq.com> haofz<fuzhuang.hao@vhall.com> ME_Kun_Han<hanvskun@hotmail.com> ljx0305<ljx0305@gmail.com> cenxinwei<censhanhe@163.com> StarBrilliant<m13253@hotmail.com> xubin<xubin@chnvideo.com> intliang<yintiliang@gmail.com> flowerwrong<sysuyangkang@gmail.com> YLX<568414379@qq.com> J<guotaojiang@qq.com> Harlan<hailiang@gvrcraft.com> hankun<hankun@bravovcloud.com> JonathanBarratt<jonathan.barratt@gmail.com> KeeganH<keeganwharris@gmail.com> StevenLiu<lingjiujianke@gmail.com> liuxc0116<liuxc0116@gmail.com> ChengdongZhang<lmajzcd@sina.com> lovacat<lovecat@china.sina.com> qiang.li<qiang.li@verycdn.com.cn> HungMingWu<u9089000@gmail.com> Himer<xishizhaohua@qq.com> XiaLixin<xialixin@kanzhun.com> XiaLixin<68469352@qq.com> XiaLixin<xlx0625@163.com> XiaLixin<xialx@yuntongxun.com> alphonsetai<tyh_123@163.com> Michael.Ma<wnpllr@gmail.com> lam2003<linmin3@yy.com> ShiWei<shiwei05@kuaishou.com> ShiWei<shi.weibd@hotmail.com> XiaofengWang<wasphin@gmail.com> XiaoZhihong<hondaxiao@tencent.com> XiaoZhihong<xiaozhihong8@gmail.com> XiaoZhihong<xiaozhihong@huya.com> yanghuiwen<cainiaodj@qq.com> WuPengqiang<309554135@qq.com> WuPengqiang<pengqiang.wpq@alibaba-inc.com> l<22312935+lam2003@github> xfalcon<x-falcon@github> ChenGuanghua<jinxue.cgh@alibaba-inc.com> ChenGuanghua<chengh_math@126.com> LiPeng<mozhan.lp@alibaba-inc.com> LiPeng<lipeng19811218@gmail.com> yajun18<yajun18@staff.sina.com.cn> liulichuan<liulichuan@kuaishou.com> yapingcat<caoyapingneu@163.com> chenchengbin<chenchengbin@yy.com> ChenHaibo<495810242@qq.com> ChenHaibo<nmgchenhaibo@foxmail.com> jasongwq<jasongwq@gmail.com> yinjiaoyuan<yinjiaoyuan@163.com> PieerePi<pihuibin@hotmail.com> JesseXi<jesse.jinjin@wo.cn> PieerePi<40780488+PieerePi@github> ghostsf<ghost_sf@163.com> xbpeng121<53243357+xbpeng121@github> johzzy<hellojinqiang@gmail.com> stone<bluestn@163.com> cfw11<34058899+cfw11@github> Hung-YiChen<gaod.chen@gmail.com> long<liyalong12345@126.com> matthew1838<77285055+matthew1838@github> rise<rise.worlds@outlook.com>
[2021-11-05 09:28:04.317][Trace][1][00cx4q57] cwd=/usr/local/srs, work_dir=./, build: 2021-11-02 00:12:53, configure: --x86-x64 --srt=on --jobs=2, uname: Linux bd23ee4c1e93 5.8.0-1042-azure #45~20.04.1-Ubuntu SMP Wed Sep 15 14:24:15 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux, osx: 0
[2021-11-05 09:28:04.317][Trace][1][00cx4q57] configure detail: --prefix=/usr/local/srs --hls=on --hds=off --dvr=on --ssl=on --https=on --ssl-1-0=off --ssl-local=off --sys-ssl=off --transcode=on --ingest=on --stat=on --http-callback=on --http-server=on --stream-caster=on --http-api=on --utest=off --cherrypy=off --srt=on --rtc=on --simulator=off --cxx11=on --cxx14=off --ffmpeg-fit=on --nasm=on --srtp-nasm=on --clean=on --gperf=off --gmc=off --gmd=off --gmp=off --gcp=off --gprof=off --static=off --shared-st=off --shared-srt=off --shared-ffmpeg=off --log-verbose=off --log-info=off --log-trace=on --gcov=off --debug=off --debug-stats=off --cross-build=off --cc=gcc --cxx=g++ --ar=ar --ld=ld --randlib=randlib
[2021-11-05 09:28:04.317][Trace][1][00cx4q57] srs checking config...
[2021-11-05 09:28:04.317][Trace][1][00cx4q57] ips, iface[0] eth0 ipv4 0x11043 172.17.0.2
[2021-11-05 09:28:04.317][Trace][1][00cx4q57] devices, intranet eth0 172.17.0.2
[2021-11-05 09:28:04.317][Warn][1][00cx4q57][22] stats network use index=0, ip=172.17.0.2, ifname=eth0
[2021-11-05 09:28:04.317][Warn][1][00cx4q57][22] stats disk not configed, disk iops disabled.
[2021-11-05 09:28:04.317][Trace][1][00cx4q57] write log to console
[2021-11-05 09:28:04.317][Trace][1][00cx4q57] features, rch:on, dash:on, hls:on, hds:off, srt:on, hc:on, ha:on, hs:on, hp:on, dvr:on, trans:on, inge:on, stat:on, sc:on
[2021-11-05 09:28:04.317][Trace][1][00cx4q57] SRS on  amd64 x86_64, conf:conf/srs.conf, limit:1000, writev:1024, encoding:little-endian, HZ:100
[2021-11-05 09:28:04.317][Trace][1][00cx4q57] mw sleep:350ms. mr enabled:on, default:0, sleep:350ms
[2021-11-05 09:28:04.317][Trace][1][00cx4q57] gc:on, pq:30000ms, cscc:[0,16), csa:on, tn:on(may hurts performance), ss:auto(guess by merged write)
[2021-11-05 09:28:04.317][Trace][1][00cx4q57] system default latency(ms): mw(0-350) + mr(0-350) + play-queue(0-30000)
[2021-11-05 09:28:04.317][Warn][1][00cx4q57][22] SRS/4.0.191 is not stable
[2021-11-05 09:28:04.317][Warn][1][00cx4q57][22] disable daemon for docker
[2021-11-05 09:28:04.319][Trace][1][00cx4q57] fingerprint=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
[2021-11-05 09:28:04.319][Trace][1][00cx4q57] CircuitBreaker: enabled=1, high=2x90, critical=1x95, dying=5x99
[2021-11-05 09:28:04.320][Trace][1][00cx4q57] http flv live stream, vhost=__defaultVhost__, mount=[vhost]/[app]/[stream].flv
[2021-11-05 09:28:04.320][Trace][1][00cx4q57] http: root mount to ./objs/nginx/html
[2021-11-05 09:28:04.320][Trace][1][00cx4q57] server main cid=00cx4q57, pid=1, ppid=0, asprocess=0
[2021-11-05 09:28:04.320][Trace][1][00cx4q57] write pid=1 to ./objs/srs.pid success!
[2021-11-05 09:28:04.320][Trace][1][00cx4q57] RTMP listen at tcp://0.0.0.0:1935, fd=7
[2021-11-05 09:28:04.320][Trace][1][00cx4q57] HTTP-API listen at tcp://0.0.0.0:1985, fd=8
[2021-11-05 09:28:04.321][Trace][1][00cx4q57] HTTP-Server listen at tcp://0.0.0.0:8080, fd=9
[2021-11-05 09:28:04.321][Trace][1][00cx4q57] signal installed, reload=1, reopen=10, fast_quit=15, grace_quit=3
[2021-11-05 09:28:04.321][Trace][1][00cx4q57] http: api mount /console to ./objs/nginx/html/console
[2021-11-05 09:28:04.321][Trace][1][00cx4q57] rtc listen at udp://0.0.0.0:8000, fd=10
[2021-11-05 09:28:04.321][Trace][1][mt340542] Hybrid cpu=0.00%,12MB
[2021-11-05 09:28:04.321][Warn][1][30ktgd78][22] use private address as ip: 172.17.0.2, ifname=eth0
[2021-11-05 09:28:04.321][Trace][1][30ktgd78] Startup query id=ad89d9763e1a11eca25e7f51c3e47629, eip=172.17.0.2, wait=575s
[2021-11-05 09:28:04.321][Trace][1][7y7pfa7j] TCP: connection manager run, conns=0
[2021-11-05 09:28:04.321][Warn][1][00cx4q57][11] enable auto reload for docker
[2021-11-05 09:28:04.321][Trace][1][00cx4q57] auto reload watching fd=11, watch=1, file=conf
[2021-11-05 09:28:04.322][Trace][1][430503j6] UDP #10 LISTEN at 0.0.0.0:8000, SO_SNDBUF(default=212992, expect=10485760, actual=425984, r0=0), SO_RCVBUF(default=212992, expect=10485760, actual=425984, r0=0)
[2021-11-05 09:28:04.322][Trace][1][14789672] RTC: connection manager run, conns=0
[2021-11-05 09:28:09.316][Trace][1][mt340542] Hybrid cpu=0.00%,12MB
[2021-11-05 09:28:14.316][Trace][1][mt340542] Hybrid cpu=0.00%,12MB
[2021-11-05 09:28:19.317][Trace][1][mt340542] Hybrid cpu=0.00%,12MB, cid=1,1, timer=63,0,0, clock=0,49,1,0,0,0,0,0,0
[2021-11-05 09:28:23.915][Trace][1][ae621h67] HTTP #0 192.168.124.101:50376 POST http://192.168.124.211:1985/rtc/v1/publish/, content-length=4635
[2021-11-05 09:28:23.916][Trace][1][ae621h67] RTC publish webrtc://192.168.124.211/123456/4a1a397s1, api=http://192.168.124.211:1985/rtc/v1/publish/, tid=22ef503, clientip=192.168.124.101, app=123456, stream=4a1a397s1, offer=4221B, eip=, codec=
[2021-11-05 09:28:23.916][Trace][1][ae621h67] ignore attribute=, value=
[2021-11-05 09:28:23.916][Trace][1][ae621h67] new source, stream_url=/123456/4a1a397s1
[2021-11-05 09:28:23.916][Trace][1][ae621h67] RTC publisher nack=1, nnc=1, pt-drop=0, twcc=1/4
[2021-11-05 09:28:23.916][Trace][1][ae621h67] RTC: Init tracks {track: 0d40516c-a535-42f4-bd17-116e9bd96992, is_active: 0=>1}, ok
[2021-11-05 09:28:23.916][Trace][1][ae621h67] RTC: Use candidates 192.168.124.211
[2021-11-05 09:28:23.917][Trace][1][ae621h67] RTC init session, user=93s9h299:lUjZ, url=/123456/4a1a397s1, encrypt=1/1, DTLS(role=passive, version=auto), timeout=30000ms, nack=1
[2021-11-05 09:28:23.917][Trace][1][ae621h67] RTC username=93s9h299:lUjZ, offer=4221B, answer=867B
[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
[2021-11-05 09:28:24.318][Trace][1][mt340542] Hybrid cpu=0.00%,12MB, cid=1,1, timer=63,0,0, clock=0,49,1,0,0,0,0,0,0
[2021-11-05 09:28:24.318][Trace][1][mt340542] RTC: Server conns=1
[2021-11-05 09:28:24.825][Trace][1][ae621h67] TCP: before dispose resource(HttpConn)(0x2facd70), conns=1, zombies=0, ign=0, inz=0, ind=0
[2021-11-05 09:28:24.825][Warn][1][ae621h67][104] client disconnect peer. ret=1007
[2021-11-05 09:28:24.825][Trace][1][7y7pfa7j] TCP: clear zombies=1 resources, conns=1, removing=0, unsubs=0
[2021-11-05 09:28:24.825][Trace][1][ae621h67] TCP: disposing #0 resource(HttpConn)(0x2facd70), conns=1, disposing=1, zombies=0
[2021-11-05 09:28:24.843][Trace][1][ae621h67] RTC: session address init 10.211.55.2:60402
[2021-11-05 09:28:24.843][Trace][1][ae621h67] RTC: session STUN done, waiting DTLS handshake.
[2021-11-05 09:28:24.843][Trace][1][430503j6] <- RTC RECV #10, udp 1, pps 0/0, schedule 1
[2021-11-05 09:28:24.883][Trace][1][ae621h67] RTC: session address change 10.211.55.2:60402 -> 10.37.129.2:64848, cached=0, nn_change=1/1, nn_address=1
[2021-11-05 09:28:24.932][Trace][1][ae621h67] RTC: session address change 10.37.129.2:64848 -> 192.168.124.101:59391, cached=0, nn_change=2/1, nn_address=2
[2021-11-05 09:28:24.936][Trace][1][ae621h67] DTLS: State Passive RECV, done=0, arq=0/0, r0=1, r1=0, len=157, cnt=22, size=144, hs=1
[2021-11-05 09:28:24.936][Trace][1][ae621h67] DTLS: State Passive SEND, done=0, arq=0/0, r0=-1, r1=2, len=682, cnt=22, size=82, hs=2
[2021-11-05 09:28:24.944][Trace][1][ae621h67] DTLS: State Passive RECV, done=0, arq=0/0, r0=1, r1=0, len=578, cnt=22, size=299, hs=11
[2021-11-05 09:28:24.944][Trace][1][ae621h67] DTLS: State Passive SEND, done=1, arq=0/0, r0=1, r1=0, len=554, cnt=22, size=466, hs=4
[2021-11-05 09:28:24.944][Trace][1][ae621h67] RTC: DTLS handshake done.
[2021-11-05 09:28:24.944][Trace][1][ae621h67] RTC: session pub=1, sub=0, to=30000ms connection established
[2021-11-05 09:28:24.945][Trace][1][ae621h67] RTC: Publisher url=/123456/4a1a397s1 established
[2021-11-05 09:28:25.078][Trace][1][ae621h67] RTC: session address change 192.168.124.101:59391 -> 10.211.55.2:60402, cached=1, nn_change=3/1, nn_address=3
[2021-11-05 09:28:29.318][Trace][1][mt340542] Hybrid cpu=1.00%,13MB, cid=1,1, timer=63,0,0, clock=0,49,1,0,0,0,0,0,0
[2021-11-05 09:28:29.318][Trace][1][mt340542] RTC: Server conns=1
[2021-11-05 09:28:34.319][Trace][1][mt340542] Hybrid cpu=0.00%,14MB, cid=3,3, timer=62,7,34, clock=0,48,1,0,0,0,0,0,0, free=1, objs=(pkt:18,raw:14,fua:3,msg:18,oth:1,buf:18)
[2021-11-05 09:28:34.319][Trace][1][mt340542] RTC: Server conns=1
[2021-11-05 09:28:34.858][Trace][1][430503j6] <- RTC RECV #10, udp 331, pps 10/33, schedule 331
[2021-11-05 09:28:35.338][Trace][1][ae621h67] RTC: session address change 192.168.124.101:59391 -> 10.211.55.2:60402, cached=1, nn_change=26/10, nn_address=3
[2021-11-05 09:28:35.839][Trace][1][ae621h67] RTC: session address change 10.211.55.2:60402 -> 10.37.129.2:64848, cached=1, nn_change=27/11, nn_address=3
[2021-11-05 09:28:37.345][Trace][1][ae621h67] RTC: session address change 10.37.129.2:64848 -> 192.168.124.101:59391, cached=1, nn_change=30/7, nn_address=3
[2021-11-05 09:28:39.320][Trace][1][mt340542] Hybrid cpu=0.00%,14MB, cid=3,3, timer=62,7,34, clock=0,48,1,0,0,0,0,0,0, free=1, objs=(pkt:18,raw:14,fua:3,msg:18,oth:1,buf:18)
[2021-11-05 09:28:39.320][Trace][1][mt340542] RTC: Server conns=1, rpkts=(31,rtp:27,stun:2,rtcp:1), spkts=(13,rtp:0,stun:2,rtcp:20), rtcp=(pli:0,twcc:9,rr:1), snk=(49,a:0,v:49,h:0), fid=(id:1,fid:31,ffid:0,addr:2,faddr:31)
[2021-11-05 09:28:44.321][Trace][1][mt340542] Hybrid cpu=0.00%,14MB, cid=1,2, timer=62,10,49, clock=0,47,1,0,0,0,0,0,0, objs=(pkt:24,raw:24,fua:0,msg:24,oth:0,buf:24)
[2021-11-05 09:28:44.321][Trace][1][mt340542] RTC: Server conns=1, rpkts=(31,rtp:27,stun:2,rtcp:1), spkts=(13,rtp:0,stun:2,rtcp:20), rtcp=(pli:0,twcc:9,rr:1), snk=(49,a:0,v:49,h:0), fid=(id:1,fid:31,ffid:0,addr:2,faddr:31)
[2021-11-05 09:28:44.900][Trace][1][430503j6] <- RTC RECV #10, udp 286, pps 15/28, schedule 286
[2021-11-05 09:28:45.603][Trace][1][5j7co0d1] HTTP #0 192.168.124.101:50462 OPTIONS http://192.168.124.211:1985/rtc/v1/play/, content-length=-1
[2021-11-05 09:28:45.658][Trace][1][5j7co0d1] HTTP #1 192.168.124.101:50462 POST http://192.168.124.211:1985/rtc/v1/play/, content-length=5688
[2021-11-05 09:28:45.659][Trace][1][5j7co0d1] RTC play webrtc://192.168.124.211/123456/4a1a397s1, api=http://192.168.124.211:1985/rtc/v1/play/, tid=198d2da, clientip=192.168.124.101, app=123456, stream=4a1a397s1, offer=5211B, eip=, codec=, srtp=, dtls=
[2021-11-05 09:28:45.659][Trace][1][5j7co0d1] ignore attribute=, value=
  1. SRS configuration:

Use the default configuration conf/srs.conf from the source code:

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

candidate $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

    rtmp_to_rtc off;
    # @see https://github.com/ossrs/srs/wiki/v4_CN_WebRTC#rtc-to-rtmp
    rtc_to_rtmp off;
}

}


> **Replay**

> **How to replay bug?**

1. Use Chrome browser to obtain the shared screen stream using `getDisplayMedia`.

**constraints configuration:**

screenConstraints = { video: { width: 1280, height: 720, frameRate: 30 } }


2. Imitate the publishing logic in [srs.sdk.js](https://github.com/ossrs/signaling/blob/main/www/demos/js/srs.sdk.js) for WebRTC streaming.
3. After streaming, there are no errors reported and there is traffic uploading, but playback is not possible and attempting to play causes the SRS service to crash.
4. Using the built-in RTC player in the SRS demo page also fails to play, and attempting to play also causes the SRS service to crash.

**Expected Behavior (Expect)**

> The client can play WebRTC streaming of Chrome screen sharing normally, similar to camera capture streaming.

`TRANS_BY_GPT3`
xiaozhihong commented 2 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

moliyadi commented 2 years ago
  1. SRS is running using the Docker method, and the above logs are the complete logs printed by SRS from startup to triggering a crash during playback.
  2. Streaming is done using Chrome, based on srs.sdk.js, to obtain the video stream of the shared screen through getDisplayMedia, and then the publish interface of SRS is called for streaming. The publish interface also returns the SDP information of the answer correctly.
  3. If it is possible to obtain the crash stack trace, I can try to reproduce it and get it. Thank you.

TRANS_BY_GPT3

moliyadi commented 2 years ago

@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 commented 2 years ago

@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

moliyadi commented 2 years ago

@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

moliyadi commented 2 years ago

@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

winlinvip commented 2 years ago

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

luojq661 commented 2 years ago

@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

moliyadi commented 2 years ago

@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

linkewei0580 commented 1 year ago
  1. 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;
  2. 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;
  3. 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

moliyadi commented 1 year ago

@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

linkewei0580 commented 1 year ago

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