Hi. I have Dahua NVR, with 4 cameras that gives 3072x2040 resolution each. All cameras are added to HA as generic camera. Problem is, that it looks like that HA is hard to display/refresh so big res images, as in Lovelace the images refreshes really slowly - more than 10 sec (could not refresh at all and show grey screen), and if I open the camera window, it also loads really slow. For my Dafang cameras, the refresh rate is normlal (only fullhd res), 1sec if I open the camera, ~10 sec at lovelace card view.
Is there any way to resize the generic camera stream, but not to lower the resolution of the camera itsefl? i tried to add the NVR cameras as ffmpeg, but HA does not display them.
I’ve got the same issue. It looks like generic.camera is trying to refresh all of the camera images too quickly for the NVR to handle. Is there some way to stagger the http pull requests for still image updates?
When working with individual cameras, it doesn’t matter that you’re requesting the still images at the same time. NVRs are generally under powered and take time to respond. Trying to pull all the still images at once is overwhelming it.
Lorex LNR600 series. Pretty sure its a Dahua rebranded. Some of the IP cameras are directly connected to the NVR and on a non-routable network, therefore I can’t access the cameras directly to pull the snapshots from. I also have a mix of cameras that output varying image resolutions, which then show up in Lovelace as different sizes.
What I’ve done to overcome, for the time being, is setup a cron job to run a shell script every minute to:
1.) Download the images from the NVR sequentially
2.) Convert them to a standard image resolution 1920x1080
3.) Place in directory so another instance of apache can host them.
4.) Configured generic.camera snapshot url as the apache server.
It would be nice to have these features directly in generic.camera.
1.) Option to sequentially download images rather than simultaneously.
2.) Option to resize snapshot to uniform size
This is working very well and completely resolved the errors being generated from HA and the images not refreshing in Lovelace.
What url and camera type were you using to get images into HA? Snapshot.cgi was very hit or miss for me… I ended up using ffmpeg camera with the RTSP url …
rtsp://user:pwd@ip:port/cam/realmonitor?channel=1&subtype=0
Subtype of 0 is the full resolution “Main” stream and a subtype of 1 gives you the slightly lower quality stream.
Same problem with subtype 1. It also reduces the resolution of the stream while playing, which is a non-starter.
The solution is simple, provide a feature in generic.camera to sequentially download the images and ideally allow for resizing. Else, I’ll keep what I’ve got going.
Ever find a better solution for this? I’m running the same NVR as you and Hassio on an RPi3 and experience the exact same issues (including the image size differences) but I cannot implement your solution on HASSOS for obvious reasons.
I can confirm the NVR is the problem. I have a couple of my cams on a separate POE switch and can access them directly with zero issues. Same model cams accessed through the NVR produce the errors you mention - and a lot of them (I currently have 12 cams set up, 8 of them are 4K.).
I do not think it is related to multiple cams requesting at the same time though. Setting up even just one camera through the NVR produces the errors. Reducing the resolution on the camera does not prevent the error from occurring.
If I can’t come up with another solution I might just end up having to get a POE switch to connect all the cams to instead of connecting them to the NVR so I can access them directly which feels like throwing good money after bad.
ERROR (SyncWorker_10) [homeassistant.components.generic.camera] Error getting camera image: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))
ERROR (SyncWorker_18) [homeassistant.components.generic.camera] Error getting camera image: HTTPConnectionPool(host='192.168.1.100', port=80): Read timed out. (read timeout=10)