Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebRTC: RTMP2RTC, Failed to play the stream. Playing a black screen using public IP+port format. #3304

Open
dengzhengxiong opened this issue Dec 13, 2022 · 2 comments
Assignees
Labels
TransByAI Translated by AI/GPT. WebRTC WebRTC, RTC2RTMP or RTMP2RTC.

Comments

@dengzhengxiong
Copy link

dengzhengxiong commented Dec 13, 2022

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

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

Description (描述)

Please describe your issue here (描述你遇到了什么问题)
Make sure to maintain the markdown structure.

  1. SRS Version (版本): 5.0.93
    Make sure to maintain the markdown structure.

  2. SRS Log (日志):
    Make sure to maintain the markdown structure.

TCP: before dispose resource(HttpConn)(0x600e0001ab20), conns=5, zombies=0, ign=0, inz=0, ind=0
[2022-12-13 17:20:16.360][WARN][33793][71u17251][104] client disconnect peer. ret=1007
[2022-12-13 17:20:16.360][INFO][33793][8r2qqp1x] TCP: clear zombies=1 resources, conns=5, removing=0, unsubs=0
[2022-12-13 17:20:16.360][INFO][33793][71u17251] TCP: disposing #0 resource(HttpConn)(0x600e0001ab20), conns=5, disposing=1, zombies=0
[2022-12-13 17:20:16.372][INFO][33793][18p35871] HTTP #0 171.221.244.36:29263 POST http://222.213.16.51:8052/rtc/v1/play/, content-length=5638
[2022-12-13 17:20:16.372][INFO][33793][18p35871] RTC play webrtc://222.213.16.51:8052/live/09101480EEC5E507700_MJ_ProtocolServer_1, api=http://222.213.16.51:8052/rtc/v1/play/, tid=18c0c71, clientip=171.221.244.36, app=live, stream=09101480EEC5E507700_MJ_ProtocolServer_1, offer=5132B, eip=, codec=, srtp=, dtls=
[2022-12-13 17:20:16.373][INFO][33793][18p35871] ignore attribute=, value=
[2022-12-13 17:20:16.375][INFO][33793][18p35871] new rtc source, stream_url=/live/09101480EEC5E507700_MJ_ProtocolServer_1
[2022-12-13 17:20:16.376][INFO][33793][18p35871] RTC player nack=1, nnc=1
[2022-12-13 17:20:16.376][INFO][33793][18p35871] RTC connection player gcc=3
[2022-12-13 17:20:16.376][INFO][33793][18p35871] RTC: Init tracks {track: video-h2cm3474, is_active: 0=>1},{track: audio-8ngr0007, is_active: 0=>1}, ok
[2022-12-13 17:20:16.376][INFO][33793][18p35871] RTC: Use candidates 222.213.16.51, protocol=udp
[2022-12-13 17:20:16.381][INFO][33793][18p35871] RTC init session, user=84q060d9:TkuX, url=/live/09101480EEC5E507700_MJ_ProtocolServer_1, encrypt=1/1, DTLS(role=passive, version=auto), timeout=30000ms, nack=1
[2022-12-13 17:20:16.382][INFO][33793][18p35871] RTC username=84q060d9:TkuX, dtls=1, srtp=1, offer=5132B, answer=1578B
[2022-12-13 17:20:16.382][INFO][33793][18p35871] RTC remote offer: v=0\r\no=- 3726373703998871828 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:TkuX\r\na=ice-pwd:A6M7of6puGi+PznP3W2FcnNR\r\na=ice-options:trickle\r\na=fingerprint:sha-256 48:7C:9B:1B:4B:19:F4:D7:B3:27:67:9D:54:5D:65:D3:C2:94:F2:11:74:A0:A0:41:02:AF:88:24:B3:EB:A9:78\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 122 102 121 127 120 125 107 108 109 35 36 124 119 123 118 114 115 116 37\r\nc=IN IP4 0.0.0.0\r\na=rtcp:9 IN IP4 0.0.0.0\r\na=ice-ufrag:TkuX\r\na=ice-pwd:A6M7of6puGi+PznP3W2FcnNR\r\na=ice-options:trickle\r\na=fingerprint:sha-256 48:7C:9B:1B:4B:19:F4:D7:B3:27:67:9D:54:5D:65:D3:C2:94:F2:11:74:A0:A0:41:02:AF:88:24:B3:EB:A9:78\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:122 VP9/90000\r\na=rtcp-fb:122 goog-remb\r\na=rtcp-fb:122 transport-cc\r\na=rtcp-fb:122 ccm fir\r\na=rtcp-fb:122 nack\r\na=rtcp-fb:122 nack pli\r\na=fmtp:122 profile-id=1\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 AV1/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=4d001f\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=64001f\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=rtpmap:37 flexfec-03/90000\r\na=rtcp-fb:37 goog-remb\r\na=rtcp-fb:37 transport-cc\r\na=fmtp:37 repair-window=10000000\r\n
2022-12-13 17:20:16.382][INFO][33793][18p35871] RTC local answer: v=0\r\no=SRS/5.0.93(Bee) 105836584274048 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/09101480EEC5E507700_MJ_ProtocolServer_1\r\nm=audio 9 UDP/TLS/RTP/SAVPF 111\r\nc=IN IP4 0.0.0.0\r\na=ice-ufrag:84q060d9\r\na=ice-pwd:198322073s4525f36y7252ar6x5v1i62\r\na=fingerprint:sha-256 B1:88:71:64:18:90:07:07:7E:54:6A:06:34:1B:45:25:4D:73:63:A2:C1:BC:76:8E:3A:4E:D6:07:BB:1E:6E:26\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:341343104 cname:b11sa63rl9407v76\r\na=ssrc:341343104 label:audio-8ngr0007\r\na=candidate:0 1 udp 2130706431 222.213.16.51 8000 typ host generation 0\r\nm=video 9 UDP/TLS/RTP/SAVPF 125\r\nc=IN IP4 0.0.0.0\r\na=ice-ufrag:84q060d9\r\na=ice-pwd:198322073s4525f36y7252ar6x5v1i62\r\na=fingerprint:sha-256 B1:88:71:64:18:90:07:07:7E:54:6A:06:34:1B:45:25:4D:73:63:A2:C1:BC:76:8E:3A:4E:D6:07:BB:1E:6E:26\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: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=ssrc:341343105 cname:b11sa63rl9407v76\r\na=ssrc:341343105 label:video-h2cm3474\r\na=candidate:0 1 udp 2130706431 222.213.16.51 8000 typ host generation 0\r\n
[2022-12-13 17:20:16.411][INFO][33793][18p35871] TCP: before dispose resource(HttpConn)(0x600e0001a6c0), conns=5, zombies=0, ign=0, inz=0, ind=0
[2022-12-13 17:20:16.411][WARN][33793][18p35871][104] client disconnect peer. ret=1007
[2022-12-13 17:20:16.411][INFO][33793][8r2qqp1x] TCP: clear zombies=1 resources, conns=5, removing=0, unsubs=0
[2022-12-13 17:20:16.411][INFO][33793][18p35871] TCP: disposing #0 resource(HttpConn)(0x600e0001a6c0), conns=5, disposing=1, zombies=0
[2022-12-13 17:20:16.416][INFO][33793][18p35871] RTC: session address init 171.221.244.36:52405
[2022-12-13 17:20:16.416][INFO][33793][18p35871] RTC: session STUN done, waiting DTLS handshake.
[2022-12-13 17:20:16.416][INFO][33793][12t7fox1] <- RTC RECV #13, udp 50, pps 4/1, schedule 50
[2022-12-13 17:20:16.430][INFO][33793][18p35871] DTLS: State Passive RECV, done=0, arq=0/0, r0=1, r1=0, len=157, cnt=22, size=144, hs=1
[2022-12-13 17:20:16.432][INFO][33793][18p35871] DTLS: State Passive SEND, done=0, arq=0/0, r0=-1, r1=2, len=680, cnt=22, size=82, hs=2
[2022-12-13 17:20:16.448][INFO][33793][18p35871] DTLS: State Passive RECV, done=0, arq=0/0, r0=1, r1=0, len=571, cnt=22, size=300, hs=11
[2022-12-13 17:20:16.450][INFO][33793][18p35871] DTLS: State Passive SEND, done=1, arq=0/0, r0=1, r1=0, len=546, cnt=22, size=466, hs=4
[2022-12-13 17:20:16.450][INFO][33793][18p35871] RTC: DTLS handshake done.
[2022-12-13 17:20:16.450][INFO][33793][18p35871] RTC: session pub=0, sub=1, to=30000ms connection established
[2022-12-13 17:20:16.450][INFO][33793][18p35871] RTC: Subscriber url=/live/09101480EEC5E507700_MJ_ProtocolServer_1 established
[2022-12-13 17:20:16.450][INFO][33793][18p35871] create consumer, no gop cache
[2022-12-13 17:20:16.450][INFO][33793][18p35871] RTC: start play url=/live/09101480EEC5E507700_MJ_ProtocolServer_1, source_id=/, realtime=1, mw_msgs=0
[2022-12-13 17:20:18.082][INFO][33793][18700m38] <- CPB time=40010377, okbps=0,0,0, ikbps=0,0,0, mr=0/350, p1stpt=20000, pnt=5000
[2022-12-13 17:20:18.647][INFO][33793][22z43ed9] RTMP client ip=192.168.2.51:57544, fd=18, trace=, span=
[2022-12-13 17:20:18.650][INFO][33793][22z43ed9] complex handshake success
[2022-12-13 17:20:18.691][INFO][33793][22z43ed9] connect app, tcUrl=rtmp://192.168.2.51:19351/livemjsdrecord.sctel.com.cn, pageUrl=, swfUrl=, schema=rtmp, vhost=192.168.2.51, port=19351, app=livemjsdrecord.sctel.com.cn, args=null
[2022-12-13 17:20:18.691][INFO][33793][22z43ed9] protocol in.buffer=0, in.ack=0, out.ack=0, in.chunk=128, out.chunk=128
[2022-12-13 17:20:18.773][INFO][33793][22z43ed9] client identified, type=fmle-publish, vhost=192.168.2.51, app=livemjsdrecord.sctel.com.cn, stream=08103021122A65D2500_MJ_ProtocolServer_1, param=, duration=0ms
[2022-12-13 17:20:18.773][INFO][33793][22z43ed9] connected stream, tcUrl=rtmp://192.168.2.51:19351/livemjsdrecord.sctel.com.cn, pageUrl=, swfUrl=, schema=rtmp, vhost=__defaultVhost__, port=19351, app=livemjsdrecord.sctel.com.cn, stream=08103021122A65D2500_MJ_ProtocolServer_1, param=, args=null
[2022-12-13 17:20:18.773][INFO][33793][22z43ed9] new live source, stream_url=/livemjsdrecord.sctel.com.cn/08103021122A65D2500_MJ_ProtocolServer_1
  1. SRS Config (配置):
    Make sure to maintain the markdown structure.
listen              19351;
max_connections     1000;
daemon              off;
#srs_log_tank        console;
srs_log_tank        file;
srs_log_file        ./log/srs.log;

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

http_api {
    enabled         on;
    #listen          1985;
    listen	    8052;
}
stats {
    network         0;
}
rtc_server {
    enabled on;
    # Listen at udp://8000
    listen 8000;
    #
    # The $CANDIDATE means fetch from env, if not configed, use * as default.
    #
    # The * means retrieving server IP automatically, from all network interfaces,
    # @see https://github.com/ossrs/srs/wiki/v4_CN_RTCWiki#config-candidate
    candidate *;
    use_auto_detect_network_ip on;
    ip_family ipv4;
}

vhost __defaultVhost__ {
    rtc {
        enabled     on;
	rtmp_to_rtc on;
	rtc_to_rtmp on;
    }
    http_remux {
        enabled     on;
        mount       [vhost]/[app]/[stream].flv;
    }


}

Replay (重现)
Make sure to maintain the markdown structure.

Please describe how to replay the bug? (重现Bug的步骤)
Make sure to maintain the markdown structure.

  1. When pushing an rtmp stream to SRS in the test environment, playing it through the format webrtc://public IP+port+xxxxxxx, the SRS built-in webrtc player shows a 200OK response in the network request results, but the screen remains black with a spinning loading icon. Checking the logs, the source_id is found to be "/", with a value of "/". However, when playing the stream using the public IP+port format in the development environment, it displays the video correctly, and the source_id is "86945vs9/5vdfkwp8". I wonder if there is any reason for this difference.

  2. In the development environment, the stream plays normally, but in the test environment, it remains black with a loading icon. Can anyone provide guidance or insights on this issue?

  3. xxxxxx

Expect (Expected Behavior)

Please describe your expectation
I hope to be able to play by using the public IP address and port, and be able to display images normally.

TRANS_BY_GPT3

@dengzhengxiong dengzhengxiong changed the title WebRTC使用公网IP+端口形式播放一直处于黑屏转圈 大神快来救救我!!WebRTC使用公网IP+端口形式播放一直处于黑屏转圈 Dec 13, 2022
@winlinvip
Copy link
Member

winlinvip commented Dec 25, 2022

The version is too old. Try updating to a new version?

TRANS_BY_GPT3

@winlinvip winlinvip self-assigned this Dec 25, 2022
@winlinvip winlinvip added the WebRTC WebRTC, RTC2RTMP or RTMP2RTC. label Dec 25, 2022
@winlinvip winlinvip changed the title 大神快来救救我!!WebRTC使用公网IP+端口形式播放一直处于黑屏转圈 WebRTC: RTMP2RTC, 使用公网IP+端口形式播放一直处于黑屏转圈 Dec 25, 2022
@winlinvip winlinvip changed the title WebRTC: RTMP2RTC, 使用公网IP+端口形式播放一直处于黑屏转圈 WebRTC: RTMP2RTC, Failed to play the stream. 播放黑屏 Dec 25, 2022
@winlinvip winlinvip changed the title WebRTC: RTMP2RTC, Failed to play the stream. 播放黑屏 WebRTC: RTMP2RTC, Failed to play the stream. 使用公网IP+端口形式播放黑屏 Dec 25, 2022
@rl099
Copy link

rl099 commented Mar 2, 2023

The version is too old. Try updating to the new version?

This issue can be closed. Looking at the logs, RTC: start play url=/live/09101480EEC5E507700_MJ_ProtocolServer_1, the URL here is different from the source URL, new live source, stream_url=/livemjsdrecord.sctel.com.cn/08103021122A65D2500_MJ_ProtocolServer_1.

TRANS_BY_GPT3

@winlinvip winlinvip changed the title WebRTC: RTMP2RTC, Failed to play the stream. 使用公网IP+端口形式播放黑屏 WebRTC: RTMP2RTC, Failed to play the stream. Playing a black screen using public IP+port format. Jul 29, 2023
@winlinvip winlinvip added the TransByAI Translated by AI/GPT. label Jul 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
TransByAI Translated by AI/GPT. WebRTC WebRTC, RTC2RTMP or RTMP2RTC.
Projects
None yet
Development

No branches or pull requests

3 participants