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.24k stars 345 forks source link

Fix support HomeKit server on macOS #626

Closed OskarLebuda closed 11 months ago

OskarLebuda commented 1 year ago

Hi, I’m not familiar with this lib so let me know if there are some answers for my questions

I found that I can use my homekit cameras (Aqara G2H Pro) into my custom app using this lib. But all of the docs told me that I have to known the homekit:// url. But... There is no information about "How to get homekit:// url".

Can someone tell me what should I do to get stream from my Aqara cameras into Go2RTC? What should I do? How to configure it?

I've tried to use docker image on mac to add my other camera (Eufy indoor cam) and I've got an error: image

my config:

api:
  origin: "*"
streams:
  eufy1:
    - rtsp://username:password@192.168.1.33/live0
    - ffmpeg:eufy1#video=h264#hardware
    - ffmpeg:eufy1#audio=opus
homekit:
  eufy1:
    pin: 19550224
    name: Eufy cam
    device_id: eufy1
    device_private: eufy1

I really don't know if I doing it right so let me know.

Another problem is that docker on mac does not support network_mode: host so I proxy ports like:

version: "3.7"

services:
  go2rtc:
    container_name: cube-home-go2rtc
    image: alexxit/go2rtc:1.7.1
    privileged: true
    restart: unless-stopped
    ports:
      - 1984:1984
      - 8554:8554
      - 8555:8555
    environment:
      - TZ=Europe/Berlin
    volumes:
      - "./docker/go2rtc:/config"

Let me know if it's a problem for this lib

AlexxIT commented 1 year ago
  1. I'm not sure if HomeKit will work fine without network host.
  2. You should pair your camera with Home Assistant or go2rtc to get homekit link
  3. What exact model of your eufy camera?
OskarLebuda commented 1 year ago
  1. I'm not sure if HomeKit will work fine without network host.
  2. You should pair your camera with Home Assistant or go2rtc to get homekit link
  3. What exact model of your eufy camera?
  1. Thats not a good info for me :( I think I have to buy some raspberry then.

I think all of the problem could be because I've use docker on mac. I close this issue and figure out what can I do with raspberry and if something will not working - I'll open this issue.

Thanks for your help 🫶

AlexxIT commented 1 year ago

You can run go2rtc without docker (as binary)

OskarLebuda commented 1 year ago

@AlexxIT If i do like that i have an error from go2rtc:

19:33:26.360 INF go2rtc version 1.7.1 darwin/arm64
19:33:26.360 INF [api] listen addr=0.0.0.0:1984
19:33:26.360 INF [rtsp] listen addr=0.0.0.0:8554
19:33:26.360 INF [webrtc] listen addr=0.0.0.0:8555/tcp
19:33:26.360 DBG [hass] can't import config: open .storage/core.config_entries: no such file or directory
19:33:26.363 ERR github.com/AlexxIT/go2rtc/internal/homekit/homekit.go:128 > error="no interfaces for listen"

maybe u know the reason?

AlexxIT commented 1 year ago

Interesting. I have another problem on my mac

20:53:16.858 INF go2rtc version 1.7.1 darwin/arm64
20:53:16.859 INF [api] listen addr=0.0.0.0:1984
20:53:16.859 INF [rtsp] listen addr=0.0.0.0:8554
20:53:16.859 INF [webrtc] listen addr=0.0.0.0:8555/tcp
20:53:16.863 ERR github.com/AlexxIT/go2rtc/internal/homekit/homekit.go:128 > error="listen udp4 0.0.0.0:5353: bind: address already in use"
OskarLebuda commented 1 year ago

I also have this problem yesterday. Then I killed all listeners for port 5353 and got error that u've presents. I killed it like

$ lsof -i tcp:5353
$ kill -9 PID_ID_OF_COMMAND_ABOVE
AlexxIT commented 11 months ago

https://github.com/AlexxIT/go2rtc/releases/tag/v1.8.0