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.83k stars 5.4k forks source link

After deploying to the server, the RTMP streaming is working fine, but the WebRTC streaming is failing. #3045

Closed wuchjun closed 2 years ago

wuchjun commented 2 years ago

Note: Please read FAQ before file an issue, see 2716

Note: Before asking a question, please refer to the FAQ, specifically 2716.

Description (描述)

After deploying to the server, the RTMP streaming works fine, but the WebRTC streaming fails. I have already checked that the UDP port 8000 is functioning properly using the method mentioned in https://github.com/ossrs/srs/issues/2843. However, when using the RTC console player to play the WebRTC stream, it keeps spinning and unable to request the resource. The log file shows "RTC: session destroy by timeout".

  1. SRS Version: 5.0

  2. SRS Log:

    [root@VM-16-5-centos ~]# CANDIDATE="150.158.149.205"
    [root@VM-16-5-centos ~]# docker run --rm --env CANDIDATE=$CANDIDATE   -p 1935:1935 -p 8080:8080 -p 1985:1985 -p 8000:8000/udp   registry.cn-hangzhou.aliyuncs.com/ossrs/srs:5   objs/srs -c conf/rtmp2rtc.conf
    docker: Error response from daemon: driver failed programming external connectivity on endpoint bold_bartik (3b113345e8c04bc041bc04ddd079a76e1f9719a12234ecfeafaa12c413f918c4): Bind for 0.0.0.0:8080 failed: port is already allocated.
    [root@VM-16-5-centos ~]# docker run --rm --env CANDIDATE=$CANDIDATE   -p 1935:1935 -p 8080:8080 -p 1985:1985 -p 8000:8000/udp   registry.cn-hangzhou.aliyuncs.com/ossrs/srs:5   objs/srs -c conf/rtmp2rtc.conf
    [2022-05-20 10:37:05.529][Trace][1][7ed9fq22] XCORE-SRS/5.0.25(Leo)
    [2022-05-20 10:37:05.529][Trace][1][7ed9fq22] config parse complete
    [2022-05-20 10:37:05.529][Trace][1][7ed9fq22] write log to console
    [2022-05-20 10:37:05.529][Trace][1][7ed9fq22][MAIN] SRS/5.0.25(Leo), MIT
    [2022-05-20 10:37:05.529][Trace][1][7ed9fq22] authors: Winlin<winlin@vip.126.com> ZhaoWenjie<zhaowenjie@tal.com> ShiWei<shiwei05@kuaishou.com> XiaoZhihong<hondaxiao@tencent.com> WuPengqiang<pengqiang.wpq@alibaba-inc.com> XiaLixin<xialixin@kanzhun.com> LiPeng<mozhan.lp@alibaba-inc.com> ChenGuanghua<jinxue.cgh@alibaba-inc.com> ChenHaibo<nmgchenhaibo@foxmail.com> Johzzy<hellojinqiang@gmail.com> Zhouxiaojun2008<279686030@qq.com> Pengfei.ma<pengfei.ma.chn@outlook.com> ZhangJunqin<zhangjunqin@jd.com> and https://github.com/ossrs/srs/blob/develop/trunk/AUTHORS.md#contributors
    [2022-05-20 10:37:05.529][Trace][1][7ed9fq22] cwd=/usr/local/srs, work_dir=./, build: 2022-03-09 00:16:14, configure: --x86-x64 --srt=on --jobs=2, uname: Linux a160d92d4a0e 5.11.0-1028-azure #31~20.04.2-Ubuntu SMP Tue Jan 18 08:46:15 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux, osx: 0, pkg: dcis, region: , source: 
    [2022-05-20 10:37:05.529][Trace][1][7ed9fq22] configure detail: --prefix=/usr/local/srs --config=conf/srs.conf --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
    [2022-05-20 10:37:05.529][Trace][1][7ed9fq22] srs checking config...
    [2022-05-20 10:37:05.529][Trace][1][7ed9fq22] ips, iface[0] eth0 ipv4 0x11043 172.17.0.2
    [2022-05-20 10:37:05.529][Trace][1][7ed9fq22] devices, intranet eth0 172.17.0.2
    [2022-05-20 10:37:05.529][Warn][1][7ed9fq22][22] stats network use index=0, ip=172.17.0.2, ifname=eth0
    [2022-05-20 10:37:05.529][Warn][1][7ed9fq22][22] stats disk not configed, disk iops disabled.
    [2022-05-20 10:37:05.529][Trace][1][7ed9fq22] write log to console
    [2022-05-20 10:37:05.529][Trace][1][7ed9fq22] 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
    [2022-05-20 10:37:05.529][Trace][1][7ed9fq22] SRS on  amd64 x86_64, conf:conf/rtmp2rtc.conf, limit:1000, writev:1024, encoding:little-endian, HZ:100
    [2022-05-20 10:37:05.529][Trace][1][7ed9fq22] mw sleep:350ms. mr enabled:on, default:0, sleep:350ms
    [2022-05-20 10:37:05.529][Trace][1][7ed9fq22] gc:on, pq:30000ms, cscc:[0,16), csa:on, tn:on(may hurts performance), ss:auto(guess by merged write)
    [2022-05-20 10:37:05.529][Trace][1][7ed9fq22] system default latency(ms): mw(0-350) + mr(0-350) + play-queue(0-30000)
    [2022-05-20 10:37:05.529][Warn][1][7ed9fq22][22] SRS/5.0.25 is not stable
    [2022-05-20 10:37:05.532][Trace][1][7ed9fq22] fingerprint=E2:3B:05:1B:74:C4:53:F8:13:03:8F:33:96:E8:C7:B6:B7:2E:EF:5F:6F:AC:53:FD:E4:F1:97:27:5A:88:11:24
    [2022-05-20 10:37:05.532][Trace][1][7ed9fq22] CircuitBreaker: enabled=1, high=2x90, critical=1x95, dying=5x99
    [2022-05-20 10:37:05.532][Trace][1][7ed9fq22] http flv live stream, vhost=__defaultVhost__, mount=[vhost]/[app]/[stream].flv
    [2022-05-20 10:37:05.532][Trace][1][7ed9fq22] http: root mount to ./objs/nginx/html
    [2022-05-20 10:37:05.532][Trace][1][7ed9fq22] server main cid=7ed9fq22, pid=1, ppid=0, asprocess=0
    [2022-05-20 10:37:05.533][Trace][1][7ed9fq22] write pid=1 to ./objs/srs.pid success!
    [2022-05-20 10:37:05.533][Trace][1][7ed9fq22] RTMP listen at tcp://0.0.0.0:1935, fd=7
    [2022-05-20 10:37:05.533][Trace][1][7ed9fq22] HTTP-API listen at tcp://0.0.0.0:1985, fd=8
    [2022-05-20 10:37:05.533][Trace][1][7ed9fq22] HTTP-Server listen at tcp://0.0.0.0:8080, fd=9
    [2022-05-20 10:37:05.533][Trace][1][7ed9fq22] signal installed, reload=1, reopen=10, fast_quit=15, grace_quit=3
    [2022-05-20 10:37:05.533][Trace][1][7ed9fq22] http: api mount /console to ./objs/nginx/html/console
    [2022-05-20 10:37:05.533][Trace][1][7ed9fq22] rtc listen at udp://0.0.0.0:8000, fd=10
    [2022-05-20 10:37:05.533][Trace][1][o92i52ex] Hybrid cpu=0.00%,8MB
    [2022-05-20 10:37:05.533][Warn][1][38665848][22] use private address as ip: 172.17.0.2, ifname=eth0
    [2022-05-20 10:37:05.533][Trace][1][38665848] Startup query id=cadbbcdad82811eca7532d0ec4d45375, eip=172.17.0.2, wait=393s
    [2022-05-20 10:37:05.533][Trace][1][s6548p78] TCP: connection manager run, conns=0
    [2022-05-20 10:37:05.533][Warn][1][7ed9fq22][11] enable auto reload for docker
    [2022-05-20 10:37:05.534][Trace][1][7ed9fq22] auto reload watching fd=11, watch=1, file=conf
    [2022-05-20 10:37:05.534][Trace][1][ook2jw45] 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)
    [2022-05-20 10:37:05.534][Trace][1][7bh85l8z] RTC: connection manager run, conns=0
    [2022-05-20 10:37:10.528][Trace][1][o92i52ex] Hybrid cpu=2.00%,8MB
    [2022-05-20 10:37:14.890][Trace][1][787k2q9p] RTMP client ip=120.230.131.172:48817, fd=12
    [2022-05-20 10:37:14.935][Trace][1][787k2q9p] simple handshake success.
    [2022-05-20 10:37:14.978][Trace][1][787k2q9p] connect app, tcUrl=rtmp://150.158.149.205/live, pageUrl=, swfUrl=rtmp://150.158.149.205/live, schema=rtmp, vhost=150.158.149.205, port=1935, app=live, args=null
    [2022-05-20 10:37:14.978][Trace][1][787k2q9p] protocol in.buffer=0, in.ack=0, out.ack=0, in.chunk=4096, out.chunk=128
    [2022-05-20 10:37:15.120][Trace][1][787k2q9p] client identified, type=fmle-publish, vhost=150.158.149.205, app=live, stream=livestream, param=, duration=0ms
    [2022-05-20 10:37:15.120][Trace][1][787k2q9p] connected stream, tcUrl=rtmp://150.158.149.205/live, pageUrl=, swfUrl=rtmp://150.158.149.205/live, schema=rtmp, vhost=__defaultVhost__, port=1935, app=live, stream=livestream, param=, args=null
    [2022-05-20 10:37:15.120][Trace][1][787k2q9p] new source, stream_url=/live/livestream
    [2022-05-20 10:37:15.120][Trace][1][787k2q9p] source url=/live/livestream, ip=120.230.131.172, cache=1, is_edge=0, source_id=/
    [2022-05-20 10:37:15.303][Trace][1][787k2q9p] new source, stream_url=/live/livestream
    [2022-05-20 10:37:15.305][Trace][1][787k2q9p] RTC bridge from RTMP, rtmp2rtc=1, keep_bframe=0, merge_nalus=0
    [2022-05-20 10:37:15.305][Trace][1][787k2q9p] ignore disabled exec for vhost=__defaultVhost__
    [2022-05-20 10:37:15.305][Trace][1][787k2q9p] http: mount flv stream for sid=/live/livestream, mount=/live/livestream.flv
    [2022-05-20 10:37:15.305][Trace][1][787k2q9p] start publish mr=0/350, p1stpt=20000, pnt=5000, tcp_nodelay=0
    [2022-05-20 10:37:15.443][Trace][1][787k2q9p] got metadata, width=1280, height=720, vcodec=7, acodec=10
    [2022-05-20 10:37:15.523][Trace][1][787k2q9p] 4B audio sh, codec(10, profile=LC, 2channels, 0kbps, 48000HZ), flv(16bits, 2channels, 44100HZ)
    [2022-05-20 10:37:15.523][Trace][1][787k2q9p] 48B video sh,  codec(7, profile=Baseline, level=3.2, 1280x720, 0kbps, 0.0fps, 0.0s)
    [2022-05-20 10:37:15.529][Trace][1][o92i52ex] Hybrid cpu=1.00%,8MB
    [2022-05-20 10:37:20.529][Trace][1][o92i52ex] Hybrid cpu=2.00%,11MB, cid=2,1, timer=62,0,0, clock=0,48,1,0,0,0,0,0,0, objs=(pkt:244,raw:235,fua:8,msg:317,oth:1,buf:17)
    [2022-05-20 10:37:25.530][Trace][1][o92i52ex] Hybrid cpu=2.00%,11MB, cid=2,1, timer=62,0,0, clock=0,48,1,0,0,0,0,0,0, objs=(pkt:244,raw:235,fua:8,msg:317,oth:1,buf:17)
    [2022-05-20 10:37:25.943][Trace][1][36759919] HTTP #0 120.230.131.172:29062 OPTIONS http://150.158.149.205:1985/rtc/v1/play/, content-length=-1
    [2022-05-20 10:37:25.991][Trace][1][36759919] HTTP #1 120.230.131.172:29062 POST http://150.158.149.205:1985/rtc/v1/play/, content-length=6517
    [2022-05-20 10:37:25.992][Trace][1][36759919] RTC play webrtc://150.158.149.205/live/livestream, api=http://150.158.149.205:1985/rtc/v1/play/, tid=16d7b8f, clientip=120.230.131.172, app=live, stream=livestream, offer=5983B, eip=, codec=, srtp=, dtls=
    [2022-05-20 10:37:25.992][Trace][1][36759919] ignore attribute=, value=
    [2022-05-20 10:37:25.993][Trace][1][36759919] RTC player nack=1, nnc=1
    [2022-05-20 10:37:25.993][Trace][1][36759919] RTC connection player gcc=3
    [2022-05-20 10:37:25.993][Trace][1][36759919] RTC: Init tracks {track: video-dp2t2f92, is_active: 0=>1},{track: audio-dg03324v, is_active: 0=>1}, ok
    [2022-05-20 10:37:25.993][Trace][1][36759919] RTC: Use candidates 150.158.149.205
    [2022-05-20 10:37:25.994][Trace][1][36759919] RTC init session, user=q99b1f56:fX7r, url=/live/livestream, encrypt=1/1, DTLS(role=passive, version=auto), timeout=30000ms, nack=1
    [2022-05-20 10:37:25.994][Trace][1][36759919] RTC username=q99b1f56:fX7r, dtls=1, srtp=1, offer=5983B, answer=1530B
    [2022-05-20 10:37:25.994][Trace][1][36759919] RTC remote offer: v=0\r\no=- 360047889863912128 2 IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\na=group:BUNDLE 0 1\r\na=extmap-allow-mixed\r\na=msid-semantic: WMS\r\nm=audio 9 UDP/TLS/RTP/SAVPF 111 63 103 104 9 0 8 106 105 13 110 112 113 126\r\nc=IN IP4 0.0.0.0\r\na=rtcp:9 IN IP4 0.0.0.0\r\na=ice-ufrag:fX7r\r\na=ice-pwd:OkevUZlOVrg+So3O8091ukoN\r\na=ice-options:trickle\r\na=fingerprint:sha-256 DD:53:CF:EF:AF:3B:97:F0:45:53:FD:5D:9F:D5:6A:44:F8:E9:D6:B2:AA:2A:C3:1B:03:77:4F:C8:6B:06:0F:9A\r\na=setup:actpass\r\na=mid:0\r\na=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level\r\na=extmap:2 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time\r\na=extmap:3 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01\r\na=extmap:4 urn:ietf:params:rtp-hdrext:sdes:mid\r\na=recvonly\r\na=rtcp-mux\r\na=rtpmap:111 opus/48000/2\r\na=rtcp-fb:111 transport-cc\r\na=fmtp:111 minptime=10;useinbandfec=1\r\na=rtpmap:63 red/48000/2\r\na=fmtp:63 111/111\r\na=rtpmap:103 ISAC/16000\r\na=rtpmap:104 ISAC/32000\r\na=rtpmap:9 G722/8000\r\na=rtpmap:0 PCMU/8000\r\na=rtpmap:8 PCMA/8000\r\na=rtpmap:106 CN/32000\r\na=rtpmap:105 CN/16000\r\na=rtpmap:13 CN/8000\r\na=rtpmap:110 telephone-event/48000\r\na=rtpmap:112 telephone-event/32000\r\na=rtpmap:113 telephone-event/16000\r\na=rtpmap:126 telephone-event/8000\r\nm=video 9 UDP/TLS/RTP/SAVPF 96 97 98 99 100 101 102 122 127 121 125 107 108 109 124 120 123 119 35 36 37 38 39 40 41 42 114 115 116 117 118 43\r\nc=IN IP4 0.0.0.0\r\na=rtcp:9 IN IP4 0.0.0.0\r\na=ice-ufrag:fX7r\r\na=ice-pwd:OkevUZlOVrg+So3O8091ukoN\r\na=ice-options:trickle\r\na=fingerprint:sha-256 DD:53:CF:EF:AF:3B:97:F0:45:53:FD:5D:9F:D5:6A:44:F8:E9:D6:B2:AA:2A:C3:1B:03:77:4F:C8:6B:06:0F:9A\r\na=setup:actpass\r\na=mid:1\r\na=extmap:14 urn:ietf:params:rtp-hdrext:toffset\r\na=extmap:2 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time\r\na=extmap:13 urn:3gpp:video-orientation\r\na=extmap:3 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:4 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=recvonly\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 VP9/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 profile-id=1\r\na=rtpmap:122 rtx/90000\r\na=fmtp:122 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=1;profile-level-id=42001f\r\na=rtpmap:121 rtx/90000\r\na=fmtp:121 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=0;profile-level-id=42001f\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=1;profile-level-id=42e01f\r\na=rtpmap:109 rtx/90000\r\na=fmtp:109 apt=108\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=0;profile-level-id=42e01f\r\na=rtpmap:120 rtx/90000\r\na=fmtp:120 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=4d001f\r\na=rtpmap:119 rtx/90000\r\na=fmtp:119 apt=123\r\na=rtpmap:35 H264/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=fmtp:35 level-asymmetry-allowed=1;packetization-mode=0;profile-level-id=4d001f\r\na=rtpmap:36 rtx/90000\r\na=fmtp:36 apt=35\r\na=rtpmap:37 H264/90000\r\na=rtcp-fb:37 goog-remb\r\na=rtcp-fb:37 transport-cc\r\na=rtcp-fb:37 ccm fir\r\na=rtcp-fb:37 nack\r\na=rtcp-fb:37 nack pli\r\na=fmtp:37 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=f4001f\r\na=rtpmap:38 rtx/90000\r\na=fmtp:38 apt=37\r\na=rtpmap:39 H264/90000\r\na=rtcp-fb:39 goog-remb\r\na=rtcp-fb:39 transport-cc\r\na=rtcp-fb:39 ccm fir\r\na=rtcp-fb:39 nack\r\na=rtcp-fb:39 nack pli\r\na=fmtp:39 level-asymmetry-allowed=1;packetization-mode=0;profile-level-id=f4001f\r\na=rtpmap:40 rtx/90000\r\na=fmtp:40 apt=39\r\na=rtpmap:41 AV1/90000\r\na=rtcp-fb:41 goog-remb\r\na=rtcp-fb:41 transport-cc\r\na=rtcp-fb:41 ccm fir\r\na=rtcp-fb:41 nack\r\na=rtcp-fb:41 nack pli\r\na=rtpmap:42 rtx/90000\r\na=fmtp:42 apt=41\r\na=rtpmap:114 H264/90000\r\na=rtcp-fb:114 goog-remb\r\na=rtcp-fb:114 transport-cc\r\na=rtcp-fb:114 ccm fir\r\na=rtcp-fb:114 nack\r\na=rtcp-fb:114 nack pli\r\na=fmtp:114 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=64001f\r\na=rtpmap:115 rtx/90000\r\na=fmtp:115 apt=114\r\na=rtpmap:116 red/90000\r\na=rtpmap:117 rtx/90000\r\na=fmtp:117 apt=116\r\na=rtpmap:118 ulpfec/90000\r\na=rtpmap:43 flexfec-03/90000\r\na=rtcp-fb:43 goog-remb\r\na=rtcp-fb:43 transport-cc\r\na=fmtp:43 repair-window=10000000\r\n
    [2022-05-20 10:37:25.994][Trace][1][36759919] RTC local answer: v=0\r\no=SRS/5.0.25(Leo) 25758416 2 IN IP4 0.0.0.0\r\ns=SRSPlaySession\r\nt=0 0\r\na=ice-lite\r\na=group:BUNDLE 0 1\r\na=msid-semantic: WMS live/livestream\r\nm=audio 9 UDP/TLS/RTP/SAVPF 111\r\nc=IN IP4 0.0.0.0\r\na=ice-ufrag:q99b1f56\r\na=ice-pwd:533ilc6493feig304435146h997z5651\r\na=fingerprint:sha-256 E2:3B:05:1B:74:C4:53:F8:13:03:8F:33:96:E8:C7:B6:B7:2E:EF:5F:6F:AC:53:FD:E4:F1:97:27:5A:88:11:24\r\na=setup:passive\r\na=mid:0\r\na=extmap:3 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01\r\na=sendonly\r\na=rtcp-mux\r\na=rtcp-rsize\r\na=rtpmap:111 opus/48000/2\r\na=rtcp-fb:111 transport-cc\r\na=ssrc:10104 cname:io0317ku65309gz6\r\na=ssrc:10104 label:audio-dg03324v\r\na=candidate:0 1 udp 2130706431 150.158.149.205 8000 typ host generation 0\r\nm=video 9 UDP/TLS/RTP/SAVPF 108\r\nc=IN IP4 0.0.0.0\r\na=ice-ufrag:q99b1f56\r\na=ice-pwd:533ilc6493feig304435146h997z5651\r\na=fingerprint:sha-256 E2:3B:05:1B:74:C4:53:F8:13:03:8F:33:96:E8:C7:B6:B7:2E:EF:5F:6F:AC:53:FD:E4:F1:97:27:5A:88:11:24\r\na=setup:passive\r\na=mid:1\r\na=extmap:3 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01\r\na=sendonly\r\na=rtcp-mux\r\na=rtcp-rsize\r\na=rtpmap:108 H264/90000\r\na=rtcp-fb:108 transport-cc\r\na=rtcp-fb:108 nack\r\na=rtcp-fb:108 nack pli\r\na=fmtp:108 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f\r\na=ssrc:10105 cname:io0317ku65309gz6\r\na=ssrc:10105 label:video-dp2t2f92\r\na=candidate:0 1 udp 2130706431 150.158.149.205 8000 typ host generation 0\r\n
    [2022-05-20 10:37:26.090][Trace][1][36759919] TCP: before dispose resource(HttpConn)(0x181fb10), conns=2, zombies=0, ign=0, inz=0, ind=0
    [2022-05-20 10:37:26.090][Warn][1][36759919][104] client disconnect peer. ret=1007
    [2022-05-20 10:37:26.090][Trace][1][s6548p78] TCP: clear zombies=1 resources, conns=2, removing=0, unsubs=0
    [2022-05-20 10:37:26.090][Trace][1][36759919] TCP: disposing #0 resource(HttpConn)(0x181fb10), conns=2, disposing=1, zombies=0
    [2022-05-20 10:37:30.530][Trace][1][o92i52ex] Hybrid cpu=3.00%,12MB, cid=2,1, timer=62,0,22, clock=0,44,4,0,0,0,0,0,0, free=1, objs=(pkt:724,raw:699,fua:23,msg:937,oth:1,buf:50)
    [2022-05-20 10:37:30.531][Trace][1][o92i52ex] RTC: Server conns=1
    [2022-05-20 10:37:35.531][Trace][1][o92i52ex] Hybrid cpu=3.00%,12MB, cid=2,1, timer=62,0,22, clock=0,44,4,0,0,0,0,0,0, free=1, objs=(pkt:724,raw:699,fua:23,msg:937,oth:1,buf:50)
    [2022-05-20 10:37:35.531][Trace][1][o92i52ex] RTC: Server conns=1
    [2022-05-20 10:37:40.303][Trace][1][787k2q9p] <- CPB time=19994872, okbps=1,0,0, ikbps=1194,0,0, mr=0/350, p1stpt=20000, pnt=5000
    [2022-05-20 10:37:40.531][Trace][1][o92i52ex] Hybrid cpu=3.00%,12MB, cid=1,0, timer=61,0,48, clock=0,44,4,0,0,0,0,0,0, objs=(pkt:724,raw:703,fua:19,msg:938,oth:1,buf:50)
    [2022-05-20 10:37:40.531][Trace][1][o92i52ex] RTC: Server conns=1
    [2022-05-20 10:37:45.531][Trace][1][o92i52ex] Hybrid cpu=2.00%,12MB, cid=1,0, timer=61,0,48, clock=0,44,4,0,0,0,0,0,0, objs=(pkt:724,raw:703,fua:19,msg:938,oth:1,buf:50)
    [2022-05-20 10:37:45.531][Trace][1][o92i52ex] RTC: Server conns=1
    [2022-05-20 10:37:50.305][Trace][1][787k2q9p] <- CPB time=29995903, okbps=1,1,0, ikbps=1194,1193,0, mr=0/350, p1stpt=20000, pnt=5000
    [2022-05-20 10:37:50.532][Trace][1][o92i52ex] Hybrid cpu=3.00%,12MB, cid=1,0, timer=61,0,48, clock=0,44,4,0,0,0,0,0,0, objs=(pkt:724,raw:703,fua:19,msg:938,oth:1,buf:50)
    [2022-05-20 10:37:50.532][Trace][1][o92i52ex] RTC: Server conns=1
    [2022-05-20 10:37:55.533][Trace][1][o92i52ex] Hybrid cpu=2.00%,12MB, cid=1,0, timer=62,0,48, clock=0,44,4,0,0,0,0,0,0, objs=(pkt:722,raw:702,fua:19,msg:936,oth:1,buf:51)
    [2022-05-20 10:37:55.533][Trace][1][o92i52ex] RTC: Server conns=1
    [2022-05-20 10:38:00.306][Trace][1][787k2q9p] <- CPB time=40011085, okbps=0,1,0, ikbps=1187,1193,0, mr=0/350, p1stpt=20000, pnt=5000
    [2022-05-20 10:38:00.533][Trace][1][o92i52ex] Hybrid cpu=1.00%,12MB, cid=1,0, timer=62,0,48, clock=0,44,4,0,0,0,0,0,0, objs=(pkt:722,raw:702,fua:19,msg:936,oth:1,buf:51)
    [2022-05-20 10:38:00.533][Trace][1][36759919] RTC: session destroy by timeout, username=q99b1f56:fX7r
    [2022-05-20 10:38:00.533][Trace][1][36759919] RTC: before dispose resource(RtcConn)(0x1890ad0), conns=1, zombies=0, ign=0, inz=0, ind=0
    [2022-05-20 10:38:00.533][Trace][1][36759919] RTC: session detach from [36759919](RtcConn), disposing=1
    [2022-05-20 10:38:00.533][Trace][1][7bh85l8z] RTC: clear zombies=1 resources, conns=1, removing=0, unsubs=0
    [2022-05-20 10:38:00.533][Trace][1][36759919] RTC: disposing #0 resource(RtcConn)(0x1890ad0), conns=1, disposing=1, zombies=0
    [2022-05-20 10:38:00.533][Warn][1][36759919][11][DTLS_HANG] DTLS: Hang, done=0, version=-1, arq=0
    [2022-05-20 10:38:05.533][Trace][1][o92i52ex] Hybrid cpu=2.00%,12MB, cid=1,0, timer=62,0,48, clock=0,44,4,0,0,0,0,0,0, objs=(pkt:722,raw:702,fua:19,msg:936,oth:1,buf:51)
    ^C[2022-05-20 10:38:08.761][Trace][1][7ed9fq22] sig=2, user terminate program, fast quit
    [2022-05-20 10:38:09.564][Trace][1][7ed9fq22] cleanup for quit signal fast=1, grace=0
  3. SRS Config:

