beele / homebridge-unifi-protect-camera-motion

Camera & Motion sensor support for Unifi Protect cameras in Homekit via Homebridge
Apache License 2.0
103 stars 12 forks source link

Wireless cameras stream, wired cameras return an exit code of 1 #112

Open cleighland opened 11 months ago

cleighland commented 11 months ago

Describe the bug I have 5 Unifi cameras:

Everything appears to work at first glance. Homekit displays an image every couple of seconds as expected, and they're all updated. I can tap the two wireless devices (Doorbell, and G3 Instant), they both stream video perfectly fine. When I try to stream video from the other wired cameras I get the error codes in the logs:

[02/08/2023, 16:15:17] [UniFi Protect] 90SBV-UDM-PRO [UDM-PRO] Driveway [G3 Bullet]: FFmpeg process ended unexpectedly with an exit code of 1.

[02/08/2023, 16:15:17] [UniFi Protect] 90SBV-UDM-PRO [UDM-PRO] Driveway [G3 Bullet]: FFmpeg command line that errored out was: ffmpeg -hide_banner -nostats -fflags +discardcorrupt -probesize 16384 -max_delay 500000 -r 30 -rtsp_transport tcp -i rtsps://X.X.X.X:7441/CfSf0VQaufkrwbGK?enableSrtp -map 0:v:0 -vcodec copy -payload_type 99 -ssrc 2109127 -f rtp -srtp_out_suite AES_CM_128_HMAC_SHA1_80 -srtp_out_params 7ktYbzLtVD4K6WWEfUCcf0tN0TbYb/ogi5S6QHvC srtp://X.X.X.X:65265?rtcpport=65265&pkt_size=564 -map 0:a:0? -acodec libfdk_aac -afterburner 1 -eld_sbr 1 -eld_v2 1 -profile:a 38 -flags +global_header -f null -ar 24k -b:a 24k -bufsize 48k -ac 1 -payload_type 110 -ssrc 13149471 -f rtp -srtp_out_suite AES_CM_128_HMAC_SHA1_80 -srtp_out_params BXqJmo2FAZ9u8bc38eoHdZRf6DCdAk2w2h9EvGp8 srtp://192.168.15.38:52819?rtcpport=52819&pkt_size=188

[02/08/2023, 16:15:17] [UniFi Protect] 90SBV-UDM-PRO [UDM-PRO] Driveway [G3 Bullet]: rtsps://X.X.X.X:7441/CfSf0VQaufkrwbGK?enableSrtp: Immediate exit requested

[02/08/2023, 16:15:17] [UniFi Protect] 90SBV-UDM-PRO [UDM-PRO] Driveway [G3 Bullet]: Exiting normally, received signal 15.

I don't believe it's a connection issue, as I'm getting updated screenshots on my homekit devices?

Specifications Raspberry Pi 4 Model B (8Gb RAM) Unifi Dream Machine Pro:

I've installed and tested with the Homebridge-camera-ffmpeg plugin, and video streaming works from there. I'd like to be able to use the unifi plugin for motion detection and additional automations. I've confirmed all rtsps ports are identical across the cameras, along with all video qualities enabled for each.

Expected behavior Video streaming when tapping on the camera in homekit.

Screenshots If applicable, add screenshots to help explain your problem.

image0 image1 image2

beele commented 11 months ago

Can you check that the rtsp streams are enabled in the camera settings in unifi protect for those specific cameras?

cleighland commented 10 months ago

Yes, the RTSP streams are enabled for all cameras at all resolution levels.