WebRTC integration with camera RTSP stream sources #658
-
Goal: Offer users the ability to use WebRTC with existing RTSP cameras to lower latency (near realtime) Overview: Proposal:
This is effectively providing a core version of the custom_component https://github.com/AlexxIT/WebRTC -- I have a proof of concept fo the above proposal working with an older nest RTSP camera using Caveats & Future considerations:
This was sketched out with @hunterjm though correct me if I've missed any key points. |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 9 replies
-
I think you covered it pretty well. I did realize after the fact that a TURN server is basically a proxy for the RTP stream and so wouldn’t save any additional bandwidth. That is why Google provides a free STUN server, but not a free TURN server. I read somewhere on the interwebs that ~80% of negotiations can be resolved using just a STUN server to get the external IP, and WebRTC only uses TURN if it has to. I do not know how accurate that is. Either way, using the existing video component for the frontend, we can default to WebRTC which would always work on internal networks, and fall back to |
Beta Was this translation helpful? Give feedback.
-
@uvjustin curious if you have any input on this proposal for a separate WebRTC add-on based integration, and input into camera. |
Beta Was this translation helpful? Give feedback.
-
I think there are a few other considerations for webrtc besides adaptive bitrates: It's also using udp so it can drop packets w/o worrying about retry, and its usually in a push model w/o round trips for pull. That said, i haven't done lots of testing in poor network conditions, so i'm unsure. Perhaps it would be helpful to collect data, since I don't think we have it for any streams. (Given Streams are connected to a virtual camera entity, we don't exactly have device level diagnostics which is unfortunate. It could be interesting to create additional device level diagnostics for cameras.) Yes, I have this almost already implemented. I think the biggest takeaway is that this isn't a silver bullet, and we should be careful about how this is positioned. I'd like to think more about something like having cameras and streams be more declarative about supported codecs to get rid of this lowest common denominator worry we have with streams. |
Beta Was this translation helpful? Give feedback.
-
home-assistant/home-assistant.io#20306 is the initial integration, and wanted to share some quick thoughts so far. The original name was When thinking about how
The integration can register itself with |
Beta Was this translation helpful? Give feedback.
home-assistant/home-assistant.io#20306 is the initial integration, and wanted to share some quick thoughts so far.
The original name was
webrtc
but we decided thatrtsptowebrtc
is be more fitting given the specific service and specific nature of this integration. There may be other integrations like janus media service or camect or something that use webrtc in the future that would makewebrtc
be a confusing name. I tried to look at if there was commonality in how those could work, but it is not clear they would work the same because they have very thick javascript client libraries, and their own API endpoints like websocket endpoints built into the servers.When thinking about how
camera
…