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.45k stars 93 forks source link

Apple TV: Homebridge Crashing, requires physical restart. #1094

Closed marsbars-marsbars closed 3 months ago

marsbars-marsbars commented 3 months ago

Homebridge UniFi Protect Version

7.1.2

Homebridge Platform and OS

Raspbian GNU/Linux Buster (10) ; Pi 3+

Homebridge Version

Homebridge v1.8.3 (HAP v0.12.2)

Node Version

v18.17.0

UniFi OS Version

v3.2.12

UniFi Protect Controller Version

v4.0.33

Describe the problem

Using AppleTV to view cameras from Homekit. Upon opening, the cameras start to refresh, with zero delays, once a few cameras in, I get the error - and over a few more min, homebrdige locks up and becomes 100% unresponsive. Requiring a physical restart.

The FFmpeg process ended unexpectedly due to issues with the media stream provided by the UniFi Protect livestream API. Adjusting the settings we use for FFmpeg temporarily to use safer values at the expense of some additional streaming startup latency.

Homebridge HBUP JSON configuration

{
    "bridge": {
        "name": "Homebridge 8DC3",
        "username": "0E:80:XX:61:8D:C3",
        "port": 51221,
        "pin": "739-34-354"
    },
    "accessories": [
        {
            "host": “192.168.XX.178",
            "https": false,
            "port": 9080,
            "username": “XX",
            "password": “XX",
            "name": "AdGuard Home",
            "autoOnTimer": [
                0
            ],
            "hideNonTimer": false,
            "stateLogging": true,
            "accessory": "AdGuardHome"
        }
    ],
    "platforms": [
        {
            "name": "Config",
            "port": 8581,
            "auth": "form",
            "theme": "auto",
            "tempUnits": "f",
            "lang": "auto",
            "platform": "config"
        },
        {
            "port": "/dev/ttyUSB0",
            "numZones": 16,
            "platform": "nuvo-platform"
        },
        {
            "controllers": [
                {
                    "address": "192.168.1.1",
                    "password": “password",
                    "username": “user"
                }
            ],
            "options": [
                "Enable.Log.Motion.245A4CD29FF5"
            ],
            "_bridge": {
                "username": "0E:DE:XX:2B:C3:B8",
                "port": 43293
            },
            "platform": "UniFi Protect"
        },
        {
            "units": "us",
            "interval": 15,
            "stations": [
                {
                    "nameNow": "Outside - House",
                    "service": "openweathermap",
                    "key": "3f7644202a82473dad45b16f160c952b",
                    "locationGeo": [
                        99.480702,
                        -99.75708
                    ],
                    "locationCity": “City, SA",
                    "language": "en",
                    "compatibility": "home",
                    "forecast": [
                        "Today"
                    ],
                    "conditionCategory": "simple",
                    "now": true,
                    "extraHumidity": false,
                    "hidden": [
                        "Air Pressure",
                        "Cloud Cover",
                        "Condition",
                        "Condition Category",
                        "Dew Point",
                        "Humidity",
                        "Observation Station",
                        "Observation Time",
                        "Ozone",
                        "Rain",
                        "Rain 1h",
                        "Rain Day",
                        "Rain Chance",
                        "Snow",
                        "Solar Radiation",
                        "Sunrise Time",
                        "Sunset Time",
                        "Temperature Min",
                        "Temperature Apparent",
                        "UV Index",
                        "Visibility",
                        "Wind Direction",
                        "Wind Speed",
                        "Wind Speed Max"
                    ]
                }
            ],
            "platform": "WeatherPlus"
        }
    ],
    "disabledPlugins": [
        "homebridge-omnilink-platform",
        "homebridge-hubitat-tonesto7"
    ]
}

Relevant log output

[27/06/2024, 13:39:13] [homebridge-unifi-protect] Front Door - South [G4 Doorbell]: Streaming request from 192.168.1.84: 1280x960@30fps, 502 kbps. Transcoding 960x720@24fps (Medium) [H264], 1,200 kbps [RTSP].
[27/06/2024, 13:39:14] [homebridge-unifi-protect] Driveway - South [G4 Bullet]: Streaming request from 192.168.1.84: 1920x1080@30fps, 802 kbps. Transcoding 1280x720@24fps (Medium) [H264], 2,000 kbps [RTSP].
[27/06/2024, 13:39:15] [homebridge-unifi-protect] Yard - North West [AI 360]: Streaming request from 192.168.1.84: 1920x1080@30fps, 802 kbps. Transcoding 1920x1920@30fps (High) [H264], 10,000 kbps [RTSP].
[27/06/2024, 13:39:18] [homebridge-unifi-protect] Window - North [G4 Instant]: Streaming request from 192.168.1.84: 1920x1080@30fps, 802 kbps. Transcoding 1280x720@30fps (Medium) [H264], 1,500 kbps [RTSP].
[27/06/2024, 13:39:20] [homebridge-unifi-protect] Driveway - South East [G4 Dome]: Streaming request from 192.168.1.84: 1920x1080@30fps, 802 kbps. Transcoding 1280x720@24fps (Medium) [H264], 2,000 kbps [RTSP].
[27/06/2024, 13:39:26] [homebridge-unifi-protect] Yard - South West [G4 Dome]: The FFmpeg process ended unexpectedly due to issues with the media stream provided by the UniFi Protect livestream API. Adjusting the settings we use for FFmpeg temporarily to use safer values at the expense of some additional streaming startup latency.
[27/06/2024, 13:39:27] [homebridge-unifi-protect] Yard - South West [G4 Dome]: Stopped video streaming session.
[27/06/2024, 13:39:29] [homebridge-unifi-protect] Yard - South West [G4 Dome]: Streaming request from 192.168.1.84: 1920x1080@30fps, 802 kbps. Transcoding 1920x1080@36fps (High) [H264], 10,000 kbps [RTSP].
[27/06/2024, 13:39:51] [homebridge-unifi-protect] Yard - East [AI 360]: The FFmpeg process ended unexpectedly due to issues with the media stream provided by the UniFi Protect livestream API. Adjusting the settings we use for FFmpeg temporarily to use safer values at the expense of some additional streaming startup latency.
[27/06/2024, 13:39:52] [homebridge-unifi-protect] Yard - East [AI 360]: Stopped video streaming session.
[27/06/2024, 13:39:52] [homebridge-unifi-protect] Deck - North East [G4 Dome]: Stopped video streaming session.
[27/06/2024, 13:39:52] [homebridge-unifi-protect] Garage Ceiling  - SE - Indoor [G3 Flex]: Stopped video streaming session.
[27/06/2024, 13:39:52] [homebridge-unifi-protect] Front Door - South [G4 Doorbell]: Stopped video streaming session.
[27/06/2024, 13:39:52] [homebridge-unifi-protect] Driveway - South [G4 Bullet]: Stopped video streaming session.
[27/06/2024, 13:39:52] [homebridge-unifi-protect] Yard - North West [AI 360]: Stopped video streaming session.
[27/06/2024, 13:39:52] [homebridge-unifi-protect] Window - North [G4 Instant]: Stopped video streaming session.
[27/06/2024, 13:39:52] [homebridge-unifi-protect] Driveway - South East [G4 Dome]: Stopped video streaming session.
[27/06/2024, 13:39:52] [homebridge-unifi-protect] Yard - South West [G4 Dome]: Stopped video streaming session.
[27/06/2024, 13:40:08] [homebridge-unifi-protect] Garage Ceiling  - SE - Indoor [G3 Flex]: Unable to retrieve a snapshot.

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

hjdhjd commented 3 months ago

TL;DR: This is an Apple TV bug, not an HBUP issue. It's been around for a while...feel free to search old issues. Apple TVs cannot handle untranscoded streams - they are too high quality / data for it. Shouldn't be the case but it is.

One of many reasons why the HBUP defaults are the defaults. You'll need to either stick with the defaults (specifically transcoding) or stop trying to stream on an ATV. Hopefully Apple eventually gets to it. Best of luck.

github-actions[bot] commented 3 months 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.