gozoinks / homebridge-camera-ffmpeg-ufv

UniFi Video plugin for Homebridge
https://www.npmjs.com/package/homebridge-camera-ffmpeg-ufv
Other
76 stars 20 forks source link

API Key #29

Closed brianerdelyi closed 5 years ago

brianerdelyi commented 5 years ago

Good day.

Can you please explain why/how the NVR API is required? Would it not be possible to connect using just the RTSP URL?

B

jmbwell commented 5 years ago

Take a look at the code and find all the ways we use information provided only by the API, and you’ll have your answer.

brianerdelyi commented 5 years ago

I really appreciate the quick response, but still not sure where in the code the NVR API is called. I'm trying to understand what the benefit of using this plugin is vs a generic camera-ffmpeg plugin where I specify the RTSP url. I assume this plugin uses the NVR API to get a list of camera URLs?

adrum commented 5 years ago

This plugin automatically sets up all the cameras for you known by the NVR. It also will setup a motion sensor if you have motion recording enabled for the camera.

If you have a small system, you could probably get away with setting them up by hand using just the RTSP stream url and homebridge-camera-ffmpeg. I'm not sure if the RTSP stream url requires authentication or not. For larger installs, this plugin certainly helps speed up the process of setting up all the cameras.

adrum commented 5 years ago

This is where the integration with the NVR API is used, should you want to see specifically how it connects to it: https://github.com/gozoinks/homebridge-camera-ffmpeg-ufv/blob/41f6aa17c08c340f758290ebf2d677ba0f18b2b2/index.js#L76

brianerdelyi commented 5 years ago

Thanks for clarification. Yes, I agree querying the NVR for available cameras is a nice touch rather than manually configuring each URL. My CK2+ arrives next week and I was going to test with that, however, I expect I will have to use the generic plugin. Really appreciate the link to the file as well :)

adrum commented 5 years ago

Yeah I would have to guess this plugin is not compatible with Unifi Protect, since it and Unifi Video have two completely different codebases. I've been following along and waiting for them to release a self hosted version of the software so I could either adapt this plugin to work with both, or write a completely separate plugin altogether.

You're probably going to have to use the homebridge-camera-ffmpeg plugin if you're looking to integrate with CK2+.

brianerdelyi commented 5 years ago

Agreed. Working with the generic plugin now. I'm getting snapshots but no live streams. Unsure why at the moment.