-
-
Notifications
You must be signed in to change notification settings - Fork 225
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Secure Video #1200
Secure Video #1200
Conversation
Fantastic. I'm happy to finish this up after the prerequisites are in place. Thanks so much for your efforts so far. I'll try to find time to really review this code this weekend, then I'll probably pull it into a branch here. |
@Sunoo any potential beta release date to test HKSV on your Camera plugin? |
@Stetocasa It should be shortly after HAP-NodeJS and Homebridge merge in support. |
Thanks @Sunoo do you know which issue follow on GitHub to know on time for the merge release ? |
@Stetocasa This PR depends on homebridge/HAP-NodeJS#904 and homebridge/homebridge#2973 |
Actually there is a third, optional PR directly against the HAP-NodeJS fork from koush to add doorbell support |
@california444 Ah, wasn’t aware of that one, thanks for pointing that out. If that doesn’t make it in the next Homebridge release for whatever reason, I’d probably merge support for motion to this plugin, then add doorbell later whenever that gets pulled in. |
@california444 I'm getting the same errors locally when |
@bdruth The issue is almost certainly just that it’s depending on versions of HAP-NodeJS and Homebridge that haven’t been published anywhere yet. |
Hmm, ok ... I'm trying to use |
Also, quick-followup, when I look closer at the errors, they seem odd for just being issues around not seeing the right dependent code, e.g.:
|
I haven’t had a chance to really dive into the PR yet, so I can’t speak to the code quality. (Real life has been pretty hectic.) I agree that error does seem potentially like an issue in the code though, not dependencies. |
@california444 I tried building this against your PR branch to koush's HAP-NodeJS fork, but even then, I'm still getting a bunch of errors. TypeScript: not.a.fan. Gah. As near as I can tell, your code's all valid, it's just that TypeScript hates it. |
@bdruth in tsconfig.json try setting strict to false. I remember I changed something to make progress faster ;-) maybe I did not turn it back before committing… |
Hehe, that'll do it. |
I usually have my TypeScript environment configured to be pretty paranoid, it helps catch issues that could bite you down the line. Sounds like I’ve got some cleanup to do to make this code play nice with that. :P |
Some clean up must be done for sure… |
I appreciate the effort you put toward this, and am happy to take it the last but once the remaining blocks are in place. |
I'm so close to having this compiling, to where I'm in a position to be able to contribute, but for some reason I'm still getting this:
And this does seem to be a typing issue, but I don't understand why. I've pulled the branch with the doorbellService changes at this point, so it should be seeing that :/ |
Nvm - I think I got it. I just needed to |
@california444 I may be misunderstanding the |
If prebuffer is enabled the camera video is streamed all the time in order to fill the prebuffer so that we have the last 4 seconds of an motion/doorbell event in the buffer. Please correct me if I’m wrong, but I guess for each open camera stream in HOME the plug-in starts a new ffmpeg process in the current implementation. |
Yeah, I realized as I was thinking about it that at the very least, we need another ffmpeg process to create the SRTP output to the mac/iOS device that's requesting the stream. Would be interesting if we could divert (via My ultimate goal is to minimize the time between tapping on a camera feed in Home and having the live stream start. My Eufy cam (HKSV native) is pretty quick on that front. |
Hey @california444 I used your HSV implementation for my https://github.com/SeydX/homebridge-camera-ui/tree/hsv HSV works ok so far with no errors, only FFmpeg doesn't always cooperate well. When I manually trigger a movement, sometimes the following error message comes up: Due to the error, the recording is not saved with HSV (missing in the timeline) but the recording exists (because it is also passed to the user interface and processed). Have you had this error message? Also, I think the prebuffering is awesome, thanks for that. A small note: If the connection to the camera is interrupted and re-established, it would be great if the prebuffering is restarted or? |
@seydx good to hear it is working in general. I did not experience this problem. When does this error occur. Right at the beginning of the stream? Maybe the debug logs provide more information? |
I have not been able to debug it any further. Error occurs only at the end when recording is finished |
@seydx did you change the prebuffer length? There is a 30s timeout in one of the servers. If the prebuffer +fragments exceed 30s that could maybe an issue… |
No, I had only played with the video duration, but the prebuffer length was always at 4000 |
I would like to test this to. What's the easiest way to get the code on my homebridge? |
@Sunoo There is a new HAP-NodeJS PR 920, which will hopefully bring HSV support soon. As far as I can see the API has changed compared to the initial PR 904, so that this PR here will no longer work and needs to be modified. |
@california444 Yea, I’ve already been looking into that new PR. Now that it seems support is actually coming, I’m happy to start working on this in earnest. Hopefully will put a bunch of work in today, but we’ll see how my day job goes. |
Hi, HAP-NodeJS PR 920 has been merged. That’s mean that we can now have HSV ? |
@adx74 My plan is to get at least initial support in place on my plugin this weekend. Homebridge will still need to also merge that PR before it is easily usable by everyone though. |
@Sunoo ofc, did you think HomeBridge gonna add this quickly ? |
I would expect it not to take too long, most of the changes were in HAP. |
With the changed API maybe more exports are now required in the homebridge PR. |
@california444 I’m definitely gonna take over this PR. I’ll try to take a look at the HB PR after my day job today, my recollection is that it was pretty slim though. |
"type": "boolean", | ||
"required": true, | ||
"default": false, | ||
"description": "Enables Homekit Secure Video and records video on motion and doorbell events. Requires a home hub and iCloud plan with at least 200GB of storage." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this comment still true? IMHO, Apple changed this. The 50GB plan also offers support for a Homekit Secure Video Camera. However, only one is supported.
See https://support.apple.com/en-us/HT201238
|
||
this.log.debug("Start recording...", this.cameraName); | ||
|
||
const session = await this.startFFMPegFragmetedMP4Session(this.videoProcessor, ffmpegInput, audioArgs, videoArgs); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo in startFFMPegFragmetedMP4Session
Presumably the team is already aware of this, if not it could be helpful: |
What happend with this PR. This feature doesn't exist in the hksv branch... even if it has been merged into it. |
WORK IN PROGRESS
This PR depends on the integration of:
Please understand this PR as a proof of concept or an initial version. I don't find enough time to make more progress , but I wanted to share the code as a lot of you have asked for it.
Big thanks to koush, I took over a lot of the "complex stuff" from his code base and tried to make it work with camera-ffmpeg and made more modifications and optimisations.
It is working more or less stable for me...
What is included:
-- recording: if enabled, the Secure Video Services are activated
-- prebuffer: if enabled the videostream from the camera gets continuously recorded and the prebuffer is filled
Open tasks: