Open visigoth opened 6 months ago
Is the Frigate container running with the network host setting?
apologies for taking a while to respond, but i don't get a lot of time to look into home networking issues.
for my case, i am running frigate along with other containers on a MAC VLAN network - i.e. each container has its own virtual NIC that shows up on the physical network.
Go2rtc should run in the host network to get the HomeKit protocol working
got it; i would rather not move to the host networking mode. having each container be a separate endpoint on the network makes traffic shaping and firewall rules easier to manage.
fwiw, the doorbell camera is routable for the HomeAssistant docker container as i have used HA as the HomeKit controller for it. also, the Frigate container can talk to the HomeAssistant container since i have camera entities in HomeAssistant for the go2rtc-reflected RTSP cameras.
i suppose i could host another go2rtc instance just to reflect the doorbell camera as an RTSP stream that Frigate can consume, but that seems convoluted.
given that the containers are routable to each other, and HA can talk to the doorbell camera, and the containers are under the same traffic shaping rules, what is it about the HomeKit protocol that requires host-mode networking?
Additional inbound ports for this protocol to work. mDNS and SRTP. They are static. Many streaming protocols use random inbound ports. Maybe some additional docker configuring of the docker container will be enough to make everything work. I don't know. I have no plans to test and support modes other than network host. It would take a lot of effort to support an issue (like this one) that shouldn't have come up.
i've made a bit of progress on this. my physical device is paired with HomeAssistant, so i setup the hass module to point at the HA config.
i've used the go2rtc web UI to enumerate the available streams. i've tried the homekit URL from the HomeAssistant section of the web UI (which has the client_private
secret). when i use this URL, i get "ffmpeg.doorbell.detect ERROR : [rtsp @ 0x55cf23d086c0] method SETUP failed: 461 Unsupported transport" in the frigate logs. i put the log level for go2rtc to debug and got the following:
2024-11-08 00:14:08.107713721 00:14:08.107 DBG [rtsp] new consumer stream=doorbell
2024-11-08 00:14:09.285753715 00:14:09.285 DBG [streams] start producer url=hass:Circle View Doorbell LFV8
2024-11-08 00:14:14.417223572 00:14:14.417 DBG [streams] retry=0 to url=hass:Circle View Doorbell LFV8
2024-11-08 00:14:16.305956681 [INFO] Starting go2rtc healthcheck service...
2024-11-08 00:14:20.749099608 00:14:20.749 DBG [streams] retry=0 to url=hass:Circle View Doorbell LFV8
2024-11-08 00:14:27.169481182 00:14:27.169 DBG [streams] retry=0 to url=hass:Circle View Doorbell LFV8
2024-11-08 00:14:33.607964698 00:14:33.607 DBG [streams] retry=0 to url=hass:Circle View Doorbell LFV8
2024-11-08 00:14:38.128588921 00:14:38.128 DBG [rtsp] handle=EOF
2024-11-08 00:14:38.128684719 00:14:38.128 DBG [streams] stop producer url=hass:Circle View Doorbell LFV8
2024-11-08 00:14:38.128755673 00:14:38.128 DBG [rtsp] disconnect stream=doorbell
because this is a macvlan, the container is sitting on the main network. it has its own IP address and is able to communicate over any port. go2rtc is able to enumerate homekit camera devices on the network just fine as evidenced in the web UI.
running go2rtc locally on my macbook on the same network with the same URL. however, i get a black stream and i don't get the handle=EOF error as in the logs above.
I am using Frigate's builtin go2rtc running in a docker instance. I have a HomeAssistant docker instance on the same box. The config path for HomeAssistant is mapped into the Frigate docker instance at /hass_config.
I have go2rtc configured like this inside the frigate configuration, and the frigate configuration is below that
note i have a number of other plain PoE RTSP cameras that are working fine with go2rtc + frigate doing both detection and recording. the above snippet just shows the one HomeKit camera i have for the doorbell. also note that i tried
hass:camera.doorbell
as well for the URL but i kept gettingno entity_id
and 404 errors in the log. i manually formatted thehomekit://
URL as above.when i start things up, i get
Could not find codec parameters for stream 0 (Video: h264, 1 reference frame, none): unspecified size
i tried increasing the
analyzeduration
andprobesize
values as suggested, but that didn't work either.the information ffmpeg is able to get out of go2rtc is: