AlexxIT / go2rtc

Ultimate camera streaming application with support RTSP, RTMP, HTTP-FLV, WebRTC, MSE, HLS, MP4, MJPEG, HomeKit, FFmpeg, etc.
https://github.com/AlexxIT/Blog
MIT License
4.27k stars 349 forks source link

2-way audio to a Home Assistant media_player #1327

Open ackjewtn opened 2 weeks ago

ackjewtn commented 2 weeks ago

I have a scenario where i'd like to talk back (To my dog in this case), but i'd like to send the audio to a speaker located elsewhere in my house instead of the source camera, which is available in Home Assistant as a media_player

I'm using Unifi cameras and i have this setup like this

streams:
  camera.dog_camera:
    - rtspx://10.255.25.1:7441/LR42fugdNOfosafG

I've read the docs multiple times and struggle to understand if this is possible or not. E.g. something like this

streams:
  camera.dog_camera:
    - rtspx://10.255.25.1:7441/LR42fugdNOfosafG
    - hass:media_player.living_room

Would appreciate if someone had a solution or any tips that could point me in the right direction.

AlexxIT commented 2 weeks ago

There is no working solution for now. But I have an idea how to do it. It's not easy task and very rare case. So it will be low priority.

ackjewtn commented 2 weeks ago

If the speaker accepts something ffmpeg can output (using encoding), such as raw ADTS frames/Opus/MP3/PCM over udp/tcp or similar, is that possible? E.g. skipping the whole Home Assistant part of it and only using ffmpeg to push the talk-back audio?

AlexxIT commented 2 weeks ago

Current go2rtc version doesn't support forwarding backchannel audio to app's output as REST API. If this feature would be added, the problem would be solved.

uchagani commented 2 weeks ago

This is a great idea to implement something like an intercom system