hjdhjd / homebridge-unifi-protect

:video_camera: Complete HomeKit integration for all UniFi Protect device types with full support for most features including HomeKit Secure Video, and more. https://homebridge.io
Other
1.43k stars 88 forks source link

HOOBS-specific: Unable to Stream #85

Closed danTHAman152000 closed 3 years ago

danTHAman152000 commented 3 years ago

Describe The Problem:

I open Home app and I see screenshots updating like normally (every 10 seconds, or so) for my cameras, but when I click to stream a feed, after about 10 seconds I get "No Response, This Camera is not responding." in the camera stream.

Prior to v3.6.0 I didn't have any problems. I had great luck before when updating and didn't see the possible "breaking change" with 3.6.0 until after I updated. I saw that with the 3.6.0 that HomeBridge required specific versions (or latest update), but I am using HOOBS and I am not too sure how they update together. I assume this is what caused my problems.

I use Home Assistant too, and the cameras do work in there, and I can use HA's integration to get the camera feeds to Home app, but this was not nearly as good as your version (prior to 3.6.0 for me).

Thank you so much for your help, I am hoping this is a weird HOOBs thing and will get ironed out soon. Hopefully I didn't leave any important details, please let me know if I did. Thanks!

To Reproduce:

See above.

Logs:

9/16/2020, 5:28:46 AM at RTPStreamManagement.generateSetupEndpointResponse (/usr/local/lib/node_modules/@hoobs/hoobs/node_modules/hap-nodejs/dist/lib/camera/RTPStreamManagement.js:688:98)
9/16/2020, 5:28:46 AM at /usr/local/lib/node_modules/@hoobs/hoobs/node_modules/hap-nodejs/dist/lib/camera/RTPStreamManagement.js:657:27
9/16/2020, 5:28:46 AM at /usr/local/lib/node_modules/@hoobs/hoobs/node_modules/hap-nodejs/dist/lib/util/once.js:16:25
9/16/2020, 5:28:46 AM at ProtectStreamingDelegate.prepareStream (/home/hoobs/.hoobs/node_modules/homebridge-unifi-protect/dist/protect-stream.js:143:9)
9/16/2020, 5:28:46 AM at processTicksAndRejections (internal/process/task_queues.js:94:5)
9/16/2020, 5:28:46 AM (node:1502) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 3)
9/16/2020, 5:28:57 AM [UniFi Protect] CloudKey+ [UCK-G2-PLUS] Front Porch Camera [UVC G3 Dome]: Stopped video streaming session.

Homebridge Configuration:

{
            "platform": "UniFi Protect",
            "plugin_map": {
                "plugin_name": "homebridge-unifi-protect"
            },
            "controllers": [
                {
                    "address": "X.X.X.X",
                    "username": "XXX",
                    "password": "XXX"
                }
            ],
            "options": [
                "Enable.StreamOnly.Low"
            ]
        }

Screenshots:

Environment:

hjdhjd commented 3 years ago

Hi there. You’ve got three choices:

  1. Stay on the most current version of homebridge-unifi-protect and live with not being able to stream for the time being. All other functionality works fine - your only limitation is not being able to stream.
  2. Revert to a version before 3.6.0 and get streaming working. There are a few new features since then (and more to come!), but you’re still in good shape if you do.
  3. Install Homebridge. It’s pretty easy and straightforward to do and the community is great about providing installation-related support.

The problem is HOOBS-specific. There were important changes in Homebridge specific to camera-related plugins starting in Homebridge 1.1.3. These changes were related to significantly improving the way network interfaces and addresses are detected when streaming requests begin.

HOOBS is based on Homebridge, but isn’t Homebridge. Most of the time that’s okay because their codebase is based on Homebridge and the Homebridge API tends to be quite stable. However - there have been some significant changes in Homebridge in the past few weeks - all good ones ultimately - and the HOOBS team have not incorporated those changes into their codebase yet. I know the HOOBS team is aware of this and is working on an update that they’ll publish in the upcoming days / weeks. I’m not familiar with their timeline beyond that.

This change was important for this plugin, and candidly, I could’ve chosen to maintain backward compatibility but I have chosen not to because I think these changes are ultimately better for the majority of users, and the sooner everyone (Homebridge and HOOBS) incorporates these updates the better for everyone.

TL;DR: HOOBS is great. Homebridge is great. If you’re a HOOBS user and want to live on the latest / greatest right now, your three choices are at the top of this note. 😄

danTHAman152000 commented 3 years ago

Thank you so much for your prompt reply. It really means a lot. Thank you for all that you do.

I first discovered HA, then HB, then HOOBS. I had issues with streaming in HB (ffmpeg, but it’s been about a year I’ve had HOOBS running so it’s maybe different). I am very appreciative of your explanation because I see HOOBS is where it gets weird.

I would love to have the version prior to 3.6.0 in HOOBS currently. In fact, I was a little arrogant and updated without checking just because I have been so happy with the performance of your plugin prior to that update. I am not sure how to revert to a previous version.

I am content even now knowing that it’s a HOOBS thing and not an error on my part. I hope to either revert to the previous version, or if too complicated then I am content with waiting a bit or even reaching out and try HB again.

Thanks again for your help!

On Sep 16, 2020, at 6:00 AM, hjdhjd notifications@github.com wrote:

Hi there. You’ve got three choices:

Stay on the most current version of homebridge-unifi-protect and live with not being able to stream for the time being. All other functionality works fine - your only limitation is not being able to stream. Revert to a version before 3.6.0 and get streaming working. There are a few new features since then (and more to come!), but you’re still in good shape if you do. Install Homebridge. It’s pretty easy and straightforward to do and the community is great about providing installation-related support. The problem is HOOBS-specific. There were important changes in Homebridge specific to camera-related plugins starting in Homebridge 1.1.3. These changes were related to significantly improving the way network interfaces and addresses are detected when streaming requests begin.

HOOBS is based on Homebridge, but isn’t Homebridge. Most of the time that’s okay because their codebase is based on Homebridge and the Homebridge API tends to be quite stable. However - there have been some significant changes in Homebridge in the past few weeks - all good ones ultimately - and the HOOBS team have not incorporated those changes into their codebase yet. I know the HOOBS team is aware of this and is working on an update that they’ll publish in the upcoming days / weeks. I’m not familiar with their timeline beyond that.

This change was important for this plugin, and candidly, I could’ve chosen to maintain backward compatibility but I have chosen not to because I think these changes are ultimately better for the majority of users, and the sooner everyone (Homebridge and HOOBS) incorporates these updates the better for everyone.

TL;DR: HOOBS is great. Homebridge is great. If you’re a HOOBS user and want to live on the latest / greatest right now, your three choices are at the top of this note. 😄

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/hjdhjd/homebridge-unifi-protect/issues/85#issuecomment-693388208, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJUMFXWAHCBTOKUQBKDX6BDSGCZFJANCNFSM4ROYU2IA.

hjdhjd commented 3 years ago

Thanks for the compliments, much appreciated, You can show your support by starring the repository in the top-right of the Github page.

I try to make this plugin as robust as possible and really am not a fan of breaking changes...but sometimes they’re needed I’m afraid.

If you want to be on the latest / greatest with this plugin, HB is where the focus is, and there’s a lot of active development happening right now. I don’t anticipate more breaking changes, but one never knows...with iOS 14 et al coming out, I’d expect more updates in the coming weeks.

I don’t know how to do it within HOOBS, but from a command line perspective it’s straightforward:

npm -g uninstall homebridge-unifi-protect
npm -g —unsafe-perm install homebridge-unifi-protect@version

where version is whatever version you want to install.

As to FFmpeg...things have gotten quite a bit better in that department in Homebridge since the Homebridge team created an FFmpeg package that camera plugins can use to make things easier on common platforms. You can see the list of platforms that are supported out of the box on the ffmpeg-for-homebridge page. To be clear - you don’t need to install this plugin. My plugin, and many of the other plugins that stream video, automatically use it when it’s on a platform that can benefit from it.

If you’re running on macOS, Windows, RPi, you should be covered.

github-actions[bot] commented 1 year ago

This issue is locked to prevent necroposting on closed issues. Please create a new issue for related support requests, bug reports, or feature suggestions.