Comments (7)
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.
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.
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.
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.
@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 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.
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)
- MFA Support HOT 1
- Package camera snapshot is occasionally taken from the main camera HOT 8
- Invoke ring on doorbell remotely HOT 3
- Issue with livestreaming in HKSV on Unifi Protect Version 6.20.0 HOT 4
- Moved to Mac Mini M1 Verison V6.20 and V.19 won't play video HOT 3
- Errors in the Log after Update from G3 to G5 Cameras HOT 2
- Homekit video / snapshot not loading after a while require reboot of plugin or homebridge HOT 2
- Unifi Protect HKSV recordings cut off HOT 3
- Memory Leaked warning HOT 3
- Possible cause of #1061 (Author's note: nope.). HOT 2
- Unifi Baby Cry AI Detection - Device to trigger off of HOT 2
- Is it possible to add only motion sensors from some of the devices? HOT 2
- Transcoding based on IP address HOT 3
- HBUP API behaviour is impacting local admin login to Protect (4.0.3) HOT 2
- Live Streaming does not work but works with other tools HOT 2
- Switch to disable doorbell inside HomeKit HOT 2
- Max CPU usage and 32 Protect API errors per second HOT 13
- Why does UP Floodlight require full admin rights? HOT 2
- 2FA SUPPORT HOT 3
- Protect Controller taking too long to respond HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from homebridge-unifi-protect.