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
4.25k stars 346 forks source link

Home Assistant Reolink stream lost audio after update from 1.6.0 -> 1.6.1 & 1.6.2 #540

Open porly1985 opened 1 year ago

porly1985 commented 1 year ago

my reolink outdoor e1 camera lost the audio stream while updating to 1.6.1 or 1.6.2. Restoring backup to 1.6.0 all works fine. When I save&restart the recent config (without changing anything) it works for a while. Then after a while or after Home Assistant restart its lost again.

I also installed new Reolink firmware today, but it didnt help.

Stream Info Version 1.6.0

{
  "producers": [
    {
      "type": "RTSP active producer",
      "url": "rtsp://192.168.178.66//",
      "remote_addr": "192.168.178.66:554",
      "user_agent": "go2rtc/1.6.0",
      "medias": [
        "video, recvonly, H.264 High 5.1",
        "audio, recvonly, MPEG4-GENERIC/16000"
      ],
      "receivers": [
        "96 H264, bytes=99481173, senders=1",
        "97 MPEG4-GENERIC/16000, bytes=4159942, senders=1"
      ],
      "recv": 104629639
    },
    {
      "type": "RTSP passive producer",
      "url": "rtsp://127.0.0.1:8554/e48651667ee85e36d6fc6e297a6a98d4",
      "remote_addr": "127.0.0.1:37498",
      "user_agent": "ffmpeg/go2rtc",
      "medias": [
        "audio, recvonly, OPUS/48000/2"
      ],
      "receivers": [
        "96 OPUS/48000/2, bytes=5397800, senders=1"
      ],
      "recv": 5706044
    }
  ],

Stream Info Version 1.6.2

{
  "producers": [
    {
      "type": "RTSP active producer",
      "url": "rtsp://192.168.178.66/h264Preview_01_main/",
      "remote_addr": "192.168.178.66:554",
      "user_agent": "go2rtc/1.6.2",
      "medias": [
        "video, recvonly, H.264 High 5.1",
        "audio, recvonly, MPEG4-GENERIC/16000"
      ],
      "receivers": [
        "96 H264, bytes=8550054, senders=2"
      ],
      "recv": 8628894
    },
    {
      "url": "rtsp://admin:password@192.168.178.66:554/h264Preview_01_main"
    }
  ],

my config:

streams:
  camera.garage_main:
    - rtsp://admin:password@192.168.178.66
    - ffmpeg:camera.garage_main#audio=opus

It seems like its skipping the ffmpeg encoding for some reason.

Logs:

16:52:16.777 INF go2rtc version 1.6.2 linux/amd64
16:52:16.777 INF [api] listen addr=0.0.0.0:1984
16:52:16.777 INF [rtsp] listen addr=0.0.0.0:8554
16:52:16.779 INF [webrtc] listen addr=:8555
16:52:16.780 INF [srtp] listen addr=0.0.0.0:8443
16:53:16.085 DBG [streams] stop producer url=rtsp://admin:password@192.168.178.66:554/h264Preview_01_main
16:53:16.085 DBG [streams] start producer url=rtsp://admin:password@192.168.178.66:554/h264Preview_01_main
16:53:16.429 DBG [streams] start producer url=rtsp://user:password@192.168.178.62:554/stream1
16:53:16.898 DBG [streams] stop producer url=rtsp://admin:password@192.168.178.66:554/h264Preview_01_main
16:53:21.162 DBG [streams] stop producer url=rtsp://admin:password@192.168.178.66:554/h264Preview_01_main
16:53:31.406 DBG [streams] can't stop none producer
16:53:33.150 DBG [streams] can't stop none producer
16:53:52.345 DBG [streams] stop producer url=rtsp://admin:password@192.168.178.66:554/h264Preview_01_main
16:53:52.345 DBG [streams] can't stop none producer
16:53:52.686 DBG [streams] stop producer url=rtsp://user:password@192.168.178.62:554/stream1
16:54:37.028 DBG [webrtc] new consumer src=camera.garage_main
16:54:37.236 DBG [streams] stop producer url=rtsp://admin:password@192.168.178.66:554/h264Preview_01_main
16:54:37.237 DBG [streams] start producer url=rtsp://admin:password@192.168.178.66:554/h264Preview_01_main
16:54:47.281 DBG [streams] stop producer url=rtsp://admin:password@192.168.178.66:554/h264Preview_01_main
16:54:47.281 DBG [streams] can't stop none producer
16:55:18.894 DBG [streams] stop producer url=rtsp://admin:password@192.168.178.66:554/h264Preview_01_main
16:55:18.895 DBG [streams] start producer url=rtsp://admin:password@192.168.178.66:554/h264Preview_01_main
16:55:20.241 DBG [streams] can't stop none producer
16:55:20.242 WRN github.com/AlexxIT/go2rtc/internal/webrtc/webrtc.go:237 > error="wrong response on DESCRIBE"
16:55:20.242 DBG [streams] can't stop none producer
16:55:22.816 DBG [streams] stop producer url=rtsp://admin:password@192.168.178.66:554/h264Preview_01_main
16:55:24.271 DBG [streams] can't stop none producer
16:55:24.271 WRN github.com/AlexxIT/go2rtc/internal/webrtc/webrtc.go:237 > error="wrong response on DESCRIBE"
16:55:24.271 DBG [streams] can't stop none producer
16:55:27.138 DBG [streams] can't stop none producer
16:55:39.141 DBG [streams] stop producer url=rtsp://admin:password@192.168.178.66:554/h264Preview_01_main
16:55:39.636 DBG [streams] start producer url=rtsp://user:password@192.168.178.62:554/stream1
16:55:43.210 DBG [streams] stop producer url=rtsp://admin:password@192.168.178.66:554/h264Preview_01_main
16:55:45.055 DBG [streams] can't stop none producer

The error="wrong response on DESCRIBE" occures with another camera. I guess its another topic since I had it before as well.

alexreddy78 commented 1 year ago

Have 2 Reolinks RLC-510WA, working perfect with same set up. Try - ffmpeg:camera.garage_main#audio=pcma/16000

porly1985 commented 1 year ago

Hi alexreddy78, thank you for your suggestion. I tried it with the pcma/16000 audio codec but unfortunately its still not working...

porly1985 commented 1 year ago

Just tested different codecs. Same behaviour. On 1.6.2/1.6.1 its working for a while, after some time or HA restart the ffmpeg encoding part is skipped/ignored and the audio is gone. Have to stay on 1.6.0 and hope for a fix

porly1985 commented 1 year ago

I just switched from Wifi to LAN for my reolink cameras to improve connection stability. For now I have the following Cameras installed:

all cameras have the newest firmware and the same go2rtc configuration:

streams:
  camera.cameraname_main:
    - rtsp://admin:password@192.168.178.XX
    - ffmpeg:camera.cameraname_main#audio=opus

Switching from go2rtc 1.6.0 to 1.6.1/1.6.2 the behaviour of all cameras with the loss of audio is the same. There is also a latency issue in the new version, while the streams are all perfectly synchronized with almost zero latency delay on 1.6.0, in the 1.6.2 version I have delays up to 10 seconds.

For me go2rtc works amazing on the version 1.6.0 but of course I would be very happy to use future benefits and improvements of this addon.

AlexxIT commented 1 year ago

It was fix for OPUS in the v1.6.1. Maybe it related to issue https://github.com/AlexxIT/go2rtc/issues/522

porly1985 commented 1 year ago

Hi Alex, just updated to the new release 1.7.0. Still without audio or are there new config options? I also noticed stream delays about 2 seconds with the new version. I went back to 1.6.0. again.

RobinBeismann commented 11 months ago

Hi Alex, just updated to the new release 1.7.0. Still without audio or are there new config options? I also noticed stream delays about 2 seconds with the new version. I went back to 1.6.0. again.

Hi @porly1985,

answering you here instead of #699 to not mix the topics. I still have audio on both of my (working) reolink cams on go2rtc version 1.8.1 in Frigate (running as container with embedded go2rtc, but replaced by 1.8.1).