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.93k stars 397 forks source link

Docker network issue #43

Closed luzik closed 2 years ago

luzik commented 2 years ago

I do understand that network_mode: host is needed for all those ports used for browser communication. My docker-compose uses frigate hostname for frigate container. My home assistant - frigate integration, was configured to connect using docker internal network with 'frigate:5000' url. Home assistant is asking go2rtc for rtmp://frigate/live/wejscie but go2rtc do not know docker internal hostnames because of network_mode: host.

Additional info is that for public access I am using HA behind traefic https proxy with go2rtc using same hostname but with api: base_path: "/go2rtc"

  1. What is the best way to communicate those 3 (frigate, ha, go2rtc) using docker-compose
  2. Do I just need to reconfigure frigate ha integration to use 127.0.0.1:5000 || lan_ip:5000, and this will solve my issue ?
  3. Docs say that 2-way audio need https. This is needed only for go2rtc <--> browser or also between go2rtc <--> ha ? Docs use http in connection between go2rtc and ha.
  4. If I will use ha interface is this a way to go ? browser <-https-> ha < -http-> go2rtc . Or ha-go2rtc is only api for AV stream creation/status
  5. Will only https access via port forwarding and traefik to HA and go2rtc, be enough for 2way audio from internet ?
luzik commented 2 years ago
extra_hosts:
      - frigate:127.0.0.1

Is my answer for 2.

AlexxIT commented 2 years ago
  1. You may forward frigate 1935 port (rtmp) from container to your host and use links rtmp://hostip/...
  2. Port 5000 is not used
  3. https://stackoverflow.com/questions/52759992/how-to-access-camera-and-microphone-in-chrome-without-https
  4. https://www.home-assistant.io/blog/2019/04/15/hassio-ingress/

I have external access to my HA: https://myhome.duckdns.org/

And to go2rtc Web UI: https://myhome.duckdns.org/hassio/ingress/a889bffc_go2rtc

luzik commented 2 years ago

I am using my own docker-compose, not Hass.io/os so there is my source of problems, but with your answers i should be able to solve my issues. Thx

AlexxIT commented 2 years ago

In the future there will be a custom lovelace card with 2 way audio support. But it might not be soon