hjdhjd / homebridge-unifi-protect

:video_camera: Complete HomeKit integration for all UniFi Protect device types with full support for most features including HomeKit Secure Video, and more. https://homebridge.io
Other
1.46k stars 93 forks source link

Feature request: Raspberry Pi CM4 hardware transcoding support #965

Closed bcomnes closed 1 year ago

bcomnes commented 1 year ago

Describe The Problem: When I check the "Use hardware-accelerated transcoding when available (Apple Macs, Intel Quick Sync Video-enabled CPUs, Raspberry Pi 4)." setting and restart homebridge, I don't see the "Hardware accelerated decoding and transcoding" message when running on a raspi CM4.

My guess is that:

To Reproduce:

Run this plugin on a CM4 and enable hardware transcoding.

Logs:

[03/08/2023, 09:08:00] [HB Supervisor] Homebridge Process Ended. Code: 143, Signal: null
[03/08/2023, 09:08:05] [HB Supervisor] Restarting Homebridge...
[03/08/2023, 09:08:05] [HB Supervisor] Starting Homebridge with extra flags: -I -P /var/lib/homebridge/node_modules --strict-plugin-resolution
[03/08/2023, 09:08:05] [HB Supervisor] Started Homebridge v1.6.1 with PID: 1331
[03/08/2023, 09:08:06] Loaded config.json with 0 accessories and 2 platforms.
[03/08/2023, 09:08:06] Loaded 6 cached accessories from cachedAccessories.
[03/08/2023, 09:08:07] ---
[03/08/2023, 09:08:07] Loaded plugin: homebridge-unifi-protect@6.11.1
[03/08/2023, 09:08:07] Registering platform 'homebridge-unifi-protect.UniFi Protect'
[03/08/2023, 09:08:07] ---
[03/08/2023, 09:08:07] Loading 2 platforms...
[03/08/2023, 09:08:07] [UniFi Protect] Initializing UniFi Protect platform...
Setup Payload:
X-HM://0023UI74VVP78
Enter this code with your HomeKit app on your iOS device to pair with Homebridge:

    ┌────────────┐     
    │ ***-**-*** │     
    └────────────┘     

[03/08/2023, 09:08:08] Homebridge v1.6.1 (HAP v0.11.1) (Homebridge 1F6E) is running on port 51699.
[03/08/2023, 09:08:08] [UniFi Protect] bec.local: Connected to the UniFi Protect API at bec.local.
[03/08/2023, 09:08:08] [UniFi Protect] BEC: Discovered nvr: BEC [UCK G2 Plus] (address: 192.168.1.244 mac: 784558C89233).
[03/08/2023, 09:08:08] [UniFi Protect] BEC: Discovered camera: Georgia [G3 Flex] (address: 192.168.1.210 mac: FCECDA1F4B5E).
[03/08/2023, 09:08:08] [UniFi Protect] BEC: Discovered camera: Front Door [G4 Doorbell] (address: 192.168.1.42 mac: 74ACB90B6D9B).
[03/08/2023, 09:08:08] [UniFi Protect] BEC: Discovered camera: Driveway [G4 Instant] (address: 192.168.1.162 mac: 70A7418F81D3).
[03/08/2023, 09:08:08] [UniFi Protect] BEC: Discovered camera: Otto [G3 Flex] (address: 192.168.1.215 mac: 18E829CF2B33).
[03/08/2023, 09:08:08] [UniFi Protect] BEC: Discovered camera: Yard [G3 Instant] (address: 192.168.1.163 mac: 74ACB99F65ED).
[03/08/2023, 09:08:08] [UniFi Protect] BEC: Discovered sensor: Office Door [UP Sense] (mac: D8B3703214C8).
[03/08/2023, 09:08:08] [UniFi Protect] BEC [UCK-G2-PLUS] Office Door [UP Sense]: Enabled sensor: contact.
[03/08/2023, 09:08:09] [UniFi Protect] BEC [UCK-G2-PLUS] Front Door [G4 Doorbell]: Enabled doorbell message switch: LEAVE PACKAGE AT DOOR.
[03/08/2023, 09:08:09] [UniFi Protect] BEC [UCK-G2-PLUS] Front Door [G4 Doorbell]: Enabled doorbell message switch: DO NOT DISTURB.
[03/08/2023, 09:08:09] [UniFi Protect] BEC [UCK-G2-PLUS] Front Door [G4 Doorbell]: Enabled doorbell message switch: NO SOLICITING.
[03/08/2023, 09:08:09] [UniFi Protect] BEC: Default doorbell message set to: WELCOME.
[03/08/2023, 09:08:09] [UniFi Protect] BEC [UCK-G2-PLUS] Front Door [G4 Doorbell]: HomeKit Secure Video event recording enabled: 1600x1200@30fps (High), 2,000 kbps with a 4 second timeshift buffer.
[03/08/2023, 09:08:09] [UniFi Protect] BEC [UCK-G2-PLUS] Driveway [G4 Instant]: HomeKit Secure Video event recording enabled: 2688x1512@30fps (High), 2,000 kbps with a 4 second timeshift buffer.
[03/08/2023, 09:08:09] [UniFi Protect] BEC [UCK-G2-PLUS] Yard [G3 Instant]: HomeKit Secure Video event recording enabled: 1920x1080@30fps (High), 2,000 kbps with a 4 second timeshift buffer.

Homebridge Configuration:

 {
            "controllers": [
                {
                    "address": "bec.local",
                    "password": "xxxxx",
                    "username": "homebridge"
                }
            ],
            "name": "UniFi Protect",
            "options": [
                "Enable.Video.Transcode.Hardware"
            ],
            "verboseFfmpeg": false,
            "platform": "UniFi Protect"
        }

Screenshots: NA

Environment:

hjdhjd commented 1 year ago

Thanks for the report and the feature request. Technically, not a bug. 😄

I don't have a CM4 so I can't vouch for it. Does hardware transcoding work correctly and completely on the CM4? It looks like it's just a Pi4 without Ethernet, but the same CPU/GPU/RAM mix. If so, will get it added in.

Much appreciated, and thanks for the PR as well. 😄

So the key question:

Thanks!

bcomnes commented 1 year ago

Oops, rolled that local only password in the OP.

hjdhjd commented 1 year ago

Thanks for that - can you also enable the feature option to force transcoding of live streams - it should be right above the one for enabling hardware acceleration. Restart, then start a live stream from the Home app on a few of your cameras and paste those log snippets please.

bcomnes commented 1 year ago

Deleted the last comment because it had a code in it. Here it is again:

I turned it on hardware transcoding and restarted and this is the output:

[04/08/2023, 13:58:03] Homebridge v1.6.1 (HAP v0.11.1) (Homebridge 1F6E) is running on port 51699.
[04/08/2023, 13:58:03] [BraviaTVOS] XBR-65A8G: Configuring new accessory...
[04/08/2023, 13:58:03] XBR-65A8G 5A60 is running on port 35465.
[04/08/2023, 13:58:03] Please add [XBR-65A8G 5A60] manually in Home app. Setup Code: ***-**-****
[04/08/2023, 13:58:04] [UniFi Protect] bec.local: Connected to the UniFi Protect API at bec.local.
[04/08/2023, 13:58:04] [UniFi Protect] BEC: Discovered nvr: BEC [UCK G2 Plus] (address: 192.168.1.244 mac: 784558C89233).
[04/08/2023, 13:58:04] [UniFi Protect] BEC: Discovered camera: Georgia [G3 Flex] (address: 192.168.1.210 mac: FCECDA1F4B5E).
[04/08/2023, 13:58:04] [UniFi Protect] BEC: Discovered camera: Front Door [G4 Doorbell] (address: 192.168.1.42 mac: 74ACB90B6D9B).
[04/08/2023, 13:58:04] [UniFi Protect] BEC: Discovered camera: Driveway [G4 Instant] (address: 192.168.1.162 mac: 70A7418F81D3).
[04/08/2023, 13:58:04] [UniFi Protect] BEC: Discovered camera: Otto [G3 Flex] (address: 192.168.1.215 mac: 18E829CF2B33).
[04/08/2023, 13:58:04] [UniFi Protect] BEC: Discovered camera: Yard [G3 Instant] (address: 192.168.1.163 mac: 74ACB99F65ED).
[04/08/2023, 13:58:04] [UniFi Protect] BEC: Discovered sensor: Office Door [UP Sense] (mac: D8B3703214C8).
[04/08/2023, 13:58:04] [UniFi Protect] BEC [UCK-G2-PLUS] Office Door [UP Sense]: Enabled sensor: contact.
[04/08/2023, 13:58:04] [UniFi Protect] BEC [UCK-G2-PLUS] Georgia [G3 Flex]: Hardware-accelerated decoding and transcoding enabled: Raspberry Pi hardware acceleration will be used for livestreaming. HomeKit Secure Video recordings are not supported by the hardware encoder and will use software transcoding instead.
[04/08/2023, 13:58:04] [UniFi Protect] BEC [UCK-G2-PLUS] Front Door [G4 Doorbell]: Hardware-accelerated decoding and transcoding enabled: Raspberry Pi hardware acceleration will be used for livestreaming. HomeKit Secure Video recordings are not supported by the hardware encoder and will use software transcoding instead.
[04/08/2023, 13:58:04] [UniFi Protect] BEC [UCK-G2-PLUS] Driveway [G4 Instant]: Hardware-accelerated decoding and transcoding enabled: Raspberry Pi hardware acceleration will be used for livestreaming. HomeKit Secure Video recordings are not supported by the hardware encoder and will use software transcoding instead.
[04/08/2023, 13:58:04] [UniFi Protect] BEC [UCK-G2-PLUS] Otto [G3 Flex]: Hardware-accelerated decoding and transcoding enabled: Raspberry Pi hardware acceleration will be used for livestreaming. HomeKit Secure Video recordings are not supported by the hardware encoder and will use software transcoding instead.
[04/08/2023, 13:58:04] [UniFi Protect] BEC [UCK-G2-PLUS] Yard [G3 Instant]: Hardware-accelerated decoding and transcoding enabled: Raspberry Pi hardware acceleration will be used for livestreaming. HomeKit Secure Video recordings are not supported by the hardware encoder and will use software transcoding instead.
[04/08/2023, 13:58:04] [UniFi Protect] BEC [UCK-G2-PLUS] Front Door [G4 Doorbell]: Enabled doorbell message switch: LEAVE PACKAGE AT DOOR.
[04/08/2023, 13:58:04] [UniFi Protect] BEC [UCK-G2-PLUS] Front Door [G4 Doorbell]: Enabled doorbell message switch: DO NOT DISTURB.
[04/08/2023, 13:58:04] [UniFi Protect] BEC [UCK-G2-PLUS] Front Door [G4 Doorbell]: Enabled doorbell message switch: NO SOLICITING.
[04/08/2023, 13:58:05] [UniFi Protect] BEC: Default doorbell message set to: WELCOME.
[04/08/2023, 13:58:05] [UniFi Protect] BEC [UCK-G2-PLUS] Georgia [G3 Flex]: HomeKit Secure Video hardware-accelerated event recording enabled: 1920x1080@25fps (High), 2,000 kbps with a 4 second timeshift buffer.
[04/08/2023, 13:58:05] [UniFi Protect] BEC [UCK-G2-PLUS] Front Door [G4 Doorbell]: HomeKit Secure Video hardware-accelerated event recording enabled: 1600x1200@30fps (High), 2,000 kbps with a 4 second timeshift buffer.
[04/08/2023, 13:58:05] [UniFi Protect] BEC [UCK-G2-PLUS] Driveway [G4 Instant]: HomeKit Secure Video hardware-accelerated event recording enabled: 1280x720@30fps (Medium), 2,000 kbps with a 4 second timeshift buffer.
[04/08/2023, 13:58:05] [UniFi Protect] BEC [UCK-G2-PLUS] Otto [G3 Flex]: HomeKit Secure Video hardware-accelerated event recording enabled: 1920x1080@25fps (High), 2,000 kbps with a 4 second timeshift buffer.
[04/08/2023, 13:58:05] [UniFi Protect] BEC [UCK-G2-PLUS] Yard [G3 Instant]: HomeKit Secure Video hardware-accelerated event recording enabled: 1920x1080@30fps (High), 2,000 kbps with a 4 second timeshift buffer.
[04/08/2023, 13:58:15] [UniFi Protect] BEC [UCK-G2-PLUS] Driveway [G4 Instant]: Streaming request from 192.168.1.178: 1280x720@30fps, 299 kbps. Using 2688x1512@30fps (High), 2,000 kbps.
[04/08/2023, 13:58:31] [UniFi Protect] BEC [UCK-G2-PLUS] Driveway [G4 Instant]: Stopped video streaming session.
[04/08/2023, 13:58:32] [UniFi Protect] BEC [UCK-G2-PLUS] Georgia [G3 Flex]: Streaming request from 192.168.1.178: 1280x720@30fps, 299 kbps. Using 1920x1080@25fps (High), 6,000 kbps.
[04/08/2023, 13:58:56] [UniFi Protect] BEC [UCK-G2-PLUS] Georgia [G3 Flex]: Stopped video streaming session.
[04/08/2023, 13:58:57] [UniFi Protect] BEC [UCK-G2-PLUS] Front Door [G4 Doorbell]: Streaming request from 192.168.1.178: 640x480@30fps, 164 kbps. Using 1600x1200@30fps (High), 2,000 kbps.
[04/08/2023, 13:59:00] [UniFi Protect] BEC [UCK-G2-PLUS] Front Door [G4 Doorbell]: Stopped video streaming session.
[04/08/2023, 13:59:02] [UniFi Protect] BEC [UCK-G2-PLUS] Yard [G3 Instant]: Streaming request from 192.168.1.178: 1280x720@30fps, 299 kbps. Using 1920x1080@30fps (High), 2,000 kbps.
[04/08/2023, 13:59:12] [UniFi Protect] BEC [UCK-G2-PLUS] Yard [G3 Instant]: Stopped video streaming session.
[04/08/2023, 13:59:33] [UniFi Protect] BEC [UCK-G2-PLUS] Driveway [G4 Instant]: Streaming request from 192.168.1.247: 1280x720@30fps, 299 kbps. Using 2688x1512@30fps (High), 2,000 kbps.
[04/08/2023, 13:59:40] [UniFi Protect] BEC [UCK-G2-PLUS] Driveway [G4 Instant]: Stopped video streaming session.
[04/08/2023, 13:59:41] [UniFi Protect] BEC [UCK-G2-PLUS] Front Door [G4 Doorbell]: Streaming request from 192.168.1.247: 640x480@30fps, 164 kbps. Using 1600x1200@30fps (High), 2,000 kbps.
[04/08/2023, 13:59:45] [UniFi Protect] BEC [UCK-G2-PLUS] Front Door [G4 Doorbell]: Stopped video streaming session.
[04/08/2023, 13:59:51] [UniFi Protect] BEC [UCK-G2-PLUS] Georgia [G3 Flex]: Streaming request from 192.168.1.247: 1280x720@30fps, 299 kbps. Using 1920x1080@25fps (High), 6,000 kbps.
[04/08/2023, 13:59:57] [UniFi Protect] BEC [UCK-G2-PLUS] Georgia [G3 Flex]: Stopped video streaming session.
[04/08/2023, 13:59:58] [UniFi Protect] BEC [UCK-G2-PLUS] Otto [G3 Flex]: Streaming request from 192.168.1.247: 1280x720@30fps, 299 kbps. Using 1920x1080@25fps (High), 6,000 kbps.
[04/08/2023, 14:00:05] [UniFi Protect] BEC [UCK-G2-PLUS] Otto [G3 Flex]: Stopped video streaming session.
[04/08/2023, 14:00:06] [UniFi Protect] BEC [UCK-G2-PLUS] Yard [G3 Instant]: Streaming request from 192.168.1.247: 1280x720@30fps, 299 kbps. Using 1920x1080@30fps (High), 2,000 kbps.
[04/08/2023, 14:00:19] [UniFi Protect] BEC [UCK-G2-PLUS] Yard [G3 Instant]: Stopped video streaming session.
[04/08/2023, 14:00:20] [UniFi Protect] BEC [UCK-G2-PLUS] Driveway [G4 Instant]: Streaming request from 192.168.1.247: 1280x720@30fps, 299 kbps. Using 2688x1512@30fps (High), 2,000 kbps.
[04/08/2023, 14:00:28] [UniFi Protect] BEC [UCK-G2-PLUS] Driveway [G4 Instant]: Stopped video streaming session.
[04/08/2023, 14:00:37] [UniFi Protect] BEC [UCK-G2-PLUS] Driveway [G4 Instant]: Streaming request from 192.168.1.178: 1280x720@30fps, 299 kbps. Using 2688x1512@30fps (High), 2,000 kbps.
[04/08/2023, 14:00:41] [UniFi Protect] BEC [UCK-G2-PLUS] Driveway [G4 Instant]: Stopped video streaming session.
[04/08/2023, 14:00:44] [UniFi Protect] BEC [UCK-G2-PLUS] Driveway [G4 Instant]: Streaming request from 192.168.1.178: 1280x720@30fps, 299 kbps. Using 2688x1512@30fps (High), 2,000 kbps.
[04/08/2023, 14:00:52] [UniFi Protect] BEC [UCK-G2-PLUS] Driveway [G4 Instant]: Streaming parameters adjustment requested by HomeKit: 640x360, 30 fps, 132 kbps.

I'll let it run a while longer the the answer appears to be yes!

bcomnes commented 1 year ago

With the following options:

{
            "controllers": [
                {
                    "address": "***",
                    "password": "***",
                    "username": "homebridge"
                }
            ],
            "name": "UniFi Protect",
            "options": [
                "Enable.Video.Transcode.Hardware",
                "Enable.Video.Transcode"
            ],
            "verboseFfmpeg": false,
            "platform": "UniFi Protect"
        },

I get this for logs:

[04/08/2023, 17:46:42] Homebridge v1.6.1 (HAP v0.11.1) (Homebridge 1F6E) is running on port 51699.
[04/08/2023, 17:46:42] [BraviaTVOS] XBR-65A8G: Configuring new accessory...
[04/08/2023, 17:46:43] XBR-65A8G 5A60 is running on port 40869.
[04/08/2023, 17:46:43] Please add [XBR-65A8G 5A60] manually in Home app. Setup Code: ***-**-***
[04/08/2023, 17:46:43] [UniFi Protect] bec.local: Connected to the UniFi Protect API at bec.local.
[04/08/2023, 17:46:43] [UniFi Protect] BEC: Discovered nvr: BEC [UCK G2 Plus] (address: 192.168.1.244 mac: 784558C89233).
[04/08/2023, 17:46:43] [UniFi Protect] BEC: Discovered camera: Georgia [G3 Flex] (address: 192.168.1.210 mac: FCECDA1F4B5E).
[04/08/2023, 17:46:43] [UniFi Protect] BEC: Discovered camera: Front Door [G4 Doorbell] (address: 192.168.1.42 mac: 74ACB90B6D9B).
[04/08/2023, 17:46:43] [UniFi Protect] BEC: Discovered camera: Driveway [G4 Instant] (address: 192.168.1.162 mac: 70A7418F81D3).
[04/08/2023, 17:46:43] [UniFi Protect] BEC: Discovered camera: Otto [G3 Flex] (address: 192.168.1.215 mac: 18E829CF2B33).
[04/08/2023, 17:46:43] [UniFi Protect] BEC: Discovered camera: Yard [G3 Instant] (address: 192.168.1.163 mac: 74ACB99F65ED).
[04/08/2023, 17:46:43] [UniFi Protect] BEC: Discovered sensor: Office Door [UP Sense] (mac: D8B3703214C8).
[04/08/2023, 17:46:43] [UniFi Protect] BEC [UCK-G2-PLUS] Office Door [UP Sense]: Enabled sensor: contact.
[04/08/2023, 17:46:43] [UniFi Protect] BEC [UCK-G2-PLUS] Georgia [G3 Flex]: Hardware-accelerated decoding and transcoding enabled: Raspberry Pi hardware acceleration will be used for livestreaming. HomeKit Secure Video recordings are not supported by the hardware encoder and will use software transcoding instead.
[04/08/2023, 17:46:44] [UniFi Protect] BEC [UCK-G2-PLUS] Front Door [G4 Doorbell]: Hardware-accelerated decoding and transcoding enabled: Raspberry Pi hardware acceleration will be used for livestreaming. HomeKit Secure Video recordings are not supported by the hardware encoder and will use software transcoding instead.
[04/08/2023, 17:46:44] [UniFi Protect] BEC [UCK-G2-PLUS] Driveway [G4 Instant]: Hardware-accelerated decoding and transcoding enabled: Raspberry Pi hardware acceleration will be used for livestreaming. HomeKit Secure Video recordings are not supported by the hardware encoder and will use software transcoding instead.
[04/08/2023, 17:46:44] [UniFi Protect] BEC [UCK-G2-PLUS] Otto [G3 Flex]: Hardware-accelerated decoding and transcoding enabled: Raspberry Pi hardware acceleration will be used for livestreaming. HomeKit Secure Video recordings are not supported by the hardware encoder and will use software transcoding instead.
[04/08/2023, 17:46:44] [UniFi Protect] BEC [UCK-G2-PLUS] Yard [G3 Instant]: Hardware-accelerated decoding and transcoding enabled: Raspberry Pi hardware acceleration will be used for livestreaming. HomeKit Secure Video recordings are not supported by the hardware encoder and will use software transcoding instead.
[04/08/2023, 17:46:44] [UniFi Protect] BEC [UCK-G2-PLUS] Front Door [G4 Doorbell]: Enabled doorbell message switch: LEAVE PACKAGE AT DOOR.
[04/08/2023, 17:46:44] [UniFi Protect] BEC [UCK-G2-PLUS] Front Door [G4 Doorbell]: Enabled doorbell message switch: DO NOT DISTURB.
[04/08/2023, 17:46:44] [UniFi Protect] BEC [UCK-G2-PLUS] Front Door [G4 Doorbell]: Enabled doorbell message switch: NO SOLICITING.
[04/08/2023, 17:46:44] [UniFi Protect] BEC: Default doorbell message set to: WELCOME.
[04/08/2023, 17:46:44] [UniFi Protect] BEC [UCK-G2-PLUS] Georgia [G3 Flex]: HomeKit Secure Video hardware-accelerated event recording enabled: 1920x1080@25fps (High), 2,000 kbps with a 4 second timeshift buffer.
[04/08/2023, 17:46:44] [UniFi Protect] BEC [UCK-G2-PLUS] Front Door [G4 Doorbell]: HomeKit Secure Video hardware-accelerated event recording enabled: 1600x1200@30fps (High), 2,000 kbps with a 4 second timeshift buffer.
[04/08/2023, 17:46:44] [UniFi Protect] BEC [UCK-G2-PLUS] Driveway [G4 Instant]: HomeKit Secure Video hardware-accelerated event recording enabled: 1280x720@30fps (Medium), 2,000 kbps with a 4 second timeshift buffer.
[04/08/2023, 17:46:44] [UniFi Protect] BEC [UCK-G2-PLUS] Otto [G3 Flex]: HomeKit Secure Video hardware-accelerated event recording enabled: 1920x1080@25fps (High), 2,000 kbps with a 4 second timeshift buffer.
[04/08/2023, 17:46:44] [UniFi Protect] BEC [UCK-G2-PLUS] Yard [G3 Instant]: HomeKit Secure Video hardware-accelerated event recording enabled: 1920x1080@30fps (High), 2,000 kbps with a 4 second timeshift buffer.
[04/08/2023, 17:47:15] [UniFi Protect] BEC [UCK-G2-PLUS] Driveway [G4 Instant]: Streaming request from 192.168.1.247: 1280x720@30fps, 299 kbps. Hardware accelerated transcoding 1280x720@30fps (Medium), 1,500 kbps.
[04/08/2023, 17:47:25] [UniFi Protect] BEC [UCK-G2-PLUS] Driveway [G4 Instant]: Streaming parameters adjustment requested by HomeKit: 640x360, 30 fps, 132 kbps.
[04/08/2023, 17:47:26] [UniFi Protect] BEC [UCK-G2-PLUS] Driveway [G4 Instant]: Stopped video streaming session.
[04/08/2023, 17:47:27] [UniFi Protect] BEC [UCK-G2-PLUS] Yard [G3 Instant]: Streaming request from 192.168.1.247: 1280x720@30fps, 299 kbps. Hardware accelerated transcoding 1920x1080@30fps (High), 2,000 kbps.
[04/08/2023, 17:47:42] [UniFi Protect] BEC [UCK-G2-PLUS] Yard [G3 Instant]: Stopped video streaming session.
[04/08/2023, 17:50:36] [UniFi Protect] BEC [UCK-G2-PLUS] Driveway [G4 Instant]: Streaming request from 192.168.1.178: 1280x720@30fps, 299 kbps. Hardware accelerated transcoding 1280x720@30fps (Medium), 1,500 kbps.
[04/08/2023, 17:50:38] [UniFi Protect] BEC [UCK-G2-PLUS] Driveway [G4 Instant]: Stopped video streaming session.
[04/08/2023, 17:50:39] [UniFi Protect] BEC [UCK-G2-PLUS] Driveway [G4 Instant]: Streaming request from 192.168.1.178: 1280x720@30fps, 299 kbps. Hardware accelerated transcoding 1280x720@30fps (Medium), 1,500 kbps.
[04/08/2023, 17:50:48] [UniFi Protect] BEC [UCK-G2-PLUS] Driveway [G4 Instant]: Streaming parameters adjustment requested by HomeKit: 640x360, 30 fps, 132 kbps.
[04/08/2023, 17:50:48] [UniFi Protect] BEC [UCK-G2-PLUS] Driveway [G4 Instant]: Stopped video streaming session.
[04/08/2023, 17:50:50] [UniFi Protect] BEC [UCK-G2-PLUS] Front Door [G4 Doorbell]: Streaming request from 192.168.1.178: 640x480@30fps, 164 kbps. Hardware accelerated transcoding 1600x1200@30fps (High), 2,000 kbps.
[04/08/2023, 17:50:53] [UniFi Protect] BEC [UCK-G2-PLUS] Front Door [G4 Doorbell]: Stopped video streaming session.
[04/08/2023, 17:50:55] [UniFi Protect] BEC [UCK-G2-PLUS] Yard [G3 Instant]: Streaming request from 192.168.1.178: 1280x720@30fps, 299 kbps. Hardware accelerated transcoding 1920x1080@30fps (High), 2,000 kbps.
[04/08/2023, 17:51:00] [UniFi Protect] BEC [UCK-G2-PLUS] Yard [G3 Instant]: Streaming parameters adjustment requested by HomeKit: 640x360, 30 fps, 132 kbps.
[04/08/2023, 17:51:05] [UniFi Protect] BEC [UCK-G2-PLUS] Yard [G3 Instant]: Stopped video streaming session.
[04/08/2023, 17:51:05] [UniFi Protect] BEC [UCK-G2-PLUS] Yard [G3 Instant]: Streaming request from 192.168.1.178: 1280x720@30fps, 299 kbps. Hardware accelerated transcoding 1920x1080@30fps (High), 2,000 kbps.
[04/08/2023, 17:51:06] [UniFi Protect] BEC [UCK-G2-PLUS] Yard [G3 Instant]: Stopped video streaming session.
[04/08/2023, 17:51:08] [UniFi Protect] BEC [UCK-G2-PLUS] Driveway [G4 Instant]: Streaming request from 192.168.1.178: 1280x720@30fps, 299 kbps. Hardware accelerated transcoding 1280x720@30fps (Medium), 1,500 kbps.
[04/08/2023, 17:51:18] [UniFi Protect] BEC [UCK-G2-PLUS] Driveway [G4 Instant]: Streaming parameters adjustment requested by HomeKit: 640x360, 30 fps, 132 kbps.
[04/08/2023, 17:51:19] [UniFi Protect] BEC [UCK-G2-PLUS] Driveway [G4 Instant]: Stopped video streaming session.
[04/08/2023, 17:51:19] [UniFi Protect] BEC [UCK-G2-PLUS] Georgia [G3 Flex]: Streaming request from 192.168.1.178: 1280x720@30fps, 299 kbps. Hardware accelerated transcoding 1920x1080@25fps (High), 6,000 kbps.
[04/08/2023, 17:51:24] [UniFi Protect] BEC [UCK-G2-PLUS] Georgia [G3 Flex]: Stopped video streaming session.
[04/08/2023, 17:51:28] [UniFi Protect] BEC [UCK-G2-PLUS] Georgia [G3 Flex]: Streaming request from 192.168.1.178: 1280x720@30fps, 299 kbps. Hardware accelerated transcoding 1920x1080@25fps (High), 6,000 kbps.
[04/08/2023, 17:51:36] [UniFi Protect] BEC [UCK-G2-PLUS] Georgia [G3 Flex]: Streaming parameters adjustment requested by HomeKit: 640x360, 30 fps, 132 kbps.
[04/08/2023, 17:51:41] [UniFi Protect] BEC [UCK-G2-PLUS] Georgia [G3 Flex]: HomeKit Secure Video has recorded a 2:47 minute motion event.
hjdhjd commented 1 year ago

Thanks! How does the video look when you look at the livestreams - I assume the video quality looks pretty decent/good?

bcomnes commented 1 year ago

It's a bit more pixelated when I force transcoding but is acceptable. With this setting it looks great:

 "name": "UniFi Protect",
            "options": [
                "Enable.Video.Transcode.Hardware"
            ],
            "verboseFfmpeg": false,
            "platform": "UniFi Protect"
        },
hjdhjd commented 1 year ago

All expected behavior. Personally, I wouldn’t recommend using an RPi for HBUP with a bunch of cameras, especially if you have a lot of motion events and you’re using HKSV…but you do you. 😄

Appreciate it and thanks for the contribution. I’ll incorporate into the next release of HBUP.

bcomnes commented 1 year ago

Seems to be working great with this setup. The only issue I've seen is the following log line regardless of config

[04/08/2023, 18:02:36] [UniFi Protect] BEC [UCK-G2-PLUS] Georgia [G3 Flex]: HomeKit Secure Video has recorded a 1:49 minute motion event.
[04/08/2023, 18:03:44] [UniFi Protect] BEC [UCK-G2-PLUS] Otto [G3 Flex]: HomeKit Secure Video event recording ended early: The request timed out.

The events still seem to be captured though.

Thanks for the quality work!

hjdhjd commented 1 year ago

That’s not an issue, that’s expected behavior. 😄 Especially when using low powered CPUs that are going to struggle to meet HKSV latency requirements from time to time.

Moral of the story: don’t expect miracles given what you’re asking the RPi to do in this scenario. Cheers.

bcomnes commented 1 year ago

Fingers crossed for the rpi5! This will work fine for now.

github-actions[bot] commented 1 year ago

This issue is locked to prevent necroposting on closed issues. Please create a new issue for related support requests, bug reports, or feature suggestions.