Use the default configuration file located at conf/rtmp2rtc.conf in the project.

listen              1935;
max_connections     1000;
daemon              off;
srs_log_tank        console;

http_server {
    enabled         on;
    listen          8080;
    dir             ./objs/nginx/html;
}

http_api {
    enabled         on;
    listen          1985;
}
stats {
    network         0;
}
rtc_server {
    enabled on;
    listen 8000; # UDP port
    # @see https://github.com/ossrs/srs/wiki/v4_CN_WebRTC#config-candidate
    candidate $CANDIDATE;
}

vhost __defaultVhost__ {
    rtc {
        enabled     on;
        # @see https://github.com/ossrs/srs/wiki/v4_CN_WebRTC#rtmp-to-rtc
        rtmp_to_rtc on;
        # @see https://github.com/ossrs/srs/wiki/v4_CN_WebRTC#rtc-to-rtmp
        rtc_to_rtmp on;
    }
    http_remux {
        enabled     on;
        mount       [vhost]/[app]/[stream].flv;
    }
}

Replay (重现)

**1. Change the candidate to the server's public IP address.

  1. Install and start SRS on the server using the rtmp2rtc.conf file from the conf directory.**

Expect (Expected Behavior)

I hope to find out the cause and be able to use WebRTC for streaming normally. Thank you.

