A community member asked me if I can extend the Homekit binding to support doorbell cameras.
Such a device produces/consumes three media streams (producers for video and audio, and a consumer for audio talk-back).
I have written all the binding code to negotiate, establish, and decrypt/encrypt the three sessions between the binding and the remote device for these three streams. In short I have the media.
My question is: how to serve the media to the UI? Apparently the openhab-video-card can accept a webRtc URL. So my question is how to multiplex the three media streams into a webRtc session and how to serve it?
Looking at other bindings I can see the following:
- The Matter binding seems to do webRtc via JavaScript code
- The Dahua and Unifi bindings seems to do it via
go2rtc
As far as I can tell, both of these solutions have their disadvantages. The matter JavaScript is quite opaque and I would prefer a pure Java solution. And the ‘go2rtc’ requires a 3rd party executable binary to be installed. Also the command and control interfaces would not work if more than one binding (in fact more than one Thing handler) would try to access the same executable.
I think ideally it would be good to have a native Java solution that leverages the existing org.openhab.core.io.websocket server. In that case I would “only” need to write middle- ware to multiplex the three media streams into a webRtc wrapper. Claude estimates that it would require 2-3000 lines of new code to do that, so I am looking for an already existing Java library if possible.
Any suggestions?