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

WebRTC: Can't play stream use native WebRTC code. c++ calls SRS's HTTP interface to pull WebRTC stream, but the receiving end does not receive the stream. #3435

Closed wdl-stark closed 1 year ago

wdl-stark commented 1 year ago

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

Description

Using C++ to call SRS's HTTP interface to pull a WebRTC stream, the SDP and ICE negotiation are both successful, but the receiving end cannot receive the stream.

  1. SRS Version: 6.0.26

  2. SRS Log: [2023-02-23 22:52:39.736][INFO][73282][5214o3fy] XCORE-SRS/6.0.26(Bee) [2023-02-23 22:52:39.737][INFO][73282][5214o3fy] config parse complete [2023-02-23 22:52:39.737][INFO][73282][5214o3fy] write log to console [2023-02-23 22:52:39.737][INFO][73282][5214o3fy] SRS/6.0.26(Bee), MIT [2023-02-23 22:52:39.737][INFO][73282][5214o3fy] authors: Winlinwinlin@vip.126.com ZhaoWenjiezhaowenjie@tal.com ShiWeishiwei05@kuaishou.com XiaoZhihonghondaxiao@tencent.com WuPengqiangpengqiang.wpq@alibaba-inc.com XiaLixinxialixin@kanzhun.com LiPengmozhan.lp@alibaba-inc.com ChenGuanghuajinxue.cgh@alibaba-inc.com ChenHaibonmgchenhaibo@foxmail.com and https://github.com/ossrs/srs/blob/develop/trunk/AUTHORS.md#contributors [2023-02-23 22:52:39.737][INFO][73282][5214o3fy] cwd=/home/wdl/sources/srs.4.0/trunk, work_dir=./, build: 2023-02-22 01:52:14, configure: --gb28181=on, uname: Linux ubuntu 5.4.0-81-generic #91~18.04.1-Ubuntu SMP Fri Jul 23 13:36:29 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux, osx: 0, env: 0, pkg: [2023-02-23 22:52:39.737][INFO][73282][5214o3fy] configure detail: --prefix=/usr/local/srs --config=conf/srs.conf --osx=off --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-converter=on --http-api=on --utest=off --cherrypy=off --srt=on --rtc=on --h265=off --gb28181=on --simulator=off --cxx11=on --cxx14=off --backtrace=on --ffmpeg-fit=on --ffmpeg-opus=off --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 --log-level_v2=on --gcov=off --apm=off --debug=off --debug-stats=off --cross-build=off --sanitizer=on --sanitizer-static=off --sanitizer-log=off --cygwin64=off --single-thread=off --cc=gcc --cxx=g++ --ar=ar --ld=ld --randlib=randlib [2023-02-23 22:52:39.737][INFO][73282][5214o3fy] srs checking config... [2023-02-23 22:52:39.738][INFO][73282][5214o3fy] ips, iface[0] ens33 ipv4 0x11043 192.168.31.58, iface[1] ens33 ipv6 0x11043 fe80::7b81:2b17:ccd9:2a0e%ens33 [2023-02-23 22:52:39.738][INFO][73282][5214o3fy] devices, intranet ens33 192.168.31.58, intranet ens33 fe80::7b81:2b17:ccd9:2a0e%ens33 [2023-02-23 22:52:39.738][WARN][73282][5214o3fy][22] stats network use index=0, ip=192.168.31.58, ifname=ens33 [2023-02-23 22:52:39.738][WARN][73282][5214o3fy][22] stats disk not configed, disk iops disabled. [2023-02-23 22:52:39.738][INFO][73282][5214o3fy] write log to console [2023-02-23 22:52:39.738][INFO][73282][5214o3fy] 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 [2023-02-23 22:52:39.738][INFO][73282][5214o3fy] SRS on amd64 x86_64, conf:conf/rtc2rtmp.conf, limit:1000, writev:1024, encoding:little-endian, HZ:100 [2023-02-23 22:52:39.738][INFO][73282][5214o3fy] mw sleep:350ms. mr enabled:on, default:0, sleep:350ms [2023-02-23 22:52:39.738][INFO][73282][5214o3fy] gc:on, pq:30000ms, cscc:[0,16), csa:on, tn:on(may hurts performance), ss:auto(guess by merged write) [2023-02-23 22:52:39.738][INFO][73282][5214o3fy] system default latency(ms): mw(0-350) + mr(0-350) + play-queue(0-30000) [2023-02-23 22:52:39.738][WARN][73282][5214o3fy][22] SRS/6.0.26 is not stable [2023-02-23 22:52:39.738][INFO][73282][5214o3fy] write pid=73282 to ./objs/srs.pid success! [2023-02-23 22:52:39.738][INFO][73282][5214o3fy] Thread #1(primordial): init name=srs-master-1, interval=5000ms [2023-02-23 22:52:39.739][INFO][73282][5214o3fy] Pool: Start threads primordial=1, hybrids=1 ok [2023-02-23 22:52:39.740][INFO][73282][522zaw99] Thread #2: run with tid=73283, entry=0x60c000000400, label=hybrid, name=srs-hybrid-2 [2023-02-23 22:52:39.751][INFO][73282][522zaw99] fingerprint=33:72:03:C0:0E:D9:75:4D:70:D5:D6:AB:92:B4:9C:B4:D8:9A:EB:6E:CF:45:A1:9E:77:0B:A4:8A:6C:87:37:E3 [2023-02-23 22:52:39.751][INFO][73282][522zaw99] CircuitBreaker: enabled=1, high=2x90, critical=1x95, dying=5x99 [2023-02-23 22:52:39.751][INFO][73282][522zaw99] http flv live stream, vhost=defaultVhost, mount=[vhost]/[app]/[stream].flv [2023-02-23 22:52:39.752][INFO][73282][522zaw99] http: root mount to ./objs/nginx/html [2023-02-23 22:52:39.752][INFO][73282][522zaw99] server main cid=522zaw99, pid=73282, ppid=73273, asprocess=0 [2023-02-23 22:52:39.752][INFO][73282][522zaw99] RTMP listen at tcp://0.0.0.0:1935, fd=9 [2023-02-23 22:52:39.753][INFO][73282][522zaw99] HTTP-API listen at tcp://0.0.0.0:1985, fd=10 [2023-02-23 22:52:39.753][INFO][73282][522zaw99] HTTP-Server listen at tcp://0.0.0.0:8080, fd=11 [2023-02-23 22:52:39.753][INFO][73282][522zaw99] signal installed, reload=1, reopen=10, fast_quit=15, grace_quit=3 [2023-02-23 22:52:39.754][INFO][73282][522zaw99] http: api mount /console to ./objs/nginx/html/console [2023-02-23 22:52:39.754][INFO][73282][522zaw99] rtc listen at udp://0.0.0.0:8000, fd=12 [2023-02-23 22:52:39.754][INFO][73282][l76zh51n] Hybrid cpu=0.00%,41MB [2023-02-23 22:52:39.754][WARN][73282][z363819p][22] use private address as ip: 192.168.31.58, ifname=ens33 [2023-02-23 22:52:39.754][INFO][73282][z363819p] Startup query id=vid-0qq7745, session=vid-65b4521, eip=192.168.31.58, wait=300s [2023-02-23 22:52:39.755][INFO][73282][lf6z1hb4] TCP: connection manager run, conns=0 [2023-02-23 22:52:39.755][INFO][73282][xi7bq7tc] GB: connection manager run, conns=0 [2023-02-23 22:52:39.755][INFO][73282][s4rd1907] SRT: connection manager run, conns=0 [2023-02-23 22:52:39.755][INFO][73282][56291a03] UDP #12 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) [2023-02-23 22:52:39.755][INFO][73282][968uy341] RTC: connection manager run, conns=0 [2023-02-23 22:52:44.740][INFO][73282][l76zh51n] Hybrid cpu=0.00%,41MB [2023-02-23 22:52:44.747][INFO][73282][5214o3fy] Process: cpu=1.00%,41MB, threads=2 [2023-02-23 22:52:44.978][INFO][73282][k53x34v8] RTMP client ip=192.168.31.56:55896, fd=13 [2023-02-23 22:52:44.979][INFO][73282][k53x34v8] complex handshake success [2023-02-23 22:52:44.979][INFO][73282][k53x34v8] connect app, tcUrl=rtmp://192.168.31.58:1935/live, pageUrl=, swfUrl=, schema=rtmp, vhost=192.168.31.58, port=1935, app=live, args=null [2023-02-23 22:52:44.979][INFO][73282][k53x34v8] protocol in.buffer=0, in.ack=0, out.ack=0, in.chunk=128, out.chunk=128 [2023-02-23 22:52:45.021][INFO][73282][k53x34v8] client identified, type=fmle-publish, vhost=192.168.31.58, app=live, stream=test, param=, duration=0ms [2023-02-23 22:52:45.021][INFO][73282][k53x34v8] connected stream, tcUrl=rtmp://192.168.31.58:1935/live, pageUrl=, swfUrl=, schema=rtmp, vhost=defaultVhost, port=1935, app=live, stream=test, param=, args=null [2023-02-23 22:52:45.021][INFO][73282][k53x34v8] new live source, stream_url=/live/test [2023-02-23 22:52:45.022][INFO][73282][k53x34v8] source url=/live/test, ip=192.168.31.56, cache=1/2500, is_edge=0, source_id=/ [2023-02-23 22:52:45.064][INFO][73282][k53x34v8] new rtc source, stream_url=/live/test [2023-02-23 22:52:45.064][INFO][73282][k53x34v8] RTC bridge from RTMP, rtmp2rtc=1, keep_bframe=0, merge_nalus=0 [2023-02-23 22:52:45.064][INFO][73282][k53x34v8] ignore disabled exec for vhost=defaultVhost [2023-02-23 22:52:45.064][INFO][73282][k53x34v8] http: mount flv stream for sid=/live/test, mount=/live/test.flv [2023-02-23 22:52:45.064][INFO][73282][k53x34v8] start publish mr=0/350, p1stpt=20000, pnt=5000, tcp_nodelay=0 [2023-02-23 22:52:45.106][INFO][73282][k53x34v8] got metadata, width=1920, height=800, vcodec=7, acodec=10 [2023-02-23 22:52:45.107][INFO][73282][k53x34v8] 53B video sh, codec(7, profile=High, level=4, 1920x800, 0kbps, 0.0fps, 0.0s) [2023-02-23 22:52:45.107][INFO][73282][k53x34v8] 4B audio sh, codec(10, profile=LC, 2channels, 0kbps, 44100HZ), flv(16bits, 2channels, 44100HZ) [2023-02-23 22:52:45.108][INFO][73282][k53x34v8] RTMP2RTC: Init audio codec to 10(AAC) [2023-02-23 22:52:49.740][INFO][73282][l76zh51n] Hybrid cpu=2.00%,49MB [2023-02-23 22:52:49.753][INFO][73282][5214o3fy] Process: cpu=3.00%,50MB, threads=2 [2023-02-23 22:52:52.511][INFO][73282][ui3cuc91] HTTP #0 192.168.31.56:55902 POST http://192.168.31.58:1985/rtc/v1/play/, content-length=5008 [2023-02-23 22:52:52.511][INFO][73282][ui3cuc91] RTC play webrtc://192.168.31.58/live/test, api=http://192.168.31.58:1985/rtc/v1/play/, tid=, clientip=192.168.31.56, app=live, stream=test, offer=4864B, eip=, codec=, srtp=, dtls= [2023-02-23 22:52:52.511][INFO][73282][ui3cuc91] ignore attribute=, value= [2023-02-23 22:52:52.513][INFO][73282][ui3cuc91] RTC player nack=1, nnc=1 [2023-02-23 22:52:52.513][INFO][73282][ui3cuc91] RTC connection player gcc=3 [2023-02-23 22:52:52.513][INFO][73282][ui3cuc91] RTC: Init tracks {track: video-x8756t7u, is_active: 0=>1},{track: audio-6d104hsj, is_active: 0=>1}, ok [2023-02-23 22:52:52.513][INFO][73282][ui3cuc91] Best matched ip=192.168.31.58, ifname=ens33 [2023-02-23 22:52:52.513][INFO][73282][ui3cuc91] RTC: Use candidates 192.168.31.58, protocol=udp [2023-02-23 22:52:52.515][INFO][73282][ui3cuc91] RTC init session, user=gg06l308:XP6P, url=/live/test, encrypt=1/1, DTLS(role=passive, version=auto), timeout=30000ms, nack=1 [2023-02-23 22:52:52.515][INFO][73282][ui3cuc91] RTC username=gg06l308:XP6P, dtls=1, srtp=1, offer=4864B, answer=1543B [2023-02-23 22:52:52.515][INFO][73282][ui3cuc91] RTC remote offer: v=0\r\no=- 1864536501362413371 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 102 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:XP6P\r\na=ice-pwd:08CsuFCCb10ic6SoDCXWgmSs\r\na=ice-options:trickle\r\na=fingerprint:sha-256 B2:DB:28:DB:95:86:9B:7E:97:18:01:A5:60:9E:3D:CB:48:0D:C7:27:8F:0D:48:5F:54:97:D2:FC:8C:AB:87:C7\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=extmap:5 urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id\r\na=extmap:6 urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id\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:102 ILBC/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 127 121 125 120 124 107 108 109 119 118 123 35\r\nc=IN IP4 0.0.0.0\r\na=rtcp:9 IN IP4 0.0.0.0\r\na=ice-ufrag:XP6P\r\na=ice-pwd:08CsuFCCb10ic6SoDCXWgmSs\r\na=ice-options:trickle\r\na=fingerprint:sha-256 B2:DB:28:DB:95:86:9B:7E:97:18:01:A5:60:9E:3D:CB:48:0D:C7:27:8F:0D:48:5F:54:97:D2:FC:8C:AB:87:C7\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:12 http://www.webrtc.org/experiments/rtp-hdrext/playout-delay\r\na=extmap:11 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:5 urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id\r\na=extmap:6 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: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;x-google-max-bitrate=18000;x-google-min-bitrate=5000;x-google-start-bitrate=7000\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;x-google-max-bitrate=18000;x-google-min-bitrate=5000;x-google-start-bitrate=7000\r\na=rtpmap:120 rtx/90000\r\na=fmtp:120 apt=125\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=42e01f;x-google-max-bitrate=18000;x-google-min-bitrate=5000;x-google-start-bitrate=7000\r\na=rtpmap:107 rtx/90000\r\na=fmtp:107 apt=124\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;x-google-max-bitrate=18000;x-google-min-bitrate=5000;x-google-start-bitrate=7000\r\na=rtpmap:109 rtx/90000\r\na=fmtp:109 apt=108\r\na=rtpmap:119 red/90000\r\na=rtpmap:118 rtx/90000\r\na=fmtp:118 apt=119\r\na=rtpmap:123 ulpfec/90000\r\na=rtpmap:35 flexfec-03/90000\r\na=rtcp-fb:35 goog-remb\r\na=rtcp-fb:35 transport-cc\r\na=fmtp:35 repair-window=10000000\r\n [2023-02-23 22:52:52.515][INFO][73282][ui3cuc91] RTC local answer: v=0\r\no=SRS/6.0.26(Bee) 107545981163648 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/test\r\nm=audio 9 UDP/TLS/RTP/SAVPF 111\r\nc=IN IP4 0.0.0.0\r\na=ice-ufrag:gg06l308\r\na=ice-pwd:9h03aon4nq6hj5s8638o37943928nz67\r\na=fingerprint:sha-256 33:72:03:C0:0E:D9:75:4D:70:D5:D6:AB:92:B4:9C:B4:D8:9A:EB:6E:CF:45:A1:9E:77:0B:A4:8A:6C:87:37:E3\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:740221485 cname:501023t5b6075y71\r\na=ssrc:740221485 label:audio-6d104hsj\r\na=candidate:0 1 udp 2130706431 192.168.31.58 8000 typ host generation 0\r\nm=video 9 UDP/TLS/RTP/SAVPF 124\r\nc=IN IP4 0.0.0.0\r\na=ice-ufrag:gg06l308\r\na=ice-pwd:9h03aon4nq6hj5s8638o37943928nz67\r\na=fingerprint:sha-256 33:72:03:C0:0E:D9:75:4D:70:D5:D6:AB:92:B4:9C:B4:D8:9A:EB:6E:CF:45:A1:9E:77:0B:A4:8A:6C:87:37:E3\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:124 H264/90000\r\na=rtcp-fb:124 transport-cc\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=42e01f\r\na=ssrc:740221486 cname:501023t5b6075y71\r\na=ssrc:740221486 label:video-x8756t7u\r\na=candidate:0 1 udp 2130706431 192.168.31.58 8000 typ host generation 0\r\n [2023-02-23 22:52:52.516][INFO][73282][ui3cuc91] TCP: before dispose resource(HttpConn)(0x607000006680), conns=2, zombies=0, ign=0, inz=0, ind=0 [2023-02-23 22:52:52.517][WARN][73282][ui3cuc91][104] client disconnect peer. ret=1007 [2023-02-23 22:52:52.517][INFO][73282][lf6z1hb4] TCP: clear zombies=1 resources, conns=2, removing=0, unsubs=0 [2023-02-23 22:52:52.517][INFO][73282][ui3cuc91] TCP: disposing #0 resource(HttpConn)(0x607000006680), conns=2, disposing=1, zombies=0 [2023-02-23 22:52:53.905][INFO][73282][ui3cuc91] RTC: session address init 192.168.31.56:61863 [2023-02-23 22:52:53.905][INFO][73282][ui3cuc91] RTC: session STUN done, waiting DTLS handshake. [2023-02-23 22:52:53.905][INFO][73282][56291a03] <- RTC RECV #12, udp 1, pps 0/0, schedule 1 [2023-02-23 22:52:53.906][INFO][73282][ui3cuc91] DTLS: State Passive RECV, done=0, arq=0/0, r0=1, r1=0, len=153, cnt=22, size=140, hs=1 [2023-02-23 22:52:53.906][INFO][73282][ui3cuc91] DTLS: State Passive SEND, done=0, arq=0/0, r0=-1, r1=2, len=680, cnt=22, size=82, hs=2 [2023-02-23 22:52:53.907][INFO][73282][ui3cuc91] DTLS: State Passive RECV, done=0, arq=0/0, r0=1, r1=0, len=576, cnt=22, size=298, hs=11 [2023-02-23 22:52:53.908][INFO][73282][ui3cuc91] DTLS: State Passive SEND, done=1, arq=0/0, r0=1, r1=0, len=554, cnt=22, size=466, hs=4 [2023-02-23 22:52:53.908][INFO][73282][ui3cuc91] RTC: DTLS handshake done. [2023-02-23 22:52:53.908][INFO][73282][ui3cuc91] RTC: session pub=0, sub=1, to=30000ms connection established [2023-02-23 22:52:53.908][INFO][73282][ui3cuc91] RTC: Subscriber url=/live/test established [2023-02-23 22:52:53.909][INFO][73282][ui3cuc91] create consumer, no gop cache [2023-02-23 22:52:53.909][INFO][73282][ui3cuc91] RTC: start play url=/live/test, source_id=k53x34v8/k53x34v8, realtime=1, mw_msgs=0 [2023-02-23 22:52:53.912][INFO][73282][ui3cuc91] RTC: Jitter init base=100, value=438 [2023-02-23 22:52:53.912][INFO][73282][ui3cuc91] RTC: Jitter rebase value=438, last=0, distance=-438, pkt-base=438/438, correct-base=100/0 [2023-02-23 22:52:53.912][INFO][73282][ui3cuc91] RTC: Jitter init base=10000, value=420192 [2023-02-23 22:52:53.913][INFO][73282][ui3cuc91] RTC: Jitter rebase value=420192, last=0, distance=-420192, pkt-base=420192/420192, correct-base=10000/0 [2023-02-23 22:52:53.924][INFO][73282][ui3cuc91] RTC: Jitter init base=200, value=1580 [2023-02-23 22:52:53.924][INFO][73282][ui3cuc91] RTC: Jitter rebase value=1580, last=0, distance=-1580, pkt-base=1580/1580, correct-base=200/0 [2023-02-23 22:52:53.924][INFO][73282][ui3cuc91] RTC: Jitter init base=20000, value=793080 [2023-02-23 22:52:53.924][INFO][73282][ui3cuc91] RTC: Jitter rebase value=793080, last=0, distance=-793080, pkt-base=793080/793080, correct-base=20000/0 [2023-02-23 22:52:54.740][INFO][73282][l76zh51n] Hybrid cpu=3.99%,56MB, cid=5,2, timer=60,0,6, clock=1,30,16,1,1,1,0,0,0, free=1, objs=(pkt:167,raw:52,fua:115,msg:254,oth:1,buf:32) [2023-02-23 22:52:54.741][INFO][73282][l76zh51n] RTC: Server conns=1 [2023-02-23 22:52:54.761][INFO][73282][5214o3fy] Process: cpu=5.00%,58MB, threads=2 [2023-02-23 22:52:59.741][INFO][73282][l76zh51n] Hybrid cpu=4.00%,63MB, cid=5,2, timer=60,0,6, clock=1,30,16,1,1,1,0,0,0, free=1, objs=(pkt:167,raw:52,fua:115,msg:254,oth:1,buf:32) [2023-02-23 22:52:59.741][INFO][73282][l76zh51n] RTC: Server conns=1 [2023-02-23 22:52:59.768][INFO][73282][5214o3fy] Process: cpu=5.00%,64MB, threads=2

  3. 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 $CANDIDATE;

}

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: Run the SRS server. ./objs/srs -c conf/rtc2rtmp.cnf

Step 2: Use ffmpeg to push RTMP stream to the SRS server.

.\ffmpeg.exe -re -stream_loop -1 -i C:\Users\wdl\Desktop\2_audio.flv -vcodec copy -acodec copy -f flv -y rtmp://192.168.31.58/live/test

Step 3: Run my own C++ program to pull the WebRTC stream.

  1. Call the SRS HTTP API: "http://192.168.31.58:1985/rtc/v1/play/"
  2. Use WebRTC's CreateOffer to create an offer and obtain the SDP.
  3. Send the offer SDP to the SRS server.
  4. SRS server responds with answer SDP and ICE.
  5. Successful negotiation of SDP and ICE, connection established.

    Expect

Expected to receive the video stream sent by the streaming media, but have not received it yet. The error reported by the pulling end is as follows: [007:196][48036] (webrtc_video_engine.cc:3474): Absent receive stream; ignoring clearing encoded frame sink for ssrc 0 [007:233][31176] (basic_port_allocator.cc:941): Discarding candidate because port is already done gathering. [007:395][48036] (video_receive_stream2.cc:921): No decodable frame in 200 ms, requesting keyframe. [007:596][48036] (video_receive_stream2.cc:921): No decodable frame in 200 ms, requesting keyframe. [007:796][48036] (video_receive_stream2.cc:921): No decodable frame in 200 ms, requesting keyframe. [007:997][48036] (video_receive_stream2.cc:921): No decodable frame in 200 ms, requesting keyframe. [008:197][48036] (video_receive_stream2.cc:921): No decodable frame in 200 ms, requesting keyframe. [008:397][48036] (video_receive_stream2.cc:921): No decodable frame in 200 ms, requesting keyframe. [008:598][48036] (video_receive_stream2.cc:921): No decodable frame in 200 ms, requesting keyframe. [008:799][48036] (video_receive_stream2.cc:921): No decodable frame in 200 ms, requesting keyframe. [008:944][48036] (rtp_seq_num_only_ref_finder.cc:65): Generic frame with packet range [130, 130] has no GoP, dropping frame. [008:944][48036] (rtp_seq_num_only_ref_finder.cc:65): Generic frame with packet range [125, 129] has no GoP, dropping frame. [008:945][48036] (rtp_seq_num_only_ref_finder.cc:65): Generic frame with packet range [124, 124] has no GoP, dropping frame. [008:945][48036] (rtp_seq_num_only_ref_finder.cc:65): Generic frame with packet range [123, 123] has no GoP, dropping frame. [008:945][48036] (rtp_seq_num_only_ref_finder.cc:65): Generic frame with packet range [122, 122] has no GoP, dropping frame. [008:946][48036] (rtp_seq_num_only_ref_finder.cc:65): Generic frame with packet range [116, 121] has no GoP, dropping frame. [008:946][48036] (rtp_seq_num_only_ref_finder.cc:65): Generic frame with packet range [115, 115] has no GoP, dropping frame. [008:947][48036] (rtp_seq_num_only_ref_finder.cc:65): Generic frame with packet range [114, 114] has no GoP, dropping frame. [008:947][48036] (rtp_seq_num_only_ref_finder.cc:65): Generic frame with packet range [113, 113] has no GoP, dropping frame. [008:947][48036] (rtp_seq_num_only_ref_finder.cc:65): Generic frame with packet range [103, 112] has no GoP, dropping frame. [008:948][48036] (rtp_seq_num_only_ref_finder.cc:65): Generic frame with packet range [102, 102] has no GoP, dropping frame. [008:948][48036] (rtp_seq_num_only_ref_finder.cc:65): Generic frame with packet range [94, 101] has no GoP, dropping frame. [008:949][48036] (rtp_seq_num_only_ref_finder.cc:65): Generic frame with packet range [93, 93] has no GoP, dropping frame. [008:949][48036] (rtp_seq_num_only_ref_finder.cc:65): Generic frame with packet range [92, 92] has no GoP, dropping frame. [008:949][48036] (rtp_seq_num_only_ref_finder.cc:65): Generic frame with packet range [91, 91] has no GoP, dropping frame. [008:950][48036] (rtp_seq_num_only_ref_finder.cc:65): Generic frame with packet range [81, 90] has no GoP, dropping frame. [008:950][48036] (rtp_seq_num_only_ref_finder.cc:65): Generic frame with packet range [80, 80] has no GoP, dropping frame. [008:951][48036] (rtp_seq_num_only_ref_finder.cc:65): Generic frame with packet range [79, 79] has no GoP, dropping frame. [008:951][48036] (rtp_seq_num_only_ref_finder.cc:65): Generic frame with packet range [78, 78] has no GoP, dropping frame. [008:951][48036] (rtp_seq_num_only_ref_finder.cc:65): Generic frame with packet range [69, 77] has no GoP, dropping frame. [008:952][48036] (rtp_seq_num_only_ref_finder.cc:65): Generic frame with packet range [68, 68] has no GoP, dropping frame. [008:952][48036] (rtp_seq_num_only_ref_finder.cc:65): Generic frame with packet range [67, 67] has no GoP, dropping frame. [008:953][48036] (rtp_seq_num_only_ref_finder.cc:65): Generic frame with packet range [66, 66] has no GoP, dropping frame. [008:953][48036] (rtp_seq_num_only_ref_finder.cc:65): Generic frame with packet range [56, 65] has no GoP, dropping frame. [008:953][48036] (rtp_seq_num_only_ref_finder.cc:65): Generic frame with packet range [55, 55] has no GoP, dropping frame. [008:954][48036] (rtp_seq_num_only_ref_finder.cc:65): Generic frame with packet range [54, 54] has no GoP, dropping frame. [008:954][48036] (rtp_seq_num_only_ref_finder.cc:65): Generic frame with packet range [53, 53] has no GoP, dropping frame. [008:955][48036] (rtp_seq_num_only_ref_finder.cc:65): Generic frame with packet range [42, 52] has no GoP, dropping frame. [008:955][48036] (rtp_seq_num_only_ref_finder.cc:65): Generic frame with packet range [41, 41] has no GoP, dropping frame. [008:955][48036] (rtp_seq_num_only_ref_finder.cc:65): Generic frame with packet range [40, 40] has no GoP, dropping frame. [008:956][48036] (rtp_seq_num_only_ref_finder.cc:65): Generic frame with packet range [39, 39] has no GoP, dropping frame. [008:956][48036] (rtp_seq_num_only_ref_finder.cc:65): Generic frame with packet range [28, 38] has no GoP, dropping frame. [008:957][48036] (rtp_seq_num_only_ref_finder.cc:65): Generic frame with packet range [27, 27] has no GoP, dropping frame. [008:957][48036] (rtp_seq_num_only_ref_finder.cc:65): Generic frame with packet range [26, 26] has no GoP, dropping frame. [008:957][48036] (rtp_seq_num_only_ref_finder.cc:65): Generic frame with packet range [25, 25] has no GoP, dropping frame. [008:958][48036] (rtp_seq_num_only_ref_finder.cc:65): Generic frame with packet range [16, 24] has no GoP, dropping frame. [008:958][48036] (rtp_seq_num_only_ref_finder.cc:65): Generic frame with packet range [15, 15] has no GoP, dropping frame. [008:959][48036] (rtp_seq_num_only_ref_finder.cc:65): Generic frame with packet range [14, 14] has no GoP, dropping frame. [008:960][48036] (rtp_seq_num_only_ref_finder.cc:65): Generic frame with packet range [13, 13] has no GoP, dropping frame. [008:960][48036] (rtp_seq_num_only_ref_finder.cc:65): Generic frame with packet range [1, 12] has no GoP, dropping frame. [008:961][48036] (rtp_seq_num_only_ref_finder.cc:65): Generic frame with packet range [0, 0] has no GoP, dropping frame. frame_count:1 frame_count:2 [h264 @ 000002570335bdc0] no frame! [009:020][21460] (h264_decoder_impl.cc:294): avcodec_send_packet error: -1094995529 [009:020][21460] (generic_decoder.cc:296): Failed to decode frame with timestamp 161280, error code: -1 [009:220][48036] (video_receive_stream2.cc:921): No decodable frame in 200 ms, requesting keyframe. [009:421][48036] (video_receive_stream2.cc:921): No decodable frame in 200 ms, requesting keyframe. [009:621][48036] (video_receive_stream2.cc:921): No decodable frame in 200 ms, requesting keyframe. [009:822][48036] (video_receive_stream2.cc:921): No decodable frame in 200 ms, requesting keyframe. [010:022][48036] (video_receive_stream2.cc:921): No decodable frame in 200 ms, requesting keyframe. [010:222][48036] (video_receive_stream2.cc:921): No decodable frame in 200 ms, requesting keyframe. [010:422][48036] (video_receive_stream2.cc:921): No decodable frame in 200 ms, requesting keyframe. [010:622][48036] (video_receive_stream2.cc:921): No decodable frame in 200 ms, requesting keyframe. [010:823][48036] (video_receive_stream2.cc:921): No decodable frame in 200 ms, requesting keyframe. [011:024][48036] (video_receive_stream2.cc:921): No decodable frame in 200 ms, requesting keyframe. [011:224][48036] (video_receive_stream2.cc:921): No decodable frame in 200 ms, requesting keyframe. [011:425][48036] (video_receive_stream2.cc:921): No decodable frame in 200 ms, requesting keyframe. [011:626][48036] (video_receive_stream2.cc:921): No decodable frame in 200 ms, requesting keyframe. [011:826][48036] (video_receive_stream2.cc:921): No decodable frame in 200 ms, requesting keyframe. [012:027][48036] (video_receive_stream2.cc:921): No decodable frame in 200 ms, requesting keyframe.

TRANS_BY_GPT3

wdl-stark commented 1 year ago

I see that the SRS log prints a warning message every time a stream is pulled, saying "client disconnect peer. ret=1007". I'm not sure what this error message indicates.

TRANS_BY_GPT3

wdl-stark commented 1 year ago

RAY7GLU7I75XS7`U62{)3PV

winlinvip commented 1 year ago

Try using H5, if there are any issues with H5, you can reply to this issue. If there are no issues, I will close it.

If you want to troubleshoot the issues in your code, it falls under consultation, after all, you write the bugs and I help you find them.

For consultation and discussion, please join the Paid Planet for communication. You can also join the WeChat group to communicate within the group.

TRANS_BY_GPT3

wdl-stark commented 1 year ago

Try using H5, if there are any issues with H5, you can reply to this issue. If there are no issues, I will close it.

If you want to troubleshoot the issues in your code, it falls under consultation. After all, if you write bugs, I can help you debug them.

For consultation and discussion, please join the Paid Planet for communication. You can also join the WeChat group to communicate within the group. Thank you for your reply. It seems to be a code issue. Currently, I am able to stream, but there is a severe frame loss. Only a few frames are decoded per second, and I'm not sure what the problem is.

TRANS_BY_GPT3