TRANS_BY_GPT3

winlinvip commented 2 years ago

How to reproduce this issue? Reproducing means how can I perform actions to see this issue.

TRANS_BY_GPT3

wuchjun commented 2 years ago

How to reproduce this issue? Reproducing means how can I perform actions to see this issue.

Currently, I am experiencing this issue when running the following command to start SRS on a Linux server and the Linux subsystem of Win11 (CANDIDATE settings: 150.158.149.205 as the server's public IP, and 192.168.153.27 as the IP of the Linux subsystem's eth0 network card).

export CANDIDATE="150.158.149.205"
docker run --rm --env CANDIDATE=$CANDIDATE \
-p 1935:1935 -p 8080:8080 -p 1985:1985 -p 8000:8000/udp \
registry.cn-hangzhou.aliyuncs.com/ossrs/srs:5 \
objs/srs -c conf/rtmp2rtc.conf

Then, use OBS to stream the camera video to the corresponding address rtmp://150.158.149.205/live/livestream, or use Docker to stream RTMP to the local machine.

docker run --rm --network=host registry.cn-hangzhou.aliyuncs.com/ossrs/srs:encoder ffmpeg -re -i ./doc/source.flv \
-c copy -f flv rtmp://localhost/live/livestream

TRANS_BY_GPT3

wuchjun commented 2 years ago

Also try specifying the IP address in the URL using ?eip=x, the same problem occurs. In the player's F12, you can see that the interface request returns 200 and code: 0.

TRANS_BY_GPT3

wuchjun commented 2 years ago

Found the problem, the issue was caused by the Chrome browser extension, playback is normal in incognito mode.

TRANS_BY_GPT3