home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
73.31k stars 30.62k forks source link

UniFi Protect camera images in low res after new setup of the integration #89185

Closed mbrammer closed 1 year ago

mbrammer commented 1 year ago

The problem

I am having an issue with the UniFi Protect integration. I recently switch from a DreamMachine Pro to the DreamMachine SE. Because of the switch, I had to reintegrate the cameras. Previously I had a camera image with the highest resolution, now I just get some medium/small image. I didn't find any settings in the integration to change the cameras quality, so I'm a bit helpless. The protect integration page (https://www.home-assistant.io/integrations/unifiprotect) has a section about camera streams, which describes to torn on RTSP(S). But I didn't use this before. Also I think this is not the right thing for me, because I need to have a camera proxy, which will cut a part of the camera image I am interested in. So I tried with RTSP(S), but I didn't help to get a high quality image with the camera proxy :( Any ideas?

What version of Home Assistant Core has the issue?

core-2023.3.1

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Container

Integration causing the issue

UniFi Protect

Link to integration documentation on our website

https://www.home-assistant.io/integrations/unifiprotect

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

home-assistant[bot] commented 1 year ago

Hey there @briis, @angellusmortis, @bdraco, mind taking a look at this issue as it has been labeled with an integration (unifiprotect) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `unifiprotect` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign unifiprotect` Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


unifiprotect documentation unifiprotect source (message by IssueLinks)

mbrammer commented 1 year ago

The entity_picture had a high-res image before the re-setup.

image

AngellusMortis commented 1 year ago

This mean there is an issue with how your UniFi Protect is configured. Enabling High FPS mode will give you 1080p instead of 4k. It also prefers and only enables the highest quality channel that has RTSP enabled. If none of them have RTSP enabled or your RTSP streaming disabled on config entry options, it will only enable the high one by default.

All of the available qualities should be available to enable if they are not enabled by default.

mbrammer commented 1 year ago

There is no High FPS in the G4 Instant. I also played around with the FPS, but I always just get the 640x360 image in the entity_picture.
Here are some more of my configs. Maybe this helps:

image image image image

Original picture (should be 2688x1512): image

mbrammer commented 1 year ago

BTW: All of my ten cameras return just a 640x360 entity_picture. I have G3 Instant, G4 Instant, G3 Flex and G4 Bullet.
I tried all kinds of settings. I am somewhat at a loss :(

mbrammer commented 1 year ago

Somehow glad to hear that I am not the only one with this issue.
Unfortunately I didn't find any solution since I posted this :(

Semi-Off-Topic (may help others): Since this is important to me for using the camera proxy, to provide the section of the front door of the camera which is filming my yard, I now used ffmpeg to crop the section from the rtsp live stream.
Since the RTSP live stream itself is in high res (just the entity_picture is in low res), this is working perfectly for me. Also a nice benefit of the ffmpeg solution is that I have a real live stream. Downside is, it costs me about 20-22% CPU of my NAS constantly and increases the power consumption at around 2 Watts.
But for anyone who is interested in my solution, here I explain how I did it.

Mace404 commented 1 year ago

Having the same issues since the last stable update from Unifi Protect. I also have the RTSPS stream disabled in the HA integration. (video starts slow, buffers and is like 15s lagging behind) All of my camera's are giving the low resolution snapshot except one.

All camera's have the needed 'Enable anonymous snapshots' enabled on the camera itself and give a good high resolution snap from that http://[cam ip]\snap.jpeg

I really see no differences in configuration between them in Protect and HA.

Im thinking to just add extra camera's from that snap.jpeg myself, ignore the ones from the integration (just use those for the sensors).

versions I'm using: Unifi Cloudkey G2 Plus 3.0.17 Unifi Protect 2.7.33 Home Assistant 2023.3.6 Supervisor 2023.03.3 Operating System 9.5

AngellusMortis commented 1 year ago

Upstream issue (https://github.com/AngellusMortis/pyunifiprotect/issues/268). Closing here as there is nothing that can be done in HA Core to fix it.

AngellusMortis commented 1 year ago

@home-assistant close