HKSV problems
### Homebridge UniFi Protect Version

v7.6.0

### Homebridge Platform and OS

Raspberry Pi 5 / Debian GNU/Linux Bookworm (12)

### Homebridge Version

v1.8.4

### Node Version

v20.17.0

### UniFi OS Version

4.0.18

### UniFi Protect Controller Version

5.0.34

### Describe the problem

Since around 2 weeks just some motion events get recorded, most don't (please see error log). It worked fine since months and I didn't change anything except updating regularly Homebridge, plugins and UniFi. It seems very similar to #1124 but v7.5.2 / v7.6.0 didn't change the behavior. In addition I also see sometimes that livestream via API doesn't start streaming. I use a new AppleTV with LAN cable for Homekit (iOS 18) and a new RP 5 for Homebridge with LAN cable.
I have a second home with the same problem. There I could see the behavior also under iOS 17.x.

### Homebridge HBUP JSON configuration

```json
"name": "UniFi Protect",
            "controllers": [
                {
                    "address": "192.168.X.XXX",
                    "username": "XXX",
                    "password": "XXX"
                }
            ],
            "platform": "UniFi Protect",
            "_bridge": {
                "username": "XXX"
            },
            "options": [
                "Enable.Log.HKSV.9C05D63B288F",
                "Enable.Log.Motion.9C05D63B288F",
                "Enable.Audio.Filter.Noise.9C05D63B288F",
                "Disable.Device.NightVision.9C05D63B288F",
                "Disable.Doorbell.Messages.FromDoorbell.9C05D63B288F",
                "Disable.Doorbell.Messages.9C05D63B288F",
                "Disable.Log.Doorbell.9C05D63B288F",
                "Disable.Video.Transcode.9C05D63B288F",
                "Enable.Video.HKSV.Record.Only.High.9C05D63B288F",
                "Enable.Audio.Filter.Noise.FftNr.9C05D63B288F.90",
                "Enable.Video.Transcode.Hardware.9C05D63B288F",
                "Enable.Audio.Filter.Noise.HighPass.9C05D63B288F.200",
                "Enable.Audio.Filter.Noise.LowPass.9C05D63B288F.1000",
                "Enable.Video.Transcode.HighLatency.Bitrate.9C05D63B288F.1000"
```


### Relevant log output

```shell
[01/10/2024, 15:44:10] [UniFi Protect] Terrasse Nord [G5 Flex]: Motion detected.
[01/10/2024, 15:44:15] [UniFi Protect] Terrasse Nord [G5 Flex]: Reconnecting to the livestream API.
[01/10/2024, 15:44:18] [UniFi Protect] Terrasse Nord [G5 Flex]: HKSV recording event ended early: the request timed out. This error can be safely ignored - it will occur occasionally.
[01/10/2024, 15:44:32] [UniFi Protect] Terrasse Nord [G5 Flex]: HKSV recording event ended early: the request timed out. This error can be safely ignored - it will occur occasionally.
[01/10/2024, 15:44:32] [UniFi Protect] Terrasse Nord [G5 Flex]: FFmpeg ended unexpectedly due to issues processing the media stream provided by the UniFi Protect livestream API. This error can be safely ignored - it will occur occasionally.
[01/10/2024, 15:47:03] [UniFi Protect] Terrasse Nord [G5 Flex]: Motion detected.
[01/10/2024, 15:47:08] [UniFi Protect] Terrasse Nord [G5 Flex]: Reconnecting to the livestream API.
[01/10/2024, 15:47:12] [UniFi Protect] Terrasse Nord [G5 Flex]: HKSV recording event ended early: the request timed out. This error can be safely ignored - it will occur occasionally.
[01/10/2024, 15:47:25] [UniFi Protect] Terrasse Nord [G5 Flex]: HKSV recording event ended early: the request timed out. This error can be safely ignored - it will occur occasionally.
[01/10/2024, 15:47:25] [UniFi Protect] Terrasse Nord [G5 Flex]: FFmpeg ended unexpectedly due to issues processing the media stream provided by the UniFi Protect livestream API. This error can be safely ignored - it will occur occasionally.
[01/10/2024, 15:47:48] [UniFi Protect] Terrasse Nord [G5 Flex]: Motion detected.
[01/10/2024, 15:47:57] [UniFi Protect] Terrasse Nord [G5 Flex]: HKSV recording event ended early: the request timed out. This error can be safely ignored - it will occur occasionally.
[01/10/2024, 15:47:57] [UniFi Protect] Terrasse Nord [G5 Flex]: FFmpeg ended unexpectedly due to issues processing the media stream provided by the UniFi Protect livestream API. This error can be safely ignored - it will occur occasionally.
[01/10/2024, 15:48:10] [UniFi Protect] Terrasse Nord [G5 Flex]: HKSV recording event ended early: the request timed out. This error can be safely ignored - it will occur occasionally.
[01/10/2024, 15:59:35] [UniFi Protect] Terrasse Nord [G5 Flex]: Motion detected.
[01/10/2024, 15:59:40] [UniFi Protect] Terrasse Nord [G5 Flex]: Reconnecting to the livestream API.
[01/10/2024, 15:59:44] [UniFi Protect] Terrasse Nord [G5 Flex]: HKSV recording event ended early: the request timed out. This error can be safely ignored - it will occur occasionally.
[01/10/2024, 16:07:08] [UniFi Protect] Terrasse Nord [G5 Flex]: Motion detected.
[01/10/2024, 16:07:13] [UniFi Protect] Terrasse Nord [G5 Flex]: Reconnecting to the livestream API.
[01/10/2024, 16:07:17] [UniFi Protect] Terrasse Nord [G5 Flex]: HKSV recording event ended early: the request timed out. This error can be safely ignored - it will occur occasionally.
[01/10/2024, 16:07:31] [UniFi Protect] Terrasse Nord [G5 Flex]: HKSV recording event ended early: the request timed out. This error can be safely ignored - it will occur occasionally.
[01/10/2024, 16:07:31] [UniFi Protect] Terrasse Nord [G5 Flex]: FFmpeg ended unexpectedly due to issues processing the media stream provided by the UniFi Protect livestream API. This error can be safely ignored - it will occur occasionally.
[01/10/2024, 16:08:59] [UniFi Protect] Terrasse Nord [G5 Flex]: Motion detected.
[01/10/2024, 16:09:22] [UniFi Protect] Terrasse Nord [G5 Flex]: HKSV: 15 second event.
[01/10/2024, 16:09:28] [UniFi Protect] Terrasse Nord [G5 Flex]: Motion detected.
[01/10/2024, 16:09:32] [UniFi Protect] Terrasse Nord [G5 Flex]: Reconnecting to the livestream API.
[01/10/2024, 16:09:36] [UniFi Protect] Terrasse Nord [G5 Flex]: HKSV recording event ended early: the request timed out. This error can be safely ignored - it will occur occasionally.
[01/10/2024, 16:09:50] [UniFi Protect] Terrasse Nord [G5 Flex]: HKSV recording event ended early: the request timed out. This error can be safely ignored - it will occur occasionally.
[01/10/2024, 16:09:50] [UniFi Protect] Terrasse Nord [G5 Flex]: FFmpeg ended unexpectedly due to issues processing the media stream provided by the UniFi Protect livestream API. This error can be safely ignored - it will occur occasionally.
[01/10/2024, 16:24:48] [UniFi Protect] Dach Ost [G5 Flex]: Motion detected.
[01/10/2024, 16:24:53] [UniFi Protect] Dach Ost [G5 Flex]: Reconnecting to the livestream API.
[01/10/2024, 16:24:57] [UniFi Protect] Dach Ost [G5 Flex]: HKSV recording event ended early: the request timed out. This error can be safely ignored - it will occur occasionally.
[01/10/2024, 16:25:10] [UniFi Protect] Dach Ost [G5 Flex]: HKSV recording event ended early: the request timed out. This error can be safely ignored - it will occur occasionally.
[01/10/2024, 16:25:10] [UniFi Protect] Dach Ost [G5 Flex]: FFmpeg ended unexpectedly due to issues processing the media stream provided by the UniFi Protect livestream API. This error can be safely ignored - it will occur occasionally.
[01/10/2024, 16:25:23] [UniFi Protect] Dach Ost [G5 Flex]: Motion detected.
[01/10/2024, 16:25:28] [UniFi Protect] Dach Ost [G5 Flex]: HKSV recording event ended early: the request timed out. This error can be safely ignored - it will occur occasionally.
[01/10/2024, 16:25:28] [UniFi Protect] Dach Ost [G5 Flex]: FFmpeg ended unexpectedly due to issues processing the media stream provided by the UniFi Protect livestream API. This error can be safely ignored - it will occur occasionally.
[01/10/2024, 16:25:42] [UniFi Protect] Dach Ost [G5 Flex]: HKSV recording event ended early: the request timed out. This error can be safely ignored - it will occur occasionally.
[01/10/2024, 16:25:42] [UniFi Protect] Dach Ost [G5 Flex]: FFmpeg ended unexpectedly due to issues processing the media stream provided by the UniFi Protect livestream API. This error can be safely ignored - it will occur occasionally.
[01/10/2024, 16:42:52] [UniFi Protect] Wiese Süd [G4 Instant]: Streaming request from 192.168.4.133: 1280x720@30fps, 299 kbps. Using 2688x1512@30fps (High) [H264], 10,000 kbps [API].
[01/10/2024, 16:42:57] [UniFi Protect] Wiese Süd [G4 Instant]: Stopped video streaming session.
[01/10/2024, 16:43:06] [UniFi Protect] Terrasse Nord [G5 Flex]: Motion detected.
[01/10/2024, 16:43:11] [UniFi Protect] Terrasse Nord [G5 Flex]: Reconnecting to the livestream API.
[01/10/2024, 16:43:11] [UniFi Protect] Terrasse Nord [G5 Flex]: Streaming request from 192.168.4.133: 1280x720@30fps, 299 kbps. Using 2688x1512@30fps (High) [H264], 10,000 kbps [API].
[01/10/2024, 16:43:15] [UniFi Protect] Terrasse Nord [G5 Flex]: HKSV recording event ended early: the request timed out. This error can be safely ignored - it will occur occasionally.
[01/10/2024, 16:43:20] [UniFi Protect] Terrasse Nord [G5 Flex]: Stopped video streaming session.
[01/10/2024, 16:43:20] [UniFi Protect] Terrasse Nord [G5 Flex]: FFmpeg ended unexpectedly due to issues processing the media stream provided by the UniFi Protect livestream API. This error can be safely ignored - it will occur occasionally.
[01/10/2024, 16:44:02] [UniFi Protect] Terrasse Nord [G5 Flex]: Streaming request from 192.168.4.133: 1280x720@30fps, 299 kbps. Using 2688x1512@30fps (High) [H264], 10,000 kbps [API].
[01/10/2024, 16:44:11] [UniFi Protect] Terrasse Nord [G5 Flex]: Stopped video streaming session.
[01/10/2024, 16:44:11] [UniFi Protect] Terrasse Nord [G5 Flex]: FFmpeg ended unexpectedly due to issues processing the media stream provided by the UniFi Protect livestream API. This error can be safely ignored - it will occur occasionally.
[01/10/2024, 16:44:29] [UniFi Protect] Dach Ost [G5 Flex]: Streaming request from 192.168.4.133: 1280x720@30fps, 299 kbps. Using 2688x1512@30fps (High) [H264], 10,000 kbps [API].
[01/10/2024, 16:44:39] [UniFi Protect] Dach Ost [G5 Flex]: Stopped video streaming session.
[01/10/2024, 16:44:53] [UniFi Protect] Terrasse Nord [G5 Flex]: Streaming request from 192.168.4.133: 1280x720@30fps, 299 kbps. Using 2688x1512@30fps (High) [H264], 10,000 kbps [API].
[01/10/2024, 16:45:00] [UniFi Protect] Terrasse Nord [G5 Flex]: Stopped video streaming session.
[01/10/2024, 16:45:07] [UniFi Protect] Terrasse Nord [G5 Flex]: Streaming request from 192.168.4.133: 1280x720@30fps, 299 kbps. Using 2688x1512@30fps (High) [H264], 10,000 kbps [API].
[01/10/2024, 16:45:16] [UniFi Protect] Terrasse Nord [G5 Flex]: Stopped video streaming session.
[01/10/2024, 16:48:07] [UniFi Protect] Terrasse Nord [G5 Flex]: Motion detected.
[01/10/2024, 16:48:11] [UniFi Protect] Terrasse Nord [G5 Flex]: Reconnecting to the livestream API.
[01/10/2024, 16:48:16] [UniFi Protect] Terrasse Nord [G5 Flex]: HKSV recording event ended early: the request timed out. This error can be safely ignored - it will occur occasionally.
[01/10/2024, 16:48:16] [UniFi Protect] Terrasse Nord [G5 Flex]: FFmpeg ended unexpectedly due to issues processing the media stream provided by the UniFi Protect livestream API. This error can be safely ignored - it will occur occasionally.
[01/10/2024, 16:56:18] [UniFi Protect] Terrasse Nord [G5 Flex]: Motion detected.
[01/10/2024, 16:56:23] [UniFi Protect] Terrasse Nord [G5 Flex]: Reconnecting to the livestream API.
[01/10/2024, 16:56:26] [UniFi Protect] Terrasse Nord [G5 Flex]: HKSV recording event ended early: the request timed out. This error can be safely ignored - it will occur occasionally.
[01/10/2024, 16:57:58] [UniFi Protect] Dach Ost [G5 Flex]: Motion detected.
[01/10/2024, 16:58:03] [UniFi Protect] Dach Ost [G5 Flex]: Reconnecting to the livestream API.
[01/10/2024, 16:58:07] [UniFi Protect] Dach Ost [G5 Flex]: HKSV recording event ended early: the request timed out. This error can be safely ignored - it will occur occasionally.
[01/10/2024, 16:58:20] [UniFi Protect] Dach Ost [G5 Flex]: HKSV recording event ended early: the request timed out. This error can be safely ignored - it will occur occasionally.
[01/10/2024, 16:58:20] [UniFi Protect] Dach Ost [G5 Flex]: FFmpeg ended unexpectedly due to issues processing the media stream provided by the UniFi Protect livestream API. This error can be safely ignored - it will occur occasionally.
```


### Acknowledgment that you are only running UniFi OS and UniFi Protect releases from the Ubiquiti Official release channel

- [X] I acknowledge that I am not running any early access / beta firmwares or operating systems from either Ubiquiti or Apple.