-
Notifications
You must be signed in to change notification settings - Fork 141
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
Support for two-way audio #134
Comments
Does your code also work with audio from the Raspberry Pi to HomeKit? |
I have not tried this use-case yet as I have Wantec Monolith C IP Video SIP doorbell. However, I am currently working on something completely new. This could be also interesting for you. My plan is to offer a solution which pulls the streaming and transcoding handling (FFMPEG) completely out of any Homekit software package. Concerning two-way audio support I plan to support RTSP backchannel for the speaker output. Gstreamer already offers this for the client and for the server. The gstreamer Python script (with REST API) will be an RTSP client with backchannel support that could connect to two-way capable video cameras. To also support my use-case with the SIP-camera, I plan to also have a small gstreamer Python script which basically is a RTSP server with backchannel support on one side and a SIP client on the other side. This way I could easily negotiate a two-way RTP session between the SIP-camera and this gstreamer script based on the INVITE SDP and response SDP. The good thing about using gstreamer for homekit streaming is that it supports so much more stuff related to the inital homekit requirements concerning RTP/RTCP and the SRTP/SAVPF profile. Ah and by the way: whilte taking a deep-dive into gstreamer internals and reading parts of the related RFC I was also able to get full OPUS audio codec support. For this I had to patch the gstreamer sources. The idea of the patch would also be working for the FFMPEG sources, I am pretty sure as I have studied related code in FFMPEG. So it would NOT be required anymore to use the AAC ELD codec from libfdk. |
Homekit also supports video doorbells with two-way-audio.
The "only" thing missing here is the return audio from Homekit to the Raspberry Pi.
For this the speaker service must be added to the camera services.
Then we could use another ffmpeg instance to decode the audio from Homekit to the ALSA speaker device.
I already did this here: https://github.com/nanosonde/homebridge-camera-ffmpeg/blob/sipdoorbell/src/streamingDelegate.ts#L516-L574
(The code above connects to a negotiated SIP RTP endpoint. This would not be required here as we could directly access the ALSA audio device.)
The text was updated successfully, but these errors were encountered: