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.39k stars 83 forks source link

Cannot start camera live stream: error:030000A9:digital envelope routines::unknown option #1025

Closed theproducer closed 7 months ago

theproducer commented 7 months ago

Homebridge UniFi Protect Version

v6.16.0

Homebridge Platform and OS

Apple Mac Mini A1347 - Fedora Server 39

Homebridge Version

v1.7.0

Node Version

v20.9.0

UniFi OS Version

v3.1.16

UniFi Protect Controller Version

v2.9.42

Describe the problem

Cameras appear in the Home app, along with thumbnail previews, however live video streams cannot be started, with a corresponding error appearing the log output.

Homebridge HBUP JSON configuration

{
    "bridge": {
        "name": "Homebridge 7344",
        "username": "0E:C9:2F:17:73:44",
        "port": 51045,
        "pin": "810-20-962",
        "advertiser": "bonjour-hap"
    },
    "accessories": [],
    "platforms": [
        {
            "name": "Config",
            "port": 8581,
            "auth": "form",
            "theme": "auto",
            "tempUnits": "f",
            "lang": "auto",
            "platform": "config"
        },
        {
            "controllers": [
                {
                    "address": "192.168.1.1",
                    "password": "***",
                    "username": "***"
                }
            ],
            "name": "UniFi Protect",
            "options": [
                "Enable.Video.Transcode.Hardware.68D79A504F81"
            ],
            "_bridge": {
                "username": "0E:9E:B8:AC:24:E5",
                "port": 39325
            },
            "platform": "UniFi Protect"
        }
    ]
}

Relevant log output

[11/26/2023, 10:17:36 AM] [UniFi Protect] Dream Machine Pro [UDM-PRO] Deck [G5 Bullet]: Streaming request from 192.168.1.21: 1280x720@30fps, 299 kbps. Using 1280x720@30fps (Medium), 2,000 kbps.
[11/26/2023, 10:17:36 AM] [UniFi Protect] Dream Machine Pro [UDM-PRO] Deck [G5 Bullet]: FFmpeg process ended unexpectedly with an exit code of 1.
[11/26/2023, 10:17:36 AM] [UniFi Protect] Dream Machine Pro [UDM-PRO] Deck [G5 Bullet]: FFmpeg (6.0-homebridge-alpine-x86_64-static) command that errored out was: /usr/lib/node_modules/homebridge-unifi-protect/node_modules/ffmpeg-for-homebridge/ffmpeg -hide_banner -nostats -fflags +discardcorrupt -probesize 16384 -max_delay 500000 -r 30 -rtsp_transport tcp -i rtsps://192.168.1.1:7441/DpoxUbMP1KRqZrFd?enableSrtp -map 0:v:0 -vcodec copy -payload_type 99 -ssrc 12346999 -f rtp -srtp_out_suite AES_CM_128_HMAC_SHA1_80 -srtp_out_params O+6F3P4+x5Bmz4MfmRfXHF4E+l3j+mRn4/h6HH9Q srtp://192.168.1.21:51924?rtcpport=51924&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 278130 -f rtp -srtp_out_suite AES_CM_128_HMAC_SHA1_80 -srtp_out_params mBfKPa+5O/2nW23ffZ48tY0jRFXkpPABxVFTIpQi srtp://192.168.1.21:56656?rtcpport=56656&pkt_size=188
[11/26/2023, 10:17:36 AM] [UniFi Protect] Dream Machine Pro [UDM-PRO] Deck [G5 Bullet]: [tls @ 0x7f8e0668a180] error:030000A9:digital envelope routines::unknown option
[11/26/2023, 10:17:36 AM] [UniFi Protect] Dream Machine Pro [UDM-PRO] Deck [G5 Bullet]: rtsps://192.168.1.1:7441/DpoxUbMP1KRqZrFd?enableSrtp: I/O error
[11/26/2023, 10:17:36 AM] [UniFi Protect] Dream Machine Pro [UDM-PRO] Deck [G5 Bullet]: Stopped video streaming session.

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

hjdhjd commented 7 months ago

Thanks for the support request! Good news and bad news…congrats on finding an error I hadn’t seen before (good news)…but it’s a new one for me (bad news). 😄

That said, I’m guessing you’re running in a containerized environment…my strong recommendation, especially on Apple platforms for HBUP: do not. You can take advantage of hardware acceleration and better performance and quality characteristics across the board by using Homebridge/HBUP natively on the Mac.

All that said…I do not think there is much I can do here, this isn’t an HBUP error, it’s either an issue with FFmpeg or with the camera/controller, from what I can see. A few questions:

  1. Was this setup previously working and this is a new error you’re encountering, or is this a new installation?
  2. Have you tried rebooting the camera in question and/or the UDMP to see if either helps?
theproducer commented 7 months ago

Thanks for looking into this! This is a brand new installation, everything is running natively, no containers (the Mac Mini is running headless with Fedora Server 39 fully installed on the hardware). I tried also running with NODE_OPTIONS set to --openssl-legacy-provider in case it was a Node 17+ OpenSSL related issue, that didn't work either.

Since you mentioned it possibly being an issue in FFmpeg, I pointed the HBUP FFmpeg binary path to a Fedora packaged version of FFmpeg and it worked (sans sound). With that in mind, I then built ffmpeg-for-homebridge from source (for fdk_aac support), and everything works as it should.

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