hjdhjd / homebridge-doorbird

Homebridge plugin for Doorbird
Apache License 2.0
54 stars 14 forks source link

Speaker and microphone not working #40

Closed axelbrunger closed 4 years ago

axelbrunger commented 4 years ago

Speaker and microphone not working

axelbrunger commented 4 years ago

Dear developers:

I installed the latest versions of the doorbird and ffmpeg plugins and latest version of FFmpeg (with libfdk-acc enabled). Nearly everything is working well, except the speaker and audio are not working at all.

The 2019 DoorBird API implies that the RTSP and VIDEO requests are video only. The audio receive and transmit requests are separate commands (with audio-receive.cgi and audio-transmit.cgi). Any ideas how to incorporate these requests into the DoorBird home bridge plugin?

Any ideas and suggestions are welcome.

Best regards, Axel

brownad commented 4 years ago

Audio does not work at all unfortunately

Sent from my iPhone

On 28 Nov 2019, at 03:57, axelbrunger notifications@github.com wrote:

Dear developers:

I installed the latest versions of the doorbird and ffmpeg plugins and latest version of FFmpeg (with libfdk-acc enabled). Nearly everything is working well, except the speaker and audio are not working at all.

The 2019 DoorBird API implies that the RTSP and VIDEO requests are video only. The audio receive and transmit requests are separate commands (with audio-receive.cgi and audio-transmit.cgi). Any ideas how to incorporate these requests into the DoorBird home bridge plugin?

Any ideas and suggestions are welcome.

Best regards, Axel

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

axelbrunger commented 4 years ago

Thanks for replying. I still like the plugin since the video feed is so much faster on my iPhone compared to the DoorBird native App. Thanks for developing it.

Hopefully, there will be a solution for the audio in the future. Please keep us posted.

Or, DoorBird finally comes out with a HomeKit compatible device.

Best regards, Axel

brownad commented 4 years ago

More likely the latter.. it’s waiting on DoorBird however if they provide an audio feed that is supported then I’d definitely add it but it’s not supported at this point

Sent from my iPhone

On 28 Nov 2019, at 15:41, axelbrunger notifications@github.com wrote:

Thanks for replying. I still like the plugin since the video feed is so much faster on my iPhone compared to the DoorBird native App. Thanks for developing it.

Hopefully, there will be a solution for the audio in the future. Please keep us posted.

Or, DoorBird finally comes out with a HomeKit compatible device.

Best regards, Axel

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

brownad commented 4 years ago

https://www.doorbird.com/downloads/api_lan.pdf?rev=0.27 Time to look at using gstreamer with ffmpeg for audio, might be possible to do this now.

BillS11 commented 4 years ago

https://www.doorbird.com/downloads/api_lan.pdf?rev=0.27 Time to look at using gstreamer with ffmpeg for audio, might be possible to do this now.

I’ve just subscribed to this thread, fingers crossed! Would be a dream. This plugin has been rock solid

hjdhjd commented 4 years ago

Nudge on this one. @brownad - planning to tackle this one anytime soon? Seems like the last significant piece of functionality for this plugin that’s left to implement, no?

brownad commented 4 years ago

Audio stream doesn’t work tried many times

Sent from my iPhone

On 26 May 2020, at 06:51, hjdhjd notifications@github.com wrote:

Nudge on this one. @brownad - planning to tackle this one anytime soon? Seems like the last significant piece of functionality for this plugin that’s left to implement, no?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

hjdhjd commented 4 years ago

@brownad - Does the gstreamer example in the latest API doc not work? Curious. I haven't messed with it.

hjdhjd commented 4 years ago

I just did a quick test to see if the audio receive interface actually does anything, and it seems to:

curl -v http://doorbirduser:doorbirdpass@doorbirdip/bha-api/audio-receive.cgi

returns

* Server auth using Basic with user 'doorbirduser'
> GET /bha-api/audio-receive.cgi HTTP/1.1
> Host: doorbirdIP
> Authorization: Basic REDACTED
> User-Agent: curl/7.70.0
> Accept: */*
> 
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Content-Type: audio/basic
< Content-Length: 9999999
< Connection: Keep-Alive
< Cache-Control: no-cache
< 

followed by what I assume is audio binary data. It's tantalizing to say the least. I don't want to go down a path that's been trodden...can you share some insight @brownad into the issues you've run into in getting this going?

brownad commented 4 years ago

Haven’t been able to decode the stream correctly yes you are right the audio_receive will return the data but to use gsrreamer with ffmpeg as the docs showed wasn’t something I could get working. Might have looked at this incorrectly though. Help would be most welcome. I know the other committers to the repo would have found a way by now.

Sent from my iPhone

On 26 May 2020, at 16:32, hjdhjd notifications@github.com wrote:

I just did a quick test to see if the audio receive interface actually does anything, and it seems to:

curl -v http://doorbirduser:doorbirdpass@doorbirdip/bha-api/audio-receive.cgi

returns

  • Server auth using Basic with user 'doorbirduser'

    GET /bha-api/audio-receive.cgi HTTP/1.1 Host: doorbirdIP Authorization: Basic REDACTED User-Agent: curl/7.70.0 Accept: /

  • Mark bundle as not supporting multiuse < HTTP/1.1 200 OK < Content-Type: audio/basic < Content-Length: 9999999 < Connection: Keep-Alive < Cache-Control: no-cache < followed by what I assume is audio binary data. It's tantalizing to say the least. I don't want to go down a path that's been trodden...can you share some insight @brownad into the issues you've run into in getting this going?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

hjdhjd commented 4 years ago

I have gotten this working, with some caveats.

It's pretty straightforward to get this going to show you this is possible to do in FFmpeg. Assuming you have FFmpeg and ffplay installed, run this command:

ffmpeg -re -rtsp_transport tcp -i rtsp://doorbirduser:doorbirdpass@yourdoorbirdip:8557/mpeg/media.amp -f mulaw -ar 8000 -i http://doorbirduser:doorbirdpass@yourdirbirdip/bha-api/audio-receive.cgi -f matroska - | ffplay -

You'll see that it does produce the very stream we are seeking to create and plays it in ffplay. You can hear the audio and see the video.

I've mucked around a little with the ffmpeg command line in ffmpeg.js, but it clearly needs work.

Among other issues I noticed...if you enable audio in the camera config, you'll get an error as it tries to create a duplicate microphone device. Easy workaround is don't enable audio in config.json for now...just flip the conditional to always be true around line 310 or so in ffmpeg.js.

@brownad - I think that should give a fair amount to go on. This looks pretty straightforward at this stage, someone needs to spend the time working out what's quirky with the ffmpeg incantation in the code but the above shows it's pretty straightforward to implement using ffmpeg...we're just missing some ffmpeg command line mojo.

brownad commented 4 years ago

That’s pretty sweet. If anyone knows ffmpeg well then could be possible to do

Sent from my iPhone

On 27 May 2020, at 00:12, hjdhjd notifications@github.com wrote:

I have gotten this working, with some caveats.

It's pretty straightforward to get this going to show you this is possible to do in FFmpeg. Assuming you have FFmpeg and ffplay installed, run this command:

ffmpeg -re -rtsp_transport tcp -i rtsp://doorbirduser:doorbirdpass@yourdoorbirdip:8557/mpeg/media.amp -f mulaw -ar 8000 -i http://doorbirduser:doorbirdpass@yourdirbirdip/bha-api/audio-receive.cgi -f matroska - | ffplay -

You'll see that it does produce the very stream we are seeking to create and plays it in ffplay. You can hear the audio and see the video.

I've mucked around a little with the ffmpeg command line in ffmpeg.js, but it clearly needs work.

Among other issues I noticed...if you enable audio in the camera config, you'll get an error as it tries to create a duplicate microphone device. Easy workaround is don't enable audio in config.json for now...just flip the conditional to always be true around line 310 or so in ffmpeg.js.

@brownad - I think that should give a fair amount to go on. This looks pretty straightforward at this stage, someone needs to spend the time working out what's quirky with the ffmpeg incantation in the code but the above shows it's pretty straightforward to implement using ffmpeg...we're just missing some ffmpeg command line mojo.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

hjdhjd commented 4 years ago

@brownad I created a PR with the updates and instructions to get audio working.

You need ffmpeg compiled with fdk-aac support. You also need to flip audio support on and adjust the source line in videoConfig.

Otherwise, it works. Enjoy.

Microphone support isn't in this BTW...just listen-only audio. Microphone support is a project for another day, assuming some of the issues have been resolved with homebridge.

hjdhjd commented 4 years ago

51

brownad commented 4 years ago

I noticed other plugins resolved microphone thought the ring one did..

Sent from my iPhone

On 27 May 2020, at 16:41, hjdhjd notifications@github.com wrote:

51

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

hjdhjd commented 4 years ago

It's possible to do as of the middle of last year. I think we take it a step at a time. Getting one-way audio is a start. Microphone next.

brownad commented 4 years ago

published now.. 👍 @hjdhjd