GithubHelp home page GithubHelp logo

Comments (7)

philipsaad avatar philipsaad commented on June 12, 2024

What device are you running Homebridge on? A Pi? I use the following settings, albeit not on a Pi, I have a large-ish VMWare ESXi host that is running dual Xeons, but it should should help on the Pi as well.

I find the default ffmpeg parameters to not be to optimized for live streaming, here is my config, insert this after the controllers section in the Homebridge config.

        "videoConfig": {
            "additionalCommandline": "-preset ultrafast -tune zerolatency -profile:v high -level 4.2 -x264-params intra-refresh=1:bframes=0",
            "maxWidth": 0,
            "maxHeight": 360,
            "audio": true
        }

Lowering the resolution, and switching to the ultrafast preset with zerolatency tuning seems to have the biggest impact. I'm able to get a live stream going with sound in under 2 seconds, which cannot be beat unless the camera itself is providing a HomeKit compatible stream.

from homebridge-unifi-protect.

tronny87 avatar tronny87 commented on June 12, 2024

What device are you running Homebridge on? A Pi? I use the following settings, albeit not on a Pi, I have a large-ish VMWare ESXi host that is running dual Xeons, but it should should help on the Pi as well.

I find the default ffmpeg parameters to not be to optimized for live streaming, here is my config, insert this after the controllers section in the Homebridge config.

        "videoConfig": {
            "additionalCommandline": "-preset ultrafast -tune zerolatency -profile:v high -level 4.2 -x264-params intra-refresh=1:bframes=0",
            "maxWidth": 0,
            "maxHeight": 360,
            "audio": true
        }

Lowering the resolution, and switching to the ultrafast preset with zerolatency tuning seems to have the biggest impact. I'm able to get a live stream going with sound in under 2 seconds, which cannot be beat unless the camera itself is providing a HomeKit compatible stream.

Your config slightly improved latency in my stream (I still have about a 5 second lag) and fixed my missing audio, but it still takes about 10 seconds to establish the stream.

I am running the plugin on a Synology NAS.

from homebridge-unifi-protect.

philipsaad avatar philipsaad commented on June 12, 2024

It could be that the Synology is using an underpowered CPU, which is typical for storage focused devices. Do you know if you installed ffmpeg from the Synology store or downloaded manually? It could be that it's not making use of the GPU or whatever to make use of an offloaded encode.

from homebridge-unifi-protect.

tronny87 avatar tronny87 commented on June 12, 2024

It could be that the Synology is using an underpowered CPU, which is typical for storage focused devices. Do you know if you installed ffmpeg from the Synology store or downloaded manually? It could be that it's not making use of the GPU or whatever to make use of an offloaded encode.

ffmpeg was bundled with my install of homebridge-ring, which as I mentioned above, loads streams flawlessly and very quickly, even though they are WAN streams

from homebridge-unifi-protect.

hjdhjd avatar hjdhjd commented on June 12, 2024

@tronny87 As others have noted, audio is supported. As to the latency - I concur that I'd point this to underpowered hardware. I have no issues with latency and I've got 15+ UniFi Protect cameras streaming via homebridge simultaneously.

One thing you can try is to use a lower quality RTSP stream in Protect. Another option would be to try adding:

"additionalCommandline": "-tune zerolatency"

This will sacrifice quality of the stream for speed. Good luck.

Closing as these aren't bugs and this is intended behavior.

from homebridge-unifi-protect.

tronny87 avatar tronny87 commented on June 12, 2024

@tronny87 As others have noted, audio is supported. As to the latency - I concur that I'd point this to underpowered hardware. I have no issues with latency and I've got 15+ UniFi Protect cameras streaming via homebridge simultaneously.

One thing you can try is to use a lower quality RTSP stream in Protect. Another option would be to try adding:

"additionalCommandline": "-tune zerolatency"

This will sacrifice quality of the stream for speed. Good luck.

Closing as these aren't bugs and this is intended behavior.

I'm not sure how an issue like this can be caused by underpowered hardware if I'm able to use another plugin (homebridge-ring) that also uses ffmpeg to fetch a video stream, and a stream over HTTP WAN nonetheless. It takes 1-2 seconds for the stream to start up inside my Home app, whereas this plugin, takes up between 6-10 seconds to start going, and with a massive delay once its going.

I fear this may come down to the way the plugin leverages ffmpeg and you may want to look at the homebridge-ring coding to see if there's anything that can be done differently.

from homebridge-unifi-protect.

github-actions avatar github-actions commented on June 12, 2024

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

from homebridge-unifi-protect.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.