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

webrtc playback error, modifying configuration file is also ineffective #3527

Closed duantuidp closed 1 year ago

duantuidp commented 1 year ago

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

Description

Please description your issue here

  1. SRS Version: 4.0.268

  2. SRS Log:

[2023-04-24 15:32:34.964][Warn][1][k3cl9lt3][104] client disconnect peer. ret=1007
[2023-04-24 15:32:34.964][Trace][1][3n463fuz] TCP: clear zombies=1 resources, conns=4, removing=0, unsubs=0
[2023-04-24 15:32:34.964][Trace][1][k3cl9lt3] TCP: disposing #0 resource(HttpStream)(0x5624e2460580), conns=4, disposing=1, zombies=0
[2023-04-24 15:32:34.968][Trace][1][8c8o0850] TCP: before dispose resource(HttpStream)(0x5624e2444350), conns=3, zombies=0, ign=0, inz=0, ind=0
[2023-04-24 15:32:34.968][Warn][1][8c8o0850][104] client disconnect peer. ret=1007
[2023-04-24 15:32:34.968][Trace][1][3n463fuz] TCP: clear zombies=1 resources, conns=3, removing=0, unsubs=0
[2023-04-24 15:32:34.968][Trace][1][8c8o0850] TCP: disposing #0 resource(HttpStream)(0x5624e2444350), conns=3, disposing=1, zombies=0
[2023-04-24 15:32:35.035][Trace][1][z20u572o] HTTP #0 112.16.164.241:55929 OPTIONS http://123.60.142.88:1985/rtc/v1/play/, content-length=-1
[2023-04-24 15:32:35.084][Trace][1][z20u572o] HTTP #1 112.16.164.241:55929 POST http://123.60.142.88:1985/rtc/v1/play/, content-length=6763
[2023-04-24 15:32:35.084][Trace][1][z20u572o] RTC play webrtc://123.60.142.88/live/livestream/livestream.flv, api=http://123.60.142.88:1985/rtc/v1/play/, tid=1881cc5, clientip=112.16.164.241, app=live/livestream, stream=livestream.flv, offer=6194B, eip=, codec=, srtp=, dtls=
[2023-04-24 15:32:35.084][Trace][1][z20u572o] ignore attribute=, value=
[2023-04-24 15:32:35.085][Trace][1][z20u572o] RTC player nack=1, nnc=1
[2023-04-24 15:32:35.085][Trace][1][z20u572o] RTC connection player gcc=3
[2023-04-24 15:32:35.085][Trace][1][z20u572o] RTC: Init tracks {track: video-733f5794, is_active: 0=>1},{track: audio-o2518200, is_active: 0=>1}, ok
[2023-04-24 15:32:35.085][Trace][1][z20u572o] RTC: Use candidates 123.60.142.88
[2023-04-24 15:32:35.085][Trace][1][z20u572o] RTC init session, user=a150v1l7:pLMP, url=/live/livestream/livestream.flv, encrypt=1/1, DTLS(role=passive, version=auto), timeout=30000ms, nack=1
[2023-04-24 15:32:35.085][Trace][1][z20u572o] RTC username=a150v1l7:pLMP, dtls=1, srtp=1, offer=6194B, answer=1548B
[2023-04-24 15:32:35.085][Trace][1][z20u572o] RTC remote offer: v=0\r\no=- 144749447840467786 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 9 0 8 13 110 126\r\nc=IN IP4 0.0.0.0\r\na=rtcp:9 IN IP4 0.0.0.0\r\na=ice-ufrag:pLMP\r\na=ice-pwd:o9fvwxXY4hdXsQ+IPhPD7y0Y\r\na=ice-options:trickle\r\na=fingerprint:sha-256 18:67:CA:C0:C2:B2:09:0E:D3:FB:63:2C:4B:C1:CF:97:6D:B7:D5:F6:C6:2C:25:A3:B3:5C:63:1B:15:33:42:A6\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:9 G722/8000\r\na=rtpmap:0 PCMU/8000\r\na=rtpmap:8 PCMA/8000\r\na=rtpmap:13 CN/8000\r\na=rtpmap:110 telephone-event/48000\r\na=rtpmap:126 telephone-event/8000\r\nm=video 9 UDP/TLS/RTP/SAVPF 96 97 98 99 100 101 35 36 37 38 102 103 104 105 106 107 108 109 127 125 39 40 41 42 43 44 45 46 47 48 112 113 114 115 116 49\r\nc=IN IP4 0.0.0.0\r\na=rtcp:9 IN IP4 0.0.0.0\r\na=ice-ufrag:pLMP\r\na=ice-pwd:o9fvwxXY4hdXsQ+IPhPD7y0Y\r\na=ice-options:trickle\r\na=fingerprint:sha-256 18:67:CA:C0:C2:B2:09:0E:D3:FB:63:2C:4B:C1:CF:97:6D:B7:D5:F6:C6:2C:25:A3:B3:5C:63:1B:15:33:42:A6\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:35 VP9/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 profile-id=1\r\na=rtpmap:36 rtx/90000\r\na=fmtp:36 apt=35\r\na=rtpmap:37 VP9/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 profile-id=3\r\na=rtpmap:38 rtx/90000\r\na=fmtp:38 apt=37\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:103 rtx/90000\r\na=fmtp:103 apt=102\r\na=rtpmap:104 H264/90000\r\na=rtcp-fb:104 goog-remb\r\na=rtcp-fb:104 transport-cc\r\na=rtcp-fb:104 ccm fir\r\na=rtcp-fb:104 nack\r\na=rtcp-fb:104 nack pli\r\na=fmtp:104 level-asymmetry-allowed=1;packetization-mode=0;profile-level-id=42001f\r\na=rtpmap:105 rtx/90000\r\na=fmtp:105 apt=104\r\na=rtpmap:106 H264/90000\r\na=rtcp-fb:106 goog-remb\r\na=rtcp-fb:106 transport-cc\r\na=rtcp-fb:106 ccm fir\r\na=rtcp-fb:106 nack\r\na=rtcp-fb:106 nack pli\r\na=fmtp:106 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f\r\na=rtpmap:107 rtx/90000\r\na=fmtp:107 apt=106\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: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=4d001f\r\na=rtpmap:125 rtx/90000\r\na=fmtp:125 apt=127\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=4d001f\r\na=rtpmap:40 rtx/90000\r\na=fmtp:40 apt=39\r\na=rtpmap:41 H264/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=fmtp:41 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=f4001f\r\na=rtpmap:42 rtx/90000\r\na=fmtp:42 apt=41\r\na=rtpmap:43 H264/90000\r\na=rtcp-fb:43 goog-remb\r\na=rtcp-fb:43 transport-cc\r\na=rtcp-fb:43 ccm fir\r\na=rtcp-fb:43 nack\r\na=rtcp-fb:43 nack pli\r\na=fmtp:43 level-asymmetry-allowed=1;packetization-mode=0;profile-level-id=f4001f\r\na=rtpmap:44 rtx/90000\r\na=fmtp:44 apt=43\r\na=rtpmap:45 AV1/90000\r\na=rtcp-fb:45 goog-remb\r\na=rtcp-fb:45 transport-cc\r\na=rtcp-fb:45 ccm fir\r\na=rtcp-fb:45 nack\r\na=rtcp-fb:45 nack pli\r\na=rtpmap:46 rtx/90000\r\na=fmtp:46 apt=45\r\na=rtpmap:47 AV1/90000\r\na=rtcp-fb:47 goog-remb\r\na=rtcp-fb:47 transport-cc\r\na=rtcp-fb:47 ccm fir\r\na=rtcp-fb:47 nack\r\na=rtcp-fb:47 nack pli\r\na=fmtp:47 profile=1\r\na=rtpmap:48 rtx/90000\r\na=fmtp:48 apt=47\r\na=rtpmap:112 H264/90000\r\na=rtcp-fb:112 goog-remb\r\na=rtcp-fb:112 transport-cc\r\na=rtcp-fb:112 ccm fir\r\na=rtcp-fb:112 nack\r\na=rtcp-fb:112 nack pli\r\na=fmtp:112 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=64001f\r\na=rtpmap:113 rtx/90000\r\na=fmtp:113 apt=112\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=rtpmap:49 flexfec-03/90000\r\na=rtcp-fb:49 goog-remb\r\na=rtcp-fb:49 transport-cc\r\na=fmtp:49 repair-window=10000000\r\n
[2023-04-24 15:32:35.085][Trace][1][z20u572o] RTC local answer: v=0\r\no=SRS/4.0.268(Leo) 94716411928064 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/livestream.flv\r\nm=audio 9 UDP/TLS/RTP/SAVPF 111\r\nc=IN IP4 0.0.0.0\r\na=ice-ufrag:a150v1l7\r\na=ice-pwd:y2e5q05526zi3166z6139c16d02gm260\r\na=fingerprint:sha-256 07:C7:44:2B:F7:02:0B:DB:85:77:BE:E5:63:0C:BD:25:90:C3:E6:A7:84:72:71:25:70:EA:76:2E:61:E0:E9:62\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:10108 cname:2i9573587196m29a\r\na=ssrc:10108 label:audio-o2518200\r\na=candidate:0 1 udp 2130706431 123.60.142.88 8000 typ host generation 0\r\nm=video 9 UDP/TLS/RTP/SAVPF 106\r\nc=IN IP4 0.0.0.0\r\na=ice-ufrag:a150v1l7\r\na=ice-pwd:y2e5q05526zi3166z6139c16d02gm260\r\na=fingerprint:sha-256 07:C7:44:2B:F7:02:0B:DB:85:77:BE:E5:63:0C:BD:25:90:C3:E6:A7:84:72:71:25:70:EA:76:2E:61:E0:E9:62\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:106 H264/90000\r\na=rtcp-fb:106 transport-cc\r\na=rtcp-fb:106 nack\r\na=rtcp-fb:106 nack pli\r\na=fmtp:106 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f\r\na=ssrc:10109 cname:2i9573587196m29a\r\na=ssrc:10109 label:video-733f5794\r\na=candidate:0 1 udp 2130706431 123.60.142.88 8000 typ host generation 0\r\n
[2023-04-24 15:32:35.148][Trace][1][z20u572o] TCP: before dispose resource(HttpConn)(0x5624e23732d0), conns=3, zombies=0, ign=0, inz=0, ind=0
[2023-04-24 15:32:35.148][Warn][1][z20u572o][104] client disconnect peer. ret=1007
[2023-04-24 15:32:35.148][Trace][1][3n463fuz] TCP: clear zombies=1 resources, conns=3, removing=0, unsubs=0
[2023-04-24 15:32:35.148][Trace][1][z20u572o] TCP: disposing #0 resource(HttpConn)(0x5624e23732d0), conns=3, disposing=1, zombies=0
  1. SRS Config:
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://ossrs.net/lts/zh-cn/docs/v4/doc/webrtc#config-candidate
    candidate 123.60.142.88;
}

vhost __defaultVhost__ {
    rtc {
        enabled     on;
        # @see https://ossrs.net/lts/zh-cn/docs/v4/doc/webrtc#rtmp-to-rtc
        rtmp_to_rtc on;
        # @see https://ossrs.net/lts/zh-cn/docs/v4/doc/webrtc#rtc-to-rtmp
        rtc_to_rtmp on;
    }
    http_remux {
        enabled     on; 
        mount       [vhost]/[app]/[stream].flv; 
    }
}   

Replay

Please describe how to replay the bug?

Step 1: rtmp live streaming

`rtmp live streaming`

Step 2: rtc pull streaming

`rtc pull streaming`

Expect

After reviewing all the issues and making changes to the configuration, the problem regarding UDP port 8080 remains unresolved. [root@hecs-153157 ~]# nc -uv 127.0.0.1 8000Ncat: Version 7.92 ( https://nmap.org/ncat ) Ncat: Connected to 127.0.0.1:8000. ^C [root@hecs-153157 ~]# netstat -lnptu | grep 8000udp6 0 0 :::8000 :::* 1392871/docker-prox [root@hecs-153157 ~]# nc -vuz 123.60.142.88 8000Ncat: Version 7.92 ( https://nmap.org/ncat ) Ncat: Connected to 123.60.142.88:8000. Ncat: UDP packet sent successfully Ncat: 1 bytes sent, 0 bytes received in 2.01 seconds.

TRANS_BY_GPT3

ChvFily commented 1 year ago

I have the same problem. Have you solved it

duantuidp commented 1 year ago

@ChvFily Not yet. I have a headache

duantuidp commented 1 year ago

Solved, the cloud server 8000 UDP is not open.

TRANS_BY_GPT3