Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Camera Stream anomaly #47

Closed
tiaanv opened this issue Apr 14, 2020 · 8 comments
Closed

Camera Stream anomaly #47

tiaanv opened this issue Apr 14, 2020 · 8 comments

Comments

@tiaanv
Copy link

tiaanv commented Apr 14, 2020

My issue is more of a nuisance than a real issue, and I'm sure that the problem most likely does NOT lie within this component, but I'm hoping that the insight you have may guide me to a solution, or an alternative.

BACKGROUND:
Before I started using Blueiris, I have simply set up individual camera entities in HA, and as usual, have then in Lovelace set up as picture entities. Early on in this process, I had enabled the "stream" integration in my configuration.yaml. This was running for at least a year, maybe two. It worked fairly well. I would get the occasional stutter in some of my cameras.

I recently acquired Blueiris, and started using your component. This has many benefits, and I love the ease of configuration. The Lovelace picture card, however, is not working as I'd hoped. I now have two options.... neither of which are great.

Option 1:
I remove the "stream" integration form my configuration, but then I get image grabs from the camera, and we are basically limited to a few(3-5) frames per second. This surely is acceptable, but it feels like a step backward.
Example no-stream

Option 2:
I enable the stream component, and every few seconds I get this strange buffer/compression glitch. I think this is still better than 3-4 fps, but it does lead me to want to see if this can be resolved/improved.
Example with-stream

Unfortunately, my understanding of the mechanics at play is way to simple to really dig into this.
If you perhaps have any guidance that would be great.

I have not seen any errors in the logs pertaining to this.
I don't have many settings I can change (AFAIK).

@elad-bar
Copy link
Owner

the difference of working with individual camera with stream component to working with BlueIris and stream is the amount of load that HA will overload the BI server.

the issue is not with the component I wrote but the ability of BI server to handle.
I have strong machine running BI Server with 17 camera, when enabling Stream CPU gets to 100%, when running it without stream component it works on less than 25%

@tiaanv
Copy link
Author

tiaanv commented Apr 14, 2020

I have investigated this early on.

I am running a proxmox VE, with a hass.io VM, and a separate Blueiris VM.
This graph below is the ENTIRE VE usage... this is whilst streaming from HA.
image

This is the graph for the Blueiris VM
image

Graph for the HA VM
image

As you can see form all three graphs, the CPU(s) are not even breaking a sweat. Similarly, there are no IO bottlenecks, and network traffic is negligible.

I am only running 4 cameras, and the configuration of Blueiris is configured for optimal CPU usage and hardware decoding. Viewing any/all of the cameras through the BlueIris Web-frontend has no issues, and is smooth as butter. Monitoring all 4 cameras in realtime at approx 15 fps results in almost no CPU load:
image

My deduction from this is that the stream component does not seem to be overloading the hardware at all.

Just to add a final note... I am NOT running the picture cards in LIVE mode, only when I click on an individual card, does the stream component kick into action.

Question: How are you using the BI camera streams in HA. Are you using the Lovelace views at all, or are you just using the automation functions/services and sensors, etc, and viewing cameras in BI directly?

@elad-bar
Copy link
Owner

have 2 tabs with all camera lovelace component (not as live),
the problem is not when you are using the UI of BI Server, is once you have lovelace components for each of the camera, it opens # of websocket to the BI server that cannot handle it,
But if you checked it, it might got solved since the last time I checked,
one of the attributes of the camera component that being created is the still / stream URL,
you can create a dedicated component (GenericCamera) using those URLs to check how it works without my component

@tiaanv
Copy link
Author

tiaanv commented Apr 14, 2020

Without your component (as expected). I get the exact same result.

@tiaanv
Copy link
Author

tiaanv commented Apr 14, 2020

If I open the stream URL directly in VLC, it's the same.... That's interesting..... So this is clearly a BI issue directly...

@tiaanv
Copy link
Author

tiaanv commented Apr 14, 2020

Playing around, I figured out... as soon as I remove the rate control from the web server stream:
image
I no longer got the pixelation.... Not in VLC/HA. In HA though I get the little stutters I've seen before.
So clearly the stream implementaiton of HA is not great, but with this I can at least get rif of the compression artifacts ever 3 seconds...

Thx for your input. I think This needs to be closed.
T

@tiaanv tiaanv closed this as completed Apr 14, 2020
@elad-bar
Copy link
Owner

@tiaanv, in the past there was an issue opened and also opened in BI forum,
#9 it was also about poor performence of stream

@tiaanv
Copy link
Author

tiaanv commented Apr 14, 2020

Thx... Just looked at that.... My scenario is a little different, as I'm not reaching CPU overload. Mostly because I only have a few cameras.... That being said... the way that the stream component is working... it not going to play nice with BI..... I think... I'm going to remove it for now.... and investigate different integration methods into the Lovelace frontend... maybe an iframe or something... I have got external access to BI so, that's OK. HA is just a bonus. And I'd rather live with a low framerate, than BI and HA performance issues.

Thx again for the valuable insight!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants