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.45k stars 5.35k forks source link

WebRTC: High latency FLV from RTC. FLV to RTC has significant delay. #3102

Open stolbivi opened 2 years ago

stolbivi 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 (描述)

I'm streaming RTC to HTTP-FLV and it is working with about 3-5 seconds delay which is quite OK when RTC stream is coming from web camera. However, when I switch RTC stream to be screen capture the SRS player shows it with delay about 20 seconds on average which is very strange. It also shows spinner quite regularly like it reaches end of FLV and is awaiting more data.

  1. SRS Version (版本): ossrs/srs:4 Docker

  2. SRS Log (日志):

docker-srs-1 | [2022-07-07 21:06:58.640][Trace][1][82y51610] srs checking config...
docker-srs-1 | [2022-07-07 21:06:58.640][Trace][1][82y51610] ips, iface[0] eth0 ipv4 0x11043 172.24.0.2
docker-srs-1 | [2022-07-07 21:06:58.640][Trace][1][82y51610] devices, intranet eth0 172.24.0.2
docker-srs-1 | [2022-07-07 21:06:58.640][Warn][1][82y51610][2] stats network use index=0, ip=172.24.0.2, ifname=eth0
docker-srs-1 | [2022-07-07 21:06:58.640][Warn][1][82y51610][2] stats disk not configed, disk iops disabled.
docker-srs-1 | [2022-07-07 21:06:58.640][Trace][1][82y51610] write log to console
docker-srs-1 | [2022-07-07 21:06:58.640][Trace][1][82y51610] 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
docker-srs-1 | [2022-07-07 21:06:58.640][Trace][1][82y51610] SRS on  amd64 x86_64, conf:rt-hls.conf, limit:1000, writev:1024, encoding:little-endian, HZ:100
docker-srs-1 | [2022-07-07 21:06:58.640][Trace][1][82y51610] mw sleep:350ms. mr enabled:on, default:0, sleep:350ms
docker-srs-1 | [2022-07-07 21:06:58.640][Trace][1][82y51610] gc:on, pq:30000ms, cscc:[0,16), csa:on, tn:on(may hurts performance), ss:auto(guess by merged write)
docker-srs-1 | [2022-07-07 21:06:58.640][Trace][1][82y51610] system default latency(ms): mw(0-350) + mr(0-350) + play-queue(0-30000)
docker-srs-1 | [2022-07-07 21:06:58.643][Trace][1][82y51610] fingerprint=5D:45:EA:94:38:82:87:71:9C:6A:47:41:93:5E:9A:1B:17:A7:4B:5F:C3:CE:22:03:51:80:5F:A9:68:C5:D9:F6
docker-srs-1 | [2022-07-07 21:06:58.643][Trace][1][82y51610] CircuitBreaker: enabled=1, high=2x90, critical=1x95, dying=5x99
docker-srs-1 | [2022-07-07 21:06:58.643][Trace][1][82y51610] http flv live stream, vhost=__defaultVhost__, mount=[vhost]/[app]/[stream].flv
docker-srs-1 | [2022-07-07 21:06:58.643][Trace][1][82y51610] http: root mount to ./objs/nginx/html
docker-srs-1 | [2022-07-07 21:06:58.643][Trace][1][82y51610] server main cid=82y51610, pid=1, ppid=0, asprocess=0
docker-srs-1 | [2022-07-07 21:06:58.644][Trace][1][82y51610] write pid=1 to ./objs/srs.pid success!
docker-srs-1 | [2022-07-07 21:06:58.644][Trace][1][82y51610] RTMP listen at tcp://[0.0.0.0:1935](http://0.0.0.0:1935/), fd=7
docker-srs-1 | [2022-07-07 21:06:58.644][Trace][1][82y51610] HTTP-API listen at tcp://[0.0.0.0:1985](http://0.0.0.0:1985/), fd=8
docker-srs-1 | [2022-07-07 21:06:58.644][Trace][1][82y51610] HTTP-Server listen at tcp://[0.0.0.0:8080](http://0.0.0.0:8080/), fd=9
docker-srs-1 | [2022-07-07 21:06:58.644][Trace][1][82y51610] signal installed, reload=1, reopen=10, fast_quit=15, grace_quit=3
docker-srs-1 | [2022-07-07 21:06:58.644][Trace][1][82y51610] http: api mount /console to ./objs/nginx/html/console
docker-srs-1 | [2022-07-07 21:06:58.645][Trace][1][82y51610] rtc listen at udp://[0.0.0.0:8000](http://0.0.0.0:8000/), fd=10
docker-srs-1 | [2022-07-07 21:06:58.645][Trace][1][5dhn1a28] Hybrid cpu=0.00%,14MB
docker-srs-1 | [2022-07-07 21:06:58.645][Warn][1][g46j6526][22] use private address as ip: 172.24.0.2, ifname=eth0
docker-srs-1 | [2022-07-07 21:06:58.645][Trace][1][g46j6526] Startup query id=bd22de76fe3811ecb9fb23e6118c117d, eip=172.24.0.2, wait=427s
docker-srs-1 | [2022-07-07 21:06:58.645][Trace][1][6mmml277] TCP: connection manager run, conns=0
docker-srs-1 | [2022-07-07 21:06:58.645][Trace][1][v51641v7] UDP #10 LISTEN at [0.0.0.0:8000](http://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)
docker-srs-1 | [2022-07-07 21:06:58.645][Trace][1][870f8967] RTC: connection manager run, conns=0
docker-srs-1 | [2022-07-07 21:07:03.640][Trace][1][5dhn1a28] Hybrid cpu=1.00%,14MB
docker-srs-1 | [2022-07-07 21:07:08.643][Trace][1][5dhn1a28] Hybrid cpu=0.00%,14MB
docker-srs-1 | [2022-07-07 21:07:08.828][Trace][1][s6m485x5] HTTP #0 [172.24.0.1:60160](http://172.24.0.1:60160/) OPTIONS http://192.168.4.73:1985/rtc/v1/publish/, content-length=-1
docker-srs-1 | [2022-07-07 21:07:08.834][Trace][1][s6m485x5] HTTP #1 [172.24.0.1:60160](http://172.24.0.1:60160/) POST http://192.168.4.73:1985/rtc/v1/publish/, content-length=4696
docker-srs-1 | [2022-07-07 21:07:08.834][Trace][1][s6m485x5] RTC publish webrtc://[192.168.4.73/live/teststream](http://192.168.4.73/live/teststream), api=http://192.168.4.73:1985/rtc/v1/publish/, tid=, clientip=172.24.0.1, app=live, stream=teststream, offer=4311B, eip=, codec=
docker-srs-1 | [2022-07-07 21:07:08.834][Trace][1][s6m485x5] ignore attribute=, value=
docker-srs-1 | [2022-07-07 21:07:08.835][Trace][1][s6m485x5] new source, stream_url=/live/teststream
docker-srs-1 | [2022-07-07 21:07:08.835][Trace][1][s6m485x5] RTC publisher nack=1, nnc=1, pt-drop=0, twcc=1/4
docker-srs-1 | [2022-07-07 21:07:08.835][Trace][1][s6m485x5] new source, stream_url=/live/teststream
docker-srs-1 | [2022-07-07 21:07:08.836][Trace][1][s6m485x5] RTC: Init tracks {track: c8a4d592-3bf8-4015-ace6-263107b0c88a, is_active: 0=>1}, ok
docker-srs-1 | [2022-07-07 21:07:08.836][Trace][1][s6m485x5] RTC: Use candidates "192.168.4.73", 192.168.4.73
docker-srs-1 | [2022-07-07 21:07:08.837][Trace][1][s6m485x5] RTC init session, user=fz27z7c5:Es3b, url=/live/teststream, encrypt=1/1, DTLS(role=passive, version=auto), timeout=30000ms, nack=1
docker-srs-1 | [2022-07-07 21:07:08.837][Trace][1][s6m485x5] RTC username=fz27z7c5:Es3b, offer=4311B, answer=945B
docker-srs-1 | [2022-07-07 21:07:08.837][Trace][1][s6m485x5] RTC remote offer: v=0\r\no=- 5194638123113882915 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 127 121 125 107 108 109 124 120 123 119 35 36 41 42 114 115 116 117 118\r\nc=IN IP4 0.0.0.0\r\na=rtcp:9 IN IP4 0.0.0.0\r\na=ice-ufrag:Es3b\r\na=ice-pwd:w1gG3GXWDet5N/Xow0YS5PkL\r\na=ice-options:trickle\r\na=fingerprint:sha-256 62:79:44:DD:5B:BA:32:3E:16:ED:30:80:F1:F8:BB:0C:35:F6:16:A2:24:5C:29:E5:AE:5E:6E:CA:38:37:73:26\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](http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time%5Cr%5Cna=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.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01%5Cr%5Cna=extmap:5) [http://www.webrtc.org/experiments/rtp-hdrext/playout-delay\r\na=extmap:6](http://www.webrtc.org/experiments/rtp-hdrext/playout-delay%5Cr%5Cna=extmap:6) [http://www.webrtc.org/experiments/rtp-hdrext/video-content-type\r\na=extmap:7](http://www.webrtc.org/experiments/rtp-hdrext/video-content-type%5Cr%5Cna=extmap:7) [http://www.webrtc.org/experiments/rtp-hdrext/video-timing\r\na=extmap:8](http://www.webrtc.org/experiments/rtp-hdrext/video-timing%5Cr%5Cna=extmap:8) [http://www.webrtc.org/experiments/rtp-hdrext/color-space\r\na=extmap:9](http://www.webrtc.org/experiments/rtp-hdrext/color-space%5Cr%5Cna=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=sendonly\r\na=msid:- c8a4d592-3bf8-4015-ace6-263107b0c88a\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: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: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=ssrc-group:FID 3716716469 3811973544\r\na=ssrc:3716716469 cname:Tu4PHO0xq54ZjWwe\r\na=ssrc:3716716469 msid:- c8a4d592-3bf8-4015-ace6-263107b0c88a\r\na=ssrc:3811973544 cname:Tu4PHO0xq54ZjWwe\r\na=ssrc:3811973544 msid:- c8a4d592-3bf8-4015-ace6-263107b0c88a\r\n
docker-srs-1 | [2022-07-07 21:07:08.837][Trace][1][s6m485x5] RTC local answer: v=0\r\no=SRS/4.0.253(Leo) 93972879465760 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 live/teststream\r\nm=video 9 UDP/TLS/RTP/SAVPF 108 116\r\nc=IN IP4 0.0.0.0\r\na=ice-ufrag:fz27z7c5\r\na=ice-pwd:fb512kp46b841lqx879578o97l44544k\r\na=fingerprint:sha-256 5D:45:EA:94:38:82:87:71:9C:6A:47:41:93:5E:9A:1B:17:A7:4B:5F:C3:CE:22:03:51:80:5F:A9:68:C5:D9:F6\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:108](http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01%5Cr%5Cna=recvonly%5Cr%5Cna=rtcp-mux%5Cr%5Cna=rtcp-rsize%5Cr%5Cna=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=rtpmap:116 red/90000\r\na=candidate:0 1 udp 2130706431 "192.168.4.73" 8000 typ host generation 0\r\na=candidate:1 1 udp 2130706431 192.168.4.73 8000 typ host generation 0\r\n
docker-srs-1 | [2022-07-07 21:07:08.842][Trace][1][s6m485x5] TCP: before dispose resource(HttpConn)(0x5577c402f900), conns=1, zombies=0, ign=0, inz=0, ind=0
docker-srs-1 | [2022-07-07 21:07:08.842][Warn][1][s6m485x5][104] client disconnect peer. ret=1007
docker-srs-1 | [2022-07-07 21:07:08.842][Trace][1][6mmml277] TCP: clear zombies=1 resources, conns=1, removing=0, unsubs=0
docker-srs-1 | [2022-07-07 21:07:08.842][Trace][1][s6m485x5] TCP: disposing #0 resource(HttpConn)(0x5577c402f900), conns=1, disposing=1, zombies=0
docker-srs-1 | [2022-07-07 21:07:08.848][Trace][1][s6m485x5] RTC: session address init [172.24.0.1:57131](http://172.24.0.1:57131/)
docker-srs-1 | [2022-07-07 21:07:08.848][Trace][1][s6m485x5] RTC: session STUN done, waiting DTLS handshake.
docker-srs-1 | [2022-07-07 21:07:08.848][Trace][1][v51641v7] <- RTC RECV #10, udp 1, pps 0/0, schedule 1
docker-srs-1 | [2022-07-07 21:07:08.866][Trace][1][s6m485x5] DTLS: State Passive RECV, done=0, arq=0/0, r0=1, r1=0, len=157, cnt=22, size=144, hs=1
docker-srs-1 | [2022-07-07 21:07:08.866][Trace][1][s6m485x5] DTLS: State Passive SEND, done=0, arq=0/0, r0=-1, r1=2, len=681, cnt=22, size=82, hs=2
docker-srs-1 | [2022-07-07 21:07:08.871][Trace][1][s6m485x5] DTLS: State Passive RECV, done=0, arq=0/0, r0=1, r1=0, len=578, cnt=22, size=299, hs=11
docker-srs-1 | [2022-07-07 21:07:08.872][Trace][1][s6m485x5] DTLS: State Passive SEND, done=1, arq=0/0, r0=1, r1=0, len=554, cnt=22, size=466, hs=4
docker-srs-1 | [2022-07-07 21:07:08.873][Trace][1][s6m485x5] RTC: DTLS handshake done.
docker-srs-1 | [2022-07-07 21:07:08.873][Trace][1][s6m485x5] RTC: session pub=1, sub=0, to=30000ms connection established
docker-srs-1 | [2022-07-07 21:07:08.873][Trace][1][s6m485x5] RTC: Publisher url=/live/teststream established
docker-srs-1 | [2022-07-07 21:07:08.873][Trace][1][s6m485x5] ignore disabled exec for vhost=__defaultVhost__
docker-srs-1 | [2022-07-07 21:07:08.874][Trace][1][s6m485x5] http: mount flv stream for sid=/live/teststream, mount=/live/teststream.flv
docker-srs-1 | [2022-07-07 21:07:13.643][Trace][1][5dhn1a28] Hybrid cpu=1.00%,18MB, cid=3,2, timer=55,3,15, clock=0,14,23,4,0,0,0,0,1, free=1, objs=(pkt:26,raw:23,fua:2,msg:26,oth:1,buf:15)
docker-srs-1 | [2022-07-07 21:07:13.643][Trace][1][5dhn1a28] RTC: Server conns=1
docker-srs-1 | [2022-07-07 21:07:13.658][Trace][1][0dvi5u9x] HTTP #0 [172.24.0.1:61044](http://172.24.0.1:61044/) GET http://192.168.4.73:8080/live/teststream.flv, content-length=-1
docker-srs-1 | [2022-07-07 21:07:13.658][Trace][1][0dvi5u9x] dispatch cached gop success. count=0, duration=-1
docker-srs-1 | [2022-07-07 21:07:13.658][Trace][1][0dvi5u9x] create consumer, active=1, queue_size=0.00, jitter=30000000
docker-srs-1 | [2022-07-07 21:07:13.659][Trace][1][0dvi5u9x] set fd=11, SO_SNDBUF=2626560=>175000, buffer=350ms
docker-srs-1 | [2022-07-07 21:07:13.659][Trace][1][0dvi5u9x] FLV /live/teststream.flv, encoder=FLV, nodelay=0, mw_sleep=350ms, cache=0, msgs=128
docker-srs-1 | [2022-07-07 21:07:14.863][Trace][1][5dhn1a28] RTC: Need PLI ssrc=3716716469, play=[5dhn1a28], publish=[s6m485x5], count=1/1
docker-srs-1 | [2022-07-07 21:07:14.864][Trace][1][s6m485x5] RTC: Request PLI ssrc=3716716469, play=[5dhn1a28], count=1/1, bytes=12B
docker-srs-1 | [2022-07-07 21:07:14.909][Trace][1][s6m485x5] 34B video sh,  codec(7, profile=Baseline, level=3.1, 640x400, 0kbps, 0.0fps, 0.0s)
docker-srs-1 | [2022-07-07 21:07:14.909][Trace][1][s6m485x5] set ts=3340237909, header=7390, lost=7391
docker-srs-1 | [2022-07-07 21:07:15.063][Trace][1][0dvi5u9x] FLV: write header audio=0, video=1
docker-srs-1 | [2022-07-07 21:07:15.587][Warn][1][s6m485x5][11] empty nalu
docker-srs-1 | [2022-07-07 21:07:18.644][Trace][1][5dhn1a28] Hybrid cpu=1.00%,18MB, cid=3,2, timer=55,3,15, clock=0,14,23,4,0,0,0,0,1, free=1, objs=(pkt:26,raw:23,fua:2,msg:26,oth:1,buf:15)
docker-srs-1 | [2022-07-07 21:07:18.645][Trace][1][5dhn1a28] RTC: Server conns=1
docker-srs-1 | [2022-07-07 21:07:18.863][Trace][1][v51641v7] <- RTC RECV #10, udp 577, pps 28/57, schedule 577
docker-srs-1 | [2022-07-07 21:07:20.964][Trace][1][s6m485x5] 34B video sh,  codec(7, profile=Baseline, level=3.1, 640x400, 0kbps, 0.0fps, 0.0s)
docker-srs-1 | [2022-07-07 21:07:20.964][Trace][1][s6m485x5] set ts=3340782949, header=7782, lost=7783
docker-srs-1 | [2022-07-07 21:07:21.645][Warn][1][s6m485x5][11] empty nalu
docker-srs-1 | [2022-07-07 21:07:23.645][Trace][1][5dhn1a28] Hybrid cpu=0.00%,19MB, cid=2,1, timer=61,11,47, clock=0,29,18,0,0,0,0,0,0, objs=(pkt:126,raw:122,fua:4,msg:135,oth:1,buf:63)
docker-srs-1 | [2022-07-07 21:07:23.645][Trace][1][5dhn1a28] RTC: Server conns=1, rpkts=(64,rtp:63,stun:1,rtcp:1), spkts=(12,rtp:0,stun:1,rtcp:22), rtcp=(pli:1,twcc:10,rr:1), snk=(47,a:0,v:47,h:0), fid=(id:0,fid:64,ffid:0,addr:1,faddr:64)
docker-srs-1 | [2022-07-07 21:07:26.967][Trace][1][5dhn1a28] RTC: Need PLI ssrc=3716716469, play=[5dhn1a28], publish=[s6m485x5], count=3/3
docker-srs-1 | [2022-07-07 21:07:26.967][Trace][1][s6m485x5] RTC: Request PLI ssrc=3716716469, play=[5dhn1a28], count=3/3, bytes=12B
docker-srs-1 | [2022-07-07 21:07:27.002][Trace][1][s6m485x5] 34B video sh,  codec(7, profile=Baseline, level=3.1, 640x400, 0kbps, 0.0fps, 0.0s)
docker-srs-1 | [2022-07-07 21:07:27.002][Trace][1][s6m485x5] set ts=3341325739, header=8173, lost=8174
docker-srs-1 | [2022-07-07 21:07:27.338][Trace][1][0dvi5u9x] -> HTS http: got 12 msgs, age=13677210, min=8, mw=350
docker-srs-1 | [2022-07-07 21:07:27.742][Warn][1][s6m485x5][11] empty nalu
docker-srs-1 | [2022-07-07 21:07:28.645][Trace][1][5dhn1a28] Hybrid cpu=1.00%,19MB, cid=2,1, timer=61,11,47, clock=0,29,18,0,0,0,0,0,0, objs=(pkt:126,raw:122,fua:4,msg:135,oth:1,buf:63)
docker-srs-1 | [2022-07-07 21:07:28.645][Trace][1][5dhn1a28] RTC: Server conns=1, rpkts=(64,rtp:63,stun:1,rtcp:1), spkts=(12,rtp:0,stun:1,rtcp:22), rtcp=(pli:1,twcc:10,rr:1), snk=(47,a:0,v:47,h:0), fid=(id:0,fid:64,ffid:0,addr:1,faddr:64)
docker-srs-1 | [2022-07-07 21:07:28.885][Trace][1][v51641v7] <- RTC RECV #10, udp 661, pps 40/65, schedule 661
docker-srs-1 | [2022-07-07 21:07:30.703][Trace][1][s6m485x5] 34B video sh,  codec(7, profile=Baseline, level=3.1, 640x400, 0kbps, 0.0fps, 0.0s)
docker-srs-1 | [2022-07-07 21:07:30.703][Trace][1][s6m485x5] set ts=3341658379, header=8391, lost=8392
docker-srs-1 | [2022-07-07 21:07:31.377][Warn][1][s6m485x5][11] empty nalu
docker-srs-1 | [2022-07-07 21:07:33.038][Trace][1][s6m485x5] 34B video sh,  codec(7, profile=Baseline, level=3.1, 640x400, 0kbps, 0.0fps, 0.0s)
docker-srs-1 | [2022-07-07 21:07:33.038][Trace][1][s6m485x5] set ts=3341868889, header=8532, lost=8533
docker-srs-1 | [2022-07-07 21:07:33.645][Trace][1][5dhn1a28] Hybrid cpu=0.00%,19MB, cid=2,1, timer=60,10,47, clock=0,28,18,1,0,0,0,0,0, objs=(pkt:122,raw:112,fua:9,msg:135,oth:1,buf:61)
docker-srs-1 | [2022-07-07 21:07:33.646][Trace][1][5dhn1a28] RTC: Server conns=1, rpkts=(62,rtp:61,stun:1,rtcp:1), spkts=(12,rtp:0,stun:1,rtcp:22), rtcp=(pli:1,twcc:9,rr:1), snk=(47,a:0,v:47,h:0), fid=(id:0,fid:62,ffid:0,addr:1,faddr:62)
docker-srs-1 | [2022-07-07 21:07:33.685][Warn][1][s6m485x5][11] empty nalu
docker-srs-1 | [2022-07-07 21:07:38.647][Trace][1][5dhn1a28] Hybrid cpu=1.00%,19MB, cid=2,1, timer=60,10,47, clock=0,28,18,1,0,0,0,0,0, objs=(pkt:122,raw:112,fua:9,msg:135,oth:1,buf:61)
docker-srs-1 | [2022-07-07 21:07:38.647][Trace][1][5dhn1a28] RTC: Server conns=1, rpkts=(62,rtp:61,stun:1,rtcp:1), spkts=(12,rtp:0,stun:1,rtcp:22), rtcp=(pli:1,twcc:9,rr:1), snk=(47,a:0,v:47,h:0), fid=(id:0,fid:62,ffid:0,addr:1,faddr:62)
docker-srs-1 | [2022-07-07 21:07:38.887][Trace][1][v51641v7] <- RTC RECV #10, udp 637, pps 46/63, schedule 637
docker-srs-1 | [2022-07-07 21:07:39.072][Trace][1][5dhn1a28] RTC: Need PLI ssrc=3716716469, play=[5dhn1a28], publish=[s6m485x5], count=5/5
docker-srs-1 | [2022-07-07 21:07:39.072][Trace][1][s6m485x5] RTC: Request PLI ssrc=3716716469, play=[5dhn1a28], count=5/5, bytes=12B
docker-srs-1 | [2022-07-07 21:07:39.098][Trace][1][v51641v7] 34B video sh,  codec(7, profile=Baseline, level=3.1, 640x400, 0kbps, 0.0fps, 0.0s)
docker-srs-1 | [2022-07-07 21:07:39.098][Trace][1][v51641v7] set ts=3342413749, header=8926, lost=8927
docker-srs-1 | [2022-07-07 21:07:39.264][Trace][1][0dvi5u9x] -> HTS http: got 7 msgs, age=25604377, min=8, mw=350
docker-srs-1 | [2022-07-07 21:07:39.776][Warn][1][s6m485x5][11] empty nalu
docker-srs-1 | [2022-07-07 21:07:43.648][Trace][1][5dhn1a28] Hybrid cpu=2.00%,19MB, cid=2,1, timer=60,10,47, clock=0,28,18,1,0,0,0,0,0, objs=(pkt:122,raw:112,fua:9,msg:135,oth:1,buf:61)
docker-srs-1 | [2022-07-07 21:07:43.648][Trace][1][5dhn1a28] RTC: Server conns=1, rpkts=(62,rtp:61,stun:1,rtcp:1), spkts=(12,rtp:0,stun:1,rtcp:22), rtcp=(pli:1,twcc:9,rr:1), snk=(47,a:0,v:47,h:0), fid=(id:0,fid:62,ffid:0,addr:1,faddr:62)
  1. SRS Config (配置):
listen              1935;
max_connections     1000;
srs_log_tank        console;
daemon              off;

http_api {
    enabled         on;
    listen          1985;
    crossdomain     on;
}

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

rtc_server {
    enabled on;
    listen 8000;
    candidate $CANDIDATE;
}

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

Replay (重现)

Please describe how to replay the bug? (重现Bug的步骤)

  1. Stream screen capture through WebRTC using getDisplayMedia()
  2. Enforce FPS to be 30, size of video approximately width = 640 to match web camera resolution
  3. Connect to FLV stream in SRS console
  4. Feel the pain of 20 seconds latency

Expect (Expected Behavior)

FPS to be similar to RTC stream coming from web camera

TRANS_BY_GPT3

stolbivi commented 2 years ago

One more observation, when streaming is web camera there's almost no warning 'empty nalu', when I switch to screen capture, this warning is appearing every 2-6 seconds on a regular basis. Would that be relevant?

TRANS_BY_GPT3

winlinvip commented 2 years ago

The latency of HTTP-FLV might be much higher than WebRTC, especially after coverting WebRTC to HTTP-FLV. Need to do some hard work to refine it, not easy.

galaxy-s10 commented 1 year ago

This is similar to the previous issue: https://github.com/ossrs/srs/issues/2677

TRANS_BY_GPT3