REST API for Stream Sources #695
Replies: 3 comments 5 replies
-
Giving this discussion a poke for feedback. The above proposes a Rest API for pulling streams, though I'll use this as some time to consider other very different alternatives that do not require an architecture change:
With respect to security, I like the pull model since it uses Home Assistant authentication to access the streams. We'd also assume existing security controls for the stream are OK (e.g. credentials in the url, or expiring tokens) when handing over to the service, but if there are options for finer grained access controls this might be worth consideration here. (e.g. my prometheus service scraping entity state doesn't need access to camera streams) |
Beta Was this translation helpful? Give feedback.
-
Seconding this / bump. Use case: Installing the Nest integration provided me with a camera entity as 'camera.front_door' however this can't be used in Frigate for local NVR and object detection. |
Beta Was this translation helpful? Give feedback.
-
I just came to know this proposal now. In fact, I had even proposed and implemented the very same thing at home-assistant/core#81755, which got rejected. Then I created a custom integration for it: https://github.com/felipecrs/hass-expose-camera-stream-source And it has been helping several users since then. |
Beta Was this translation helpful? Give feedback.
-
Summary
Expose a REST API in Home Assistant to make it a provider of camera stream sources to the ecosystem
Motivation
Imagine a user journey like:
In practice what's are the practical considerations to stop that from happening? The main roadblock is I need to teach Frigate about my cameras first.
generic
). That's not so bad.Proposal
Expose a REST API in
camera
. An example GET request:/api/camera/stream_source/<entity_id>
With an example response:
Caveats & Alternatives
stream_options
used bygeneric
andonvif
. Generic is easy to configure directly in frigate. Onvif hasrtsp_transport
so if needed we could make this an explicit option to return. Generally, we would not want to return a generic dictionary of ffmpeg flagsexpires_at
option. I'd like to see if we can avoid this, and just ask for updated stream sources when a failure happens.We've had some initial discussions about this at various times over the past few months with @hunterjm @blakeblackshear @uvjustin but wanted to pull this into a real architecture discussion.
Beta Was this translation helpful? Give feedback.
All reactions