AlexxIT / go2rtc

Ultimate camera streaming application with support RTSP, RTMP, HTTP-FLV, WebRTC, MSE, HLS, MP4, MJPEG, HomeKit, FFmpeg, etc.
https://github.com/AlexxIT/Blog
MIT License
3.77k stars 307 forks source link

webrtc black screen #1240

Open M00nBack opened 3 days ago

M00nBack commented 3 days ago

The video progress bar is moving, but a black screen is displayed

image

AlexxIT commented 2 days ago

Your browser doesn't support any video codec. I don't know how this can be. Usually at least h264 should be supported. But I can't see it in your logs.

M00nBack commented 2 days ago

I tested the re -installation of Chrome and we had failed to play WebRTC on other people's computer. It is possible to play stream.mp4. Below is the configuration I used and the log played by WebRTC. go2rtc.yaml

streams:
  xxx: rtsp://admin:123456@1.1.1.1:554/?chID=2&streamType=main&linkType=tcp
log:
  level: trace
log ``` 09:12:36.527 TRC [api] GET /stream.html?src=xxx&mode=webrtc 192.168.1.153:56551 09:12:36.574 TRC [api] GET /video-stream.js 192.168.1.153:56551 09:12:36.580 TRC [api] GET /video-rtc.js 192.168.1.153:56551 09:12:36.587 TRC [api] GET /api/ws?src=xxx 192.168.1.153:56554 09:12:36.610 TRC [api] ws msg type=webrtc/offer 09:12:36.611 DBG [webrtc] new consumer src=xxx 09:12:36.613 09:12:36.612TRC [api] ws msg TRCtype=webrtc/candidate [webrtc] offer: v=0 o=- 6090278461522766313 2 IN IP4 127.0.0.1 s=- t=0 0 a=group:BUNDLE 0 1 a=extmap-allow-mixed a=msid-semantic: WMS m=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 117 118 49 c=IN IP4 0.0.0.0 a=rtcp:9 IN IP4 0.0.0.0 a=ice-ufrag:UZ6h a=ice-pwd:z4y2B8eysiqgugN7xUcjcJbz a=ice-options:trickle a=fingerprint:sha-256 D4:1E:52:A1:F0:6C:FC:1B:D2:CB:08:21:87:15:DC:03:39:76:7A:A1:56:08:DF:CB:C6:17:EB:30:F6:98:8F:08 a=setup:actpass a=mid:0 a=extmap:1 urn:ietf:params:rtp-hdrext:toffset a=extmap:2 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time a=extmap:3 urn:3gpp:video-orientation a=extmap:4 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01 a=extmap:5 http://www.webrtc.org/experiments/rtp-hdrext/playout-delay a=extmap:6 http://www.webrtc.org/experiments/rtp-hdrext/video-content-type a=extmap:7 http://www.webrtc.org/experiments/rtp-hdrext/video-timing a=extmap:8 http://www.webrtc.org/experiments/rtp-hdrext/color-space a=extmap:9 urn:ietf:params:rtp-hdrext:sdes:mid a=extmap:10 urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id a=extmap:11 urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id a=recvonly a=rtcp-mux a=rtcp-rsize a=rtpmap:96 VP8/90000 a=rtcp-fb:96 goog-remb a=rtcp-fb:96 transport-cc a=rtcp-fb:96 ccm fir a=rtcp-fb:96 nack a=rtcp-fb:96 nack pli a=rtpmap:97 rtx/90000 a=fmtp:97 apt=96 a=rtpmap:98 VP9/90000 a=rtcp-fb:98 goog-remb a=rtcp-fb:98 transport-cc a=rtcp-fb:98 ccm fir a=rtcp-fb:98 nack a=rtcp-fb:98 nack pli a=fmtp:98 profile-id=0 a=rtpmap:99 rtx/90000 a=fmtp:99 apt=98 a=rtpmap:100 VP9/90000 a=rtcp-fb:100 goog-remb a=rtcp-fb:100 transport-cc a=rtcp-fb:100 ccm fir a=rtcp-fb:100 nack a=rtcp-fb:100 nack pli a=fmtp:100 profile-id=2 a=rtpmap:101 rtx/90000 a=fmtp:101 apt=100 a=rtpmap:35 VP9/90000 a=rtcp-fb:35 goog-remb a=rtcp-fb:35 transport-cc a=rtcp-fb:35 ccm fir a=rtcp-fb:35 nack a=rtcp-fb:35 nack pli a=fmtp:35 profile-id=1 a=rtpmap:36 rtx/90000 a=fmtp:36 apt=35 a=rtpmap:37 VP9/90000 a=rtcp-fb:37 goog-remb a=rtcp-fb:37 transport-cc a=rtcp-fb:37 ccm fir a=rtcp-fb:37 nack a=rtcp-fb:37 nack pli a=fmtp:37 profile-id=3 a=rtpmap:38 rtx/90000 a=fmtp:38 apt=37 a=rtpmap:102 H264/90000 a=rtcp-fb:102 goog-remb a=rtcp-fb:102 transport-cc a=rtcp-fb:102 ccm fir a=rtcp-fb:102 nack a=rtcp-fb:102 nack pli a=fmtp:102 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42001f a=rtpmap:103 rtx/90000 a=fmtp:103 apt=102 a=rtpmap:104 H264/90000 a=rtcp-fb:104 goog-remb a=rtcp-fb:104 transport-cc a=rtcp-fb:104 ccm fir a=rtcp-fb:104 nack a=rtcp-fb:104 nack pli a=fmtp:104 level-asymmetry-allowed=1;packetization-mode=0;profile-level-id=42001f a=rtpmap:105 rtx/90000 a=fmtp:105 apt=104 a=rtpmap:106 H264/90000 a=rtcp-fb:106 goog-remb a=rtcp-fb:106 transport-cc a=rtcp-fb:106 ccm fir a=rtcp-fb:106 nack a=rtcp-fb:106 nack pli a=fmtp:106 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f a=rtpmap:107 rtx/90000 a=fmtp:107 apt=106 a=rtpmap:108 H264/90000 a=rtcp-fb:108 goog-remb a=rtcp-fb:108 transport-cc a=rtcp-fb:108 ccm fir a=rtcp-fb:108 nack a=rtcp-fb:108 nack pli a=fmtp:108 level-asymmetry-allowed=1;packetization-mode=0;profile-level-id=42e01f a=rtpmap:109 rtx/90000 a=fmtp:109 apt=108 a=rtpmap:127 H264/90000 a=rtcp-fb:127 goog-remb a=rtcp-fb:127 transport-cc a=rtcp-fb:127 ccm fir a=rtcp-fb:127 nack a=rtcp-fb:127 nack pli a=fmtp:127 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=4d001f a=rtpmap:125 rtx/90000 a=fmtp:125 apt=127 a=rtpmap:39 H264/90000 a=rtcp-fb:39 goog-remb a=rtcp-fb:39 transport-cc a=rtcp-fb:39 ccm fir a=rtcp-fb:39 nack a=rtcp-fb:39 nack pli a=fmtp:39 level-asymmetry-allowed=1;packetization-mode=0;profile-level-id=4d001f a=rtpmap:40 rtx/90000 a=fmtp:40 apt=39 a=rtpmap:41 H264/90000 a=rtcp-fb:41 goog-remb a=rtcp-fb:41 transport-cc a=rtcp-fb:41 ccm fir a=rtcp-fb:41 nack a=rtcp-fb:41 nack pli a=fmtp:41 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=f4001f a=rtpmap:42 rtx/90000 a=fmtp:42 apt=41 a=rtpmap:43 H264/90000 a=rtcp-fb:43 goog-remb a=rtcp-fb:43 transport-cc a=rtcp-fb:43 ccm fir a=rtcp-fb:43 nack a=rtcp-fb:43 nack pli a=fmtp:43 level-asymmetry-allowed=1;packetization-mode=0;profile-level-id=f4001f a=rtpmap:44 rtx/90000 a=fmtp:44 apt=43 a=rtpmap:45 AV1/90000 a=rtcp-fb:45 goog-remb a=rtcp-fb:45 transport-cc a=rtcp-fb:45 ccm fir a=rtcp-fb:45 nack a=rtcp-fb:45 nack pli a=fmtp:45 level-idx=5;profile=0;tier=0 a=rtpmap:46 rtx/90000 a=fmtp:46 apt=45 a=rtpmap:47 AV1/90000 a=rtcp-fb:47 goog-remb a=rtcp-fb:47 transport-cc a=rtcp-fb:47 ccm fir a=rtcp-fb:47 nack a=rtcp-fb:47 nack pli a=fmtp:47 level-idx=5;profile=1;tier=0 a=rtpmap:48 rtx/90000 a=fmtp:48 apt=47 a=rtpmap:112 H264/90000 a=rtcp-fb:112 goog-remb a=rtcp-fb:112 transport-cc a=rtcp-fb:112 ccm fir a=rtcp-fb:112 nack a=rtcp-fb:112 nack pli a=fmtp:112 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=64001f a=rtpmap:113 rtx/90000 a=fmtp:113 apt=112 a=rtpmap:114 H264/90000 a=rtcp-fb:114 goog-remb a=rtcp-fb:114 transport-cc a=rtcp-fb:114 ccm fir a=rtcp-fb:114 nack a=rtcp-fb:114 nack pli a=fmtp:114 level-asymmetry-allowed=1;packetization-mode=0;profile-level-id=64001f a=rtpmap:115 rtx/90000 a=fmtp:115 apt=114 a=rtpmap:116 red/90000 a=rtpmap:117 rtx/90000 a=fmtp:117 apt=116 a=rtpmap:118 ulpfec/90000 a=rtpmap:49 flexfec-03/90000 a=rtcp-fb:49 goog-remb a=rtcp-fb:49 transport-cc a=fmtp:49 repair-window=10000000 m=audio 9 UDP/TLS/RTP/SAVPF 111 63 9 0 8 13 110 126 c=IN IP4 0.0.0.0 a=rtcp:9 IN IP4 0.0.0.0 a=ice-ufrag:UZ6h a=ice-pwd:z4y2B8eysiqgugN7xUcjcJbz a=ice-options:trickle a=fingerprint:sha-256 D4:1E:52:A1:F0:6C:FC:1B:D2:CB:08:21:87:15:DC:03:39:76:7A:A1:56:08:DF:CB:C6:17:EB:30:F6:98:8F:08 a=setup:actpass a=mid:1 a=extmap:14 urn:ietf:params:rtp-hdrext:ssrc-audio-level a=extmap:2 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time a=extmap:4 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01 a=extmap:9 urn:ietf:params:rtp-hdrext:sdes:mid a=recvonly a=rtcp-mux a=rtpmap:111 opus/48000/2 a=rtcp-fb:111 transport-cc a=fmtp:111 minptime=10;useinbandfec=1 a=rtpmap:63 red/48000/2 a=fmtp:63 111/111 a=rtpmap:9 G722/8000 a=rtpmap:0 PCMU/8000 a=rtpmap:8 PCMA/8000 a=rtpmap:13 CN/8000 a=rtpmap:110 telephone-event/48000 a=rtpmap:126 telephone-event/8000 09:12:36.61509:12:36.616 TRCTRC [webrtc] remote [streams] check cons=0 media=video, sendonly, VP8, VP9, H264, AV1 candidate="candidate:2793811124 1 udp 2113937151 9d62fb02-70b9-478d-a86f-dcd4e45bef0a.local 50856 typ host generation 0 ufrag UZ6h network-cost 999" 09:12:36.617 TRC [rtsp] client request: DESCRIBE rtsp://1.1.1.1:554/?chID=2&streamType=main&linkType=tcp RTSP/1.0 Require: www.onvif.org/ver20/backchannel User-Agent: go2rtc/1.9.4 CSeq: 1 Accept: application/sdp 09:12:36.696 TRC [api] ws msg type=webrtc/candidate 09:12:36.698 TRC [webrtc] remote candidate="candidate:4066015660 1 udp 1677729535 171.15.167.32 11838 typ srflx raddr 0.0.0.0 rport 0 generation 0 ufrag UZ6h network-cost 999" 09:12:36.741 TRC [api] ws msg type=webrtc/candidate 09:12:36.742 TRC [webrtc] remote candidate= 09:12:37.382 TRC [rtsp] client response: RTSP/1.0 401 Unauthorized Cseq: 1 Date: Wed, Jul 03 2024 02:34:35 GMT Expires: Wed, Jul 03 2024 02:34:35 GMT Www-Authenticate: Digest realm="RTSP SERVER", nonce="28b1828d6cabd3ab8a38934e9b02e844" 09:12:37.384 TRC [rtsp] client request: DESCRIBE rtsp://1.1.1.1:554/?chID=2&streamType=main&linkType=tcp RTSP/1.0 Accept: application/sdp Require: www.onvif.org/ver20/backchannel User-Agent: go2rtc/1.9.4 CSeq: 2 Authorization: Digest username="admin", realm="RTSP SERVER", nonce="28b1828d6cabd3ab8a38934e9b02e844", uri="rtsp://1.1.1.1:554/?chID=2&streamType=main&linkType=tcp", response="8ba198ea6fa4adae59c2d39cb686299e" 09:12:38.283 TRC [rtsp] client response: RTSP/1.0 200 OK Content-Base: rtsp://1.1.1.1:554/?chID=2&streamType=main&linkType=tcp/ Cseq: 2 Expires: Wed, Jul 03 2024 02:34:36 GMT Cache-Control: must-revalidate Date: Wed, Jul 03 2024 02:34:36 GMT Content-Type: application/sdp X-Accept-Retransmit: our-retransmit X-Accept-Dynamic-Rate: 1 Content-Length: 353 Server: Apache Last-Modified: Mon Nov 5 17:07:39 2018 GMT v=0 o=- 2928433722 1 IN IP4 0.0.0.0 s=RTSP SESSION u=http:/// e=admin@ t=0 0 a=control:* a=range:npt=00.000- m=video 0 RTP/AVP 98 a=control:trackID=0 a=rtpmap:98 H265/90000 a=fmtp:62 profile-level-id=42e032; sprop-parameter-sets=RAHA8vA8kA==; packetization-mode=1 m=audio 0 RTP/AVP 8 a=control:trackID=1 a=rtpmap:8 PCMA/8000 a=ptime:40 09:12:38.286 TRC [streams] check cons=0 prod=0 media=video, recvonly, H265 09:12:38.286 TRC [streams] check cons=0 prod=0 media=audio, recvonly, PCMA/8000 09:12:38.286 TRC [streams] check cons=0 media=audio, sendonly, OPUS/48000/2, G722/8000, PCMU/8000, PCMA/8000, L16, PCML 09:12:38.287 TRC [streams] check cons=0 prod=0 media=video, recvonly, H265 09:12:38.287 TRC [streams] check cons=0 prod=0 media=audio, recvonly, PCMA/8000 09:12:38.287 TRC [streams] match cons=0 <= prod=0 09:12:38.288 TRC [rtsp] client request: SETUP rtsp://1.1.1.1:554/?chID=2&streamType=main&linkType=tcp/trackID=1 RTSP/1.0 Transport: RTP/AVP/TCP;unicast;interleaved=2-3 CSeq: 3 Authorization: Digest username="admin", realm="RTSP SERVER", nonce="28b1828d6cabd3ab8a38934e9b02e844", uri="rtsp://1.1.1.1:554/?chID=2&streamType=main&linkType=tcp/trackID=1", response="1e02501af5118d67fffecb60688ddde2" 09:12:38.386 TRC [rtsp] client response: RTSP/1.0 200 OK Last-Modified: Mon Nov 5 17:07:39 2018 GMT Cache-Control: must-revalidate Date: Wed, Jul 03 2024 02:34:36 GMT Expires: Wed, Jul 03 2024 02:34:36 GMT Transport: RTP/AVP/TCP;unicast;destination=114.37.204.147;source=1.1.1.1;interleaved=2-3;ssrc=2717f52a Session: 444444444433333;timeout=60 Server: Apache Cseq: 3 09:12:38.389 DBG [streams] start producer url=rtsp://admin:123456@1.1.1.1:554/?chID=2&streamType=main&linkType=tcp 09:12:38.389 TRC [rtsp] client request: PLAY rtsp://1.1.1.1:554/?chID=2&streamType=main&linkType=tcp/ RTSP/1.0 CSeq: 4 Authorization: Digest username="admin", realm="RTSP SERVER", nonce="28b1828d6cabd3ab8a38934e9b02e844", uri="rtsp://1.1.1.1:554/?chID=2&streamType=main&linkType=tcp/", response="d980e060819bd01c10044a8b264ec4fc" Session: 444444444433333 09:12:38.418 TRC [webrtc] answer v=0 o=- 5690190432779629650 1719969158 IN IP4 0.0.0.0 s=- t=0 0 a=msid-semantic:WMS* a=fingerprint:sha-256 27:E6:F3:AE:B0:DF:AF:AF:2F:3B:F0:9A:54:16:E6:E8:32:CF:67:CB:96:C6:40:BB:09:46:FC:B4:6D:55:5B:B7 a=extmap-allow-mixed a=group:BUNDLE 0 1 m=video 9 UDP/TLS/RTP/SAVPF 102 106 112 c=IN IP4 0.0.0.0 a=setup:active a=mid:0 a=ice-ufrag:VLPyRYmJZfojeSqq a=ice-pwd:nDKSYcsAXkGPvxkOBdJCXhdtaRqhdwnc a=rtcp-mux a=rtcp-rsize a=rtpmap:102 H264/90000 a=fmtp:102 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42001f a=rtcp-fb:102 goog-remb a=rtcp-fb:102 transport-cc a=rtcp-fb:102 ccm fir a=rtcp-fb:102 nack a=rtcp-fb:102 nack pli a=rtpmap:106 H264/90000 a=fmtp:106 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f a=rtcp-fb:106 goog-remb a=rtcp-fb:106 transport-cc a=rtcp-fb:106 ccm fir a=rtcp-fb:106 nack a=rtcp-fb:106 nack pli a=rtpmap:112 H264/90000 a=fmtp:112 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=64001f a=rtcp-fb:112 goog-remb a=rtcp-fb:112 transport-cc a=rtcp-fb:112 ccm fir a=rtcp-fb:112 nack a=rtcp-fb:112 nack pli a=extmap:4 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01 a=ssrc:775484694 cname:go2rtc a=ssrc:775484694 msid:go2rtc go2rtc-video a=ssrc:775484694 mslabel:go2rtc a=ssrc:775484694 label:go2rtc-video a=msid:go2rtc go2rtc-video a=inactive m=audio 9 UDP/TLS/RTP/SAVPF 111 0 8 c=IN IP4 0.0.0.0 a=setup:active a=mid:1 a=ice-ufrag:VLPyRYmJZfojeSqq a=ice-pwd:nDKSYcsAXkGPvxkOBdJCXhdtaRqhdwnc a=rtcp-mux a=rtcp-rsize a=rtpmap:111 opus/48000/2 a=fmtp:111 minptime=10;useinbandfec=1 a=rtcp-fb:111 transport-cc a=rtpmap:0 PCMU/8000 a=rtpmap:8 PCMA/8000 a=extmap:4 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01 a=ssrc:3538761616 cname:go2rtc a=ssrc:3538761616 msid:go2rtc go2rtc-audio a=ssrc:3538761616 mslabel:go2rtc a=ssrc:3538761616 label:go2rtc-audio a=msid:go2rtc go2rtc-audio a=sendonly 09:12:38.419 TRC [webrtc] local candidate="candidate:1893179401 1 udp 2130706431 192.192.168.244 50278 typ host" 09:12:38.420 TRC [webrtc] local candidate="candidate:3441742313 1 tcp 1671430143 192.192.168.244 8555 typ host tcptype passive" 09:12:38.420 TRC [webrtc] local candidate="candidate:1725639149 1 udp 2130706431 192.168.1.173 50279 typ host" 09:12:38.421 TRC [webrtc] local candidate="candidate:3676854285 1 tcp 1671430143 192.168.1.173 8555 typ host tcptype passive" 09:12:38.422 TRC [webrtc] local candidate="candidate:151923833 1 udp 2130706431 192.168.174.1 50280 typ host" 09:12:38.428 TRC [webrtc] local candidate="candidate:3036503449 1 tcp 1671430143 192.168.174.1 8555 typ host tcptype passive" 09:12:38.429 TRC [webrtc] local candidate="candidate:721177284 1 udp 2130706431 192.168.159.1 56203 typ host" 09:12:38.430 TRC [webrtc] local candidate="candidate:2534357796 1 tcp 1671430143 192.168.159.1 8555 typ host tcptype passive" 09:12:38.490 TRC [rtsp] client response: RTSP/1.0 200 OK Server: Apache Cseq: 4 Session: 444444444433333 Range: npt=0.000- Rtp-Info: url=rtsp://1.1.1.1:554/?chID=2&streamType=main&linkType=tcp/trackID=1;seq=62762;rtptime=655881514 09:12:38.501 TRC [webrtc] local candidate="candidate:2241295065 1 udp 1694498815 171.15.167.32 11822 typ srflx raddr 0.0.0.0 rport 56204" ```
AlexxIT commented 2 days ago

https://github.com/AlexxIT/go2rtc#codecs-madness

M00nBack commented 2 days ago

Does it mean that any H265 video cannot be played by default in Chrome? How can I tell whether the webrtc video is in H265 or H264 format? If it is in H265 format, is there any way to play it through webrtc?