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

HomeKit Camera Error(s) #230

Closed miniminne closed 3 months ago

miniminne commented 1 year ago

Hiya! When attempting to add a HomeKit Camera following the example given in the docs, I am hit with this error:

2023/01/31 20:38:40 [ERR] mdns: Failed to unpack packet: dns: empty NSEC(3) block in type bitmap
unknown codec: 320:38:40.261 ERR github.com/AlexxIT/go2rtc/cmd/streams/producer.go:52 > error="exec: exit status 1" url=ffmpeg:living_room3#audio=aac#audio=opus#async
2023/01/31 20:38:40 [ERR] mdns: Failed to unpack packet: dns: empty NSEC(3) block in type bitmap
2023/01/31 20:38:40 [ERR] mdns: Failed to unpack packet: dns: empty NSEC(3) block in type bitmap
20:38:40.294 ERR github.com/AlexxIT/go2rtc/cmd/streams/producer.go:52 > error="exec: exit status 1" url=ffmpeg:living_room3#audio=aac#audio=opus#async
2023/01/31 20:38:41 [INFO] mdns: Closing client {true false 0xc0000aaa00 <nil> 0xc0000aaa08 <nil> 1 0xc000092900}
20:38:51.897 ERR github.com/AlexxIT/go2rtc/cmd/streams/producer.go:52 > error="exec: exit status 1" url=ffmpeg:living_room3#audio=aac#audio=opus#async
20:38:51.925 ERR github.com/AlexxIT/go2rtc/cmd/streams/producer.go:52 > error="exec: exit status 1" url=ffmpeg:living_room#audio=aac#audio=opus#async

My config file is set up as such:

streams:
  living_room:
    - hass:ecobee SmartCamera
    - ffmpeg:living_room#audio=aac#audio=opus#async
  doorbell:
    - hass:Circle View Doorbell 2P08
    - ffmpeg:doorbell3#audio=aac#audio=opus#async

Which matches the docs aside from the names. I know these are the correct devices in HASS because if I slightly change the hass: names, it breaks and tells me quite clearly that's the issue.

Did something change recently that doesn't allow go2rtc to grab the correct stream from HASS? Or, is there a different encoder I need to choose?

AlexxIT commented 1 year ago

First, check camera names in go2rtc start logs. Have you seen this names? Second, try to get only video without audio. So remove ffmpeg.

miniminne commented 1 year ago

01:03:28.059 INF [hass] load stream url="hass:Circle View Doorbell 2P08"
01:03:28.059 INF [hass] load stream url="hass:ecobee SmartCamera"
01:03:28.059 INF [srtp] listen addr=:8443
01:03:28.061 INF [webrtc] listen addr=:8555
2023/02/01 01:04:04 [ERR] mdns: Failed to unpack packet: dns: empty NSEC(3) block in type bitmap
2023/02/01 01:04:04 [ERR] mdns: Failed to unpack packet: dns: empty NSEC(3) block in type bitmap
2023/02/01 01:04:04 [ERR] mdns: Failed to unpack packet: dns: empty NSEC(3) block in type bitmap
2023/02/01 01:04:05 [INFO] mdns: Closing client {true false 0xc0000a8b20 <nil> 0xc0000a8b28 <nil> 1 0xc000090ae0}
2023/02/01 01:04:14 [ERR] mdns: Failed to unpack packet: dns: empty NSEC(3) block in type bitmap
2023/02/01 01:04:14 [ERR] mdns: Failed to unpack packet: dns: empty NSEC(3) block in type bitmap
2023/02/01 01:04:14 [ERR] mdns: Failed to unpack packet: dns: empty NSEC(3) block in type bitmap
2023/02/01 01:04:15 [INFO] mdns: Closing client {true false 0xc000012250 <nil> 0xc000012258 <nil> 1 0xc000047a40}

Hey thanks for getting back to me! I did check the logs, and tried to stream just video via Firefox & Edge/Chromium. Both attempts landed me with the above error messages. I did confirm these are the right names via the startup logs and even copy/pasted to verify.

AlexxIT commented 1 year ago

You can try reboot Hass, than reboot go2rtc and try again right after reboot. I can see mdns library fail. I need to find another library.

miniminne commented 1 year ago

So I did try rebooting both HASS & go2rtc but the same errors cropped up ☹️

Digging into this a bit more, it looks like it's expecting some form of DNSSEC record but the response is borked? Which seems odd to me considering its mDNS, not querying an outside server.

ylemoigne commented 1 year ago

I have the same issue

kurtwarwick-new commented 1 year ago

Hi

I would just like to bring attention back to this issue. I certainly appreciate that Homekit is in development phase, so hopefully these common error will help in getting it over the line.

I am too experiencing these same errors with my Belkin Wemo Doorbell

01:09:39.692 DBG [rtsp] new consumer stream=doorbell
01:09:40.264 DBG [rtsp] new consumer stream=doorbell
2023/03/26 01:09:40 [INFO] mdns: Closing client {true false 0x40000a2028 <nil> 0x40000a2030 <nil> 1 0x40000ae0c0}
unknown codec: 301:09:41.610 DBG [streams] start producer url=hass:Doorbell
2023/03/26 01:09:42 [INFO] mdns: Closing client {true false 0x400000e080 <nil> 0x400000e088 <nil> 1 0x4000042420}
01:09:52.172 DBG [rtsp] handle=EOF
01:09:52.173 DBG [rtsp] disconnect stream=doorbell
01:10:01.057 DBG [rtsp] handle=EOF
01:10:01.058 DBG [streams] stop producer url=hass:Doorbell
01:10:01.059 DBG [rtsp] disconnect stream=doorbell
01:10:01.428 DBG [rtsp] new consumer stream=doorbell
2023/03/26 01:10:02 [INFO] mdns: Closing client {true false 0x400000e088 <nil> 0x400000e0a8 <nil> 1 0x4000180180}
unknown codec: 301:10:03.641 DBG [streams] start producer url=hass:Doorbell
01:10:22.083 DBG [rtsp] handle=EOF
01:10:22.084 DBG [streams] stop producer url=hass:Doorbell
01:10:22.084 DBG [rtsp] disconnect stream=doorbell
01:10:30.100 DBG [rtsp] new consumer stream=doorbell
2023/03/26 01:10:31 [INFO] mdns: Closing client {true false 0x400029c078 <nil> 0x400029c088 <nil> 1 0x4000180180}
unknown codec: 301:10:32.265 DBG [streams] start producer url=hass:Doorbell

To add, I have an Aqara G2H working perfectly, so I don't think it's my "setup". I have also tried with and without audio on this one, to no avail.

I wonder if the common theme of these devices being doorbells has anything to do with it?

Thanks! :)

miniminne commented 1 year ago

Hey @AlexxIT ! Have you had a chance to dive into this issue any more?

AlexxIT commented 1 year ago

I have several projects and they all need attention. Here's an example: https://github.com/AlexxIT/SonoffLAN/issues/1106#issuecomment-1490669165

AlexxIT commented 3 months ago

Probably no longer relevant