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.78k stars 307 forks source link

No way to get an webrtc stream from my reolink cameras #1149

Open cryd-s opened 1 month ago

cryd-s commented 1 month ago

Hi there i have now tried several days to get a webrtc stream from my reolink doorbell / reolink wa511 etc. But i am not able to get a webrtc only mse.

Can someone help me please!

api:
  origin: '*'
ffmpeg:
  h264/rk: -c:v h264_rkmpp_encoder -g 50 -bf 0
  h265/rk: -c:v hevc_rkmpp_encoder -g 50 -bf 0
hass:
  config: /config
log:
  format: text
rtsp:
  default_query: mp4
streams:
  einfahrt:
  - ffmpeg:http://192.168.10.63/flv?port=1935&app=bcs&stream=channel0_main.bcs&user=admin&password=xxxxxxxxxx#video=copy#audio=copy#audio=opus
  einfahrt_ext:
  - ffmpeg:http://192.168.10.63/flv?port=1935&app=bcs&stream=channel0_ext.bcs&user=admin&password=xxxxxxxxxx
  garage:
  - ffmpeg:http://192.168.10.64/flv?port=1935&app=bcs&stream=channel0_main.bcs&user=admin&password=xxxxxxxxxx#video=copy#audio=copy#audio=opus
  garage_ext:
  - ffmpeg:http://192.168.10.64/flv?port=1935&app=bcs&stream=channel0_ext.bcs&user=admin&password=xxxxxxxxxx
  garten:
  - ffmpeg:http://192.168.10.60/flv?port=1935&app=bcs&stream=channel0_main.bcs&user=admin&password=xxxxxxxxxx#video=copy#audio=copy#audio=opus
  garten_2:
  - ffmpeg:http://192.168.10.62/flv?port=1935&app=bcs&stream=channel0_main.bcs&user=admin&password=xxxxxxxxxx#video=copy#audio=copy#audio=opus
  garten_2_ext:
  - ffmpeg:http://192.168.10.62/flv?port=1935&app=bcs&stream=channel0_ext.bcs&user=admin&password=xxxxxxxxxx
  garten_ext:
  - ffmpeg:http://192.168.10.60/flv?port=1935&app=bcs&stream=channel0_ext.bcs&user=admin&password=xxxxxxxxxx
  haustuer:
  - ffmpeg:http://192.168.10.61/flv?port=1935&app=bcs&stream=channel0_main.bcs&user=admin&password=xxxxxxxxxx#video=copy#audio=copy#audio=opus
  haustuer_ext:
  - ffmpeg:http://192.168.10.61/flv?port=1935&app=bcs&stream=channel0_ext.bcs&user=admin&password=xxxxxxxxxx
webrtc:
  candidates:
  - stun:8555

here is a stream info:

{
    "producers": [
        {
            "type": "RTSP passive producer",
            "url": "rtsp://127.0.0.1:8554/7c12d87969e864972ca3b4d52c38000e",
            "remote_addr": "127.0.0.1:56742",
            "user_agent": "ffmpeg/go2rtc",
            "sdp": "v=0\r\no=- 0 0 IN IP4 127.0.0.1\r\ns=No Name\r\nc=IN IP4 127.0.0.1\r\nt=0 0\r\na=tool:libavformat LIBAVFORMAT_VERSION\r\nm=video 0 RTP/AVP 96\r\na=rtpmap:96 H264/90000\r\na=fmtp:96 packetization-mode=1; sprop-parameter-sets=Z2QAM6wVFKAoAPGQ,aO48sA==; profile-level-id=640033\r\na=control:streamid=0\r\nm=audio 0 RTP/AVP 97\r\na=rtpmap:97 MPEG4-GENERIC/16000/1\r\na=fmtp:97 profile-level-id=1;mode=AAC-hbr;sizelength=13;indexlength=3;indexdeltalength=3; config=1408\r\na=control:streamid=1\r\nm=audio 0 RTP/AVP 98\r\nb=AS:64\r\na=rtpmap:98 opus/48000/2\r\na=control:streamid=2\r\n",
            "medias": [
                "video, recvonly, H.264 High 5.1",
                "audio, recvonly, MPEG4-GENERIC/16000",
                "audio, recvonly, OPUS/48000/2"
            ],
            "receivers": [
                "96 H264, bytes=336374274, senders=1",
                "97 MPEG4-GENERIC/16000, bytes=5157210, senders=1",
                "98 OPUS/48000/2, bytes=6259067, senders=0"
            ],
            "recv": 351085783
        }
    ],
    "consumers": [
        {
            "type": "RTSP passive consumer",
            "url": "rtsp://127.0.0.1:8554/haustuer?video=copy&audio=aac",
            "remote_addr": "127.0.0.1:56712",
            "user_agent": "FFmpeg Frigate/0.13.2-6476f8a",
            "sdp": "v=0\r\no=- 1 1 IN IP4 0.0.0.0\r\ns=go2rtc/1.8.4\r\nc=IN IP4 0.0.0.0\r\nt=0 0\r\nm=video 0 RTP/AVP 96\r\na=rtpmap:96 H264/90000\r\na=fmtp:96 packetization-mode=1; sprop-parameter-sets=Z2QAM6wVFKAoAPGQ,aO48sA==; profile-level-id=640033\r\na=control:trackID=0\r\nm=audio 0 RTP/AVP 97\r\na=rtpmap:97 MPEG4-GENERIC/16000\r\na=fmtp:97 profile-level-id=1;mode=AAC-hbr;sizelength=13;indexlength=3;indexdeltalength=3; config=1408\r\na=control:trackID=1\r\n",
            "medias": [
                "video, sendonly, ANY",
                "audio, sendonly, MPEG4-GENERIC"
            ],
            "senders": [
                "96 H264, bytes=336374274, receivers=1",
                "97 MPEG4-GENERIC/16000, bytes=5157210, receivers=1"
            ],
            "send": 345398076
        }
    ]
}

I tried several browsers. This problem is since i switched my network from avm fritzbox to unifi. But i have now idea why i cannot get a webrtc stream.

AlexxIT commented 1 month ago

So before switching network all works fine? "H.264" should be supported by WebRTC. But "High 5.1" can have problems on some low end mobile devices.

cryd-s commented 1 month ago

But the streams do not work on every device. I only get a loading circle.

Where can i change the "High 5.1" and which setting is recommended?

cryd-s commented 1 month ago

Nobody who can help ? :(

dagleaves commented 2 days ago

Try using HTTP FLV as its own stream and have audio separate. It's possible your ffmpeg is weird with FLV or the #video=copy is messing up the encoding

einfahrt:
  - http://192.168.10.63/flv?port=1935&app=bcs&stream=channel0_main.bcs&user=admin&password=xxxxxxxxxx
  - ffmpeg:einfahrt#audio=opus