tsightler / ring-mqtt

Ring devices to MQTT Bridge
MIT License
569 stars 103 forks source link

No Live stream possible #665

Closed alexreddy78 closed 1 year ago

alexreddy78 commented 1 year ago

Dear Tom,

Just few hours ago I noticed that my battery camera is not able to open live stream anymore. Have this errors in the logs

2023-07-06T19:27:45.291Z ring-rtsp [Front Door] State indicates live stream has gone inactive 2023-07-06T19:27:45.292Z ring-rtsp [go2rtc] DBG [exec] run url="exec:/app/ring-mqtt/scripts/start-stream.sh 343ea41f21d9 live ring/370f8c4e-27f3-47be-b553-ce69cc2b41ad/camera/343ea41f21d9 {output}" 2023-07-06T19:27:45.300Z ring-rtsp [Front Door] Sending command to activate live stream ON-DEMAND 2023-07-06T19:27:45.303Z ring-mqtt [Front Door] Received set live stream state ON-DEMAND rtsp://127.0.0.1:8554/8650acee7e8a5485377c781243364235 2023-07-06T19:27:45.303Z ring-mqtt [Front Door] ring/370f8c4e-27f3-47be-b553-ce69cc2b41ad/camera/343ea41f21d9/stream/state ON 2023-07-06T19:27:45.303Z ring-attr [Front Door] ring/370f8c4e-27f3-47be-b553-ce69cc2b41ad/camera/343ea41f21d9/stream/attributes {"status":"activating"} 2023-07-06T19:27:45.303Z ring-mqtt [Front Door] Initializing a live stream session for Ring cloud 2023-07-06T19:27:45.390Z ring-rtsp [Front Door] State indicates live stream is activating 2023-07-06T19:27:45.755Z ring-mqtt [Front Door] New Motion 1 event detected, updating the recording URL 2023-07-06T19:27:45.756Z ring-mqtt [Front Door] TypeError: Cannot read properties of undefined (reading 'url') 2023-07-06T19:27:45.756Z ring-mqtt [Front Door] Failed to retrieve recording URL for Motion 1 event 2023-07-06T19:27:45.894Z ring-mqtt [Front Door] Live stream session successfully initialized, starting worker 2023-07-06T19:27:45.895Z ring-wrtc [Front Door] Live stream WebRTC worker received start command 2023-07-06T19:27:45.900Z ring-wrtc [Front Door] Live stream transcoding process is starting 2023-07-06T19:27:46.303Z ring-wrtc [Front Door] Websocket signaling for Ring cloud connected successfully 2023-07-06T19:27:46.311Z ring-wrtc [Front Door] ERROR - Unable to negotiate H.264 codec, verify this camera has Legacy Video Mode enabled 2023-07-06T19:27:46.313Z ring-wrtc [Front Door] Live stream transcoding process has started 2023-07-06T19:27:46.313Z ring-wrtc [Front Door] Live stream WebRTC session has disconnected 2023-07-06T19:27:46.313Z ring-mqtt [Front Door] ring/370f8c4e-27f3-47be-b553-ce69cc2b41ad/camera/343ea41f21d9/stream/state OFF 2023-07-06T19:27:46.314Z ring-attr [Front Door] ring/370f8c4e-27f3-47be-b553-ce69cc2b41ad/camera/343ea41f21d9/stream/attributes {"status":"inactive"} 2023-07-06T19:27:46.364Z ring-rtsp [Front Door] State indicates live stream has gone inactive 2023-07-06T19:27:46.365Z ring-rtsp [go2rtc] DBG [streams] can't stop none producer 2023-07-06T19:27:46.365Z ring-rtsp [go2rtc] WRN [rtsp] error="exec: %!s()" stream=343ea41f21d9_live 2023-07-06T19:43:09.201Z ring-mqtt WARNING - Unhandled Promise Rejection 2023-07-06T19:43:09.201Z ring-mqtt this.data.stream.keepalive.session.kill is not a function 2023-07-06T19:43:09.202Z ring-mqtt TypeError: this.data.stream.keepalive.session.kill is not a function at Camera.startKeepaliveStream (file:///app/ring-mqtt-dev/devices/camera.js:891:44)

This mesage ERROR - Unable to negotiate H.264 codec, verify this camera has Legacy Video Mode enabled is very starnge and bew in the logs....

As well I didnt see anymore the rtsp link in the logs...

BRGDS Alex

tsightler commented 1 year ago

As you note, it's mentioned right there in the log:

2023-07-06T19:27:46.311Z ring-wrtc [Front Door] ERROR - Unable to negotiate H.264 codec, verify this camera has Legacy Video Mode enabled

And this is already covered in the FAQ.

Some people seem to not even have the option for enabling Legacy Video support, even though I don't know why. Ring has been slow rolling HEVC for a while, and it has screwed up a lot of stuff (Ring forums have had several threads and many users believe Ring is moderating even more).

I don't really know what to do about this, passing through H.265 is the obvious option but so many frontend clients still don't support it or support it in very limited ways. I know it mostly works with Safari and Edge, but Chrome support seems to be very limited (there are flags that claim to make it work, but so far, not much success for me).

Unfortunately, if you don't have an option to enable legacy mode, then, for now, ring-mqtt will not work. If Ring ever gets around to enabling HEVC on any of my cameras I'll try to research a fix, but I'm not sure if any of my cameras even support it since they are all pretty old. It seems like it is currently only supported on a small number of devices.

tsightler commented 1 year ago

Hi @alexreddy78, coming back to this, do you think this is something you would be willing to help with development? There are several ways you could potentially help, sharing access to the camera is one option, but if you are uncomfortable with that, even just some specific testing options would be helpful. Let me know if you are open to that and we could re-open this issue to investigate or just work directly.

alexreddy78 commented 1 year ago

Hi @alexreddy78, coming back to this, do you think this is something you would be willing to help with development? There are several ways you could potentially help, sharing access to the camera is one option, but if you are uncomfortable with that, even just some specific testing options would be helpful. Let me know if you are open to that and we could re-open this issue to investigate or just work directly.

Dear Tom, thanks for approaching! I will tell nice story: I call to ring support directly, because my doorbell camera is Gen2 and supposed to have an option to switch to legacy mode as per FAQ on their site…but actually NOT. So they opened the ticket and bla bla bla bla conversation leads to telling me that actually it’s not possible to switch back if you don’t have an option in RING APP. I was so in a bad mood, because of this and tried to reset to factory default of the camera. And…it’s kind of magic happened! I don’t actually understand this. After reset, camera take an update for a 15 minutes and function of RING MQTT back! So for the moment it’s working well on dev branch of your fantastic addon! What do you think, what was it???? If this will repeat after some time (hope NOT :)) ), I will agree to do a test with doorbell for you, but pls without sharing camera.

Regards!!!

tsightler commented 1 year ago

Thanks @alexreddy78 for the info. I'm aware from other reports that doing a factory reset of the camera will revert to legacy video mode for at least some period of time, but I'm relatively confident it just buys some time. Based on what I can tell Ring is slowly rolling the feature to all devices that support it. Resetting and re-registering the camera creates a new doorbot ID, so it kind of moves that device to the end of the line, but it will still come back eventually. I'm not sure how long though, the rollout appears to be happening very, very slowly, likely because they are having lots of issues since there are still so many issues with H.265/HEVC support in browsers and other devices. The Ring community forums were full of complaints back at the start of the year, but those seem to have trailed off now.

If the problem comes back, please reach out if the issue hasn't been resolved by then. I don't believe it would be very difficult to support HEVC in ring-mqtt itself, just need some way to detect when a camera requires this codec. However, I'm very unclear how well it will work with downstream consumers. I know Home Assistant has some basic support for HEVC in their stream protocol, and browsers like Safari and Edge have decent HEVC support, but Chrome has very limited support and Firefox has basically none so it may mean a loss of compatibility.

alexreddy78 commented 1 year ago

Thanks @alexreddy78 for the info. I'm aware from other reports that doing a factory reset of the camera will revert to legacy video mode for at least some period of time, but I'm relatively confident it just buys some time. Based on what I can tell Ring is slowly rolling the feature to all devices that support it. Resetting and re-registering the camera creates a new doorbot ID, so it kind of moves that device to the end of the line, but it will still come back eventually. I'm not sure how long though, the rollout appears to be happening very, very slowly, likely because they are having lots of issues since there are still so many issues with H.265/HEVC support in browsers and other devices. The Ring community forums were full of complaints back at the start of the year, but those seem to have trailed off now.

If the problem comes back, please reach out if the issue hasn't been resolved by then. I don't believe it would be very difficult to support HEVC in ring-mqtt itself, just need some way to detect when a camera requires this codec. However, I'm very unclear how well it will work with downstream consumers. I know Home Assistant has some basic support for HEVC in their stream protocol, and browsers like Safari and Edge have decent HEVC support, but Chrome has very limited support and Firefox has basically none so it may mean a loss of compatibility.

Thanks @alexreddy78 for the info. I'm aware from other reports that doing a factory reset of the camera will revert to legacy video mode for at least some period of time, but I'm relatively confident it just buys some time. Based on what I can tell Ring is slowly rolling the feature to all devices that support it. Resetting and re-registering the camera creates a new doorbot ID, so it kind of moves that device to the end of the line, but it will still come back eventually. I'm not sure how long though, the rollout appears to be happening very, very slowly, likely because they are having lots of issues since there are still so many issues with H.265/HEVC support in browsers and other devices. The Ring community forums were full of complaints back at the start of the year, but those seem to have trailed off now.

If the problem comes back, please reach out if the issue hasn't been resolved by then. I don't believe it would be very difficult to support HEVC in ring-mqtt itself, just need some way to detect when a camera requires this codec. However, I'm very unclear how well it will work with downstream consumers. I know Home Assistant has some basic support for HEVC in their stream protocol, and browsers like Safari and Edge have decent HEVC support, but Chrome has very limited support and Firefox has basically none so it may mean a loss of compatibility.

Dear Tom,

Really appreciate. I will keep an eye, and keep in touch.

Regards