keshavdv / unifi-cam-proxy

Enable non-Ubiquiti cameras to work with Unifi NVR
MIT License
1.68k stars 235 forks source link

List of Cameras working in Unifi_Cam_Proxy 0.1.4 and Protect 1.19.0 #75

Closed jkblm closed 2 years ago

jkblm commented 3 years ago

All,

I would like to ask what cameras you have successfully running in the Unifi_Cam_Proxy 0.1.4 and Protect 1.19.0? Unifi_Cam_Proxy cameras.pdf

I have been very successful using Hikvision PTZ cameras. But I have purchased ReoLink cameras listed as examples and other users have posted help requests. Listed cameras used, current firmware and example command to run on the Raspberry Pi. I have spend weeks trying to get different cameras to work. General problem is RBPi interface runs with no errors, new camera shows up in Protect camera interface (green dot) but no video in the interface, timelapse or Mobile interface.

I am looking for good quality indoor/outdoor (IP66/67) camera solutions that work with the Unifi_Cam_Proxy 0.1.4 and Protect 1.19.0 in the $40-70 range.

Screen Shot 2021-08-30 at 4 24 07 PM

Thanks for any advice and help you can provide.

tsspmq commented 3 years ago

Late and I'm out of it, so this will be a ramble.

I have quite an array of cameras and I have not found a single camera that cant work. You just have to fiddle with settings and I can get a D-Link VGA camera to work with this, Im confident any RTSP will work.

I am running 18 cameras in Protect, 16 of which are via this proxy. Im using my proxmox server to run the proxies via systemd and docker for frigate/mosquitto right on the host not even using containers or a VM. Load on the machine is around 10% from this. Frigate Im still waiting on my coral to arrive. I had 8 running Frigate but it was beating on the CPU at night with spider webs outside. I've tried using PIs (4 8GBS) for the proxies and leaving frigate and even rtsp on the proxmox host, and after about 6 4K cameras I start getting lots of green streaking in the cameras. PIs just dont have the oomph to route the data through without this happening, and its not CPU bound seems to just be an IO bound problem (Gb port but only around 15% in/out at same time). Since the proxy doesnt use much on proxmox host I just leave it there for simplicity.

4K cameras - Running via Frigate/RTSP. Lorex 8006-C - Running Lorex and Dahua firmware. Lorex LNE8964AB - Running Lorex firmware

Old crap cameras: D-Link DCS 2630L, 932, 2332, and 2330L. All of these are getting shitcanned though, because they are old as dirt and replacing them with Instants where WiFi is only option, or G4 Domes/G3 Flex where suitable.

Now, I can only use one 4k camera configured in Frigate and it works like a champ. I pull all three streams from the respective cameras with rtsp-simple-proxy. I like doing this because I power off the cameras when we're home through automation and it doesnt bomb out the "services" in systemd and protect just records and empty stream.

If I turn on Frigate in a second camera it confuses Protect the moment a second camera gets involved and I have not determined if this is the proxy or lack of a coral causing delays with two smart detections being crunched on at the same time. I really only need it on two cameras and I could always throw a second frigate container up and different prefix in MQTT to seperate them. I just use Frigate/RTSP for connecting even if Frigate doesnt care know about the camera since MQTT is all it depends on. Easier to copy/paste 16 cameras this way.

I had to monkey with the stream bitrate, quality, resolution as well as making sure I picked the right model to get the thumbnail and video working the way I liked. By using rtsp-simple-proxy this is easy.

I cant get the Lorex/Dahua to get past subscribing to the VideoEvents stream and I think its a digest auth issue. There is an integration for Home Asssistant for Dahua cameras that is VERY good at using the event subscription of the lorex cameras and seems there are many variations of the models that might cause the issue I have.

One thing I learned, and I didnt research why. CBR I run 15FPS for best, and 5FPS for the medium and low quality. If i use VBR I have to set medium and low to 7FPS or it blanks out. I've run at 10MB all the way down to 256k streams with success. Audio is always set to the AAC codec or it just sounds like crap, because I dont transcode it just copy it.

tsspmq commented 3 years ago

Oh. I went to the 1.19 beta and the beta IOS app, and it fixed video on the cameras via the proxies on mobile. That was something I didnt anticipate. Did that tonight.

jkblm commented 3 years ago

@tsspmq

Thank you for your feedback on working cameras being used with UnifiCamProxy (UCP).

I will add Lorex LNE8964AB to the list as a working solution on UCP 1.9.0 ($150-190) ==> There are a couple of used ones for $120.

Screen Shot 2021-08-31 at 10 26 11 AM Screen Shot 2021-08-31 at 10 27 31 AM

I can't find Lorex 8006-C when searching?

I will try your suggestion running CBR 15FPS for best, and 5FPS for the medium and low quality to see if I can get any of the cameras on my list.

I am not running any Frigate motion detection (yet) be cause I want to solve camera connection in Protect 1.9.0 first. Running everything on Raspberry Pi4B 8GB with PoE board installed.

I do like your setup using a dedicated proxmox server to run the proxies via systemd and docker for frigate/mosquitto + Coral USB Accelerator. Tell us how it works out for AI camera motion capture, cars and people recognition.

Production Setup: I am running all active four Hikvision PTZ cameras via UCP 0.1.4 on one dedicated Raspberry Pi4B with 8GB memory. Video recording on the UNVR-Protect 1.9.0/40TB disk with great results for 30 days.
This setup also has several Unify G4 Domes, G3 Flex and one G3 Instant - I would install more Unify cameras if you can get them (all sold out).

Test Setup: For testing new non-Unifi cameras via UCP 0.1.4 on one dedicated Raspberry Pi4B with 8GB memory. Video recording on the UDM Pro-Protect 1.9.0/10TB disk. Once I have a camera working in this setup I deploy to production settings.

Thank you again for your feedback @tsspmq .

Has anyone out there successfully installed ReoLink RLC-410-5MP or RLC-520 on the UnifyCamProxy version 0.1.4 with cameras showing up into Protect 1.19.0? It would be very helpful if you share:

  1. Your working command example on the RBPi or Server.
  2. Your camera model # and firmware installed.
  3. Any settings in the camera (Frame Rate, resolution...)

Thanks in advance!

tsspmq commented 3 years ago

Im sorry it was LNB8005-C. They have no microphone so keep that in mind. I've had them outside for 3 or more years and they have held up great. I still like the UX of having the G4 cameras however these will be the last I change out and trickle down to a family member.

tsspmq commented 3 years ago

So my Pi has the Argon One case and the SSD bottom on it. Debian 10 (They updated the image end of July) doesnt boot off the SSD, only Raspian which is almost always fine. I wish I had kept my ISO of the working version but Im ok with Raspian for now. I can get Debian 11 booting off the drive. I leave an SD card (clone) in as a backup and just rsync the few directories I care about to it so if I want I can blow away and restore the OS by removing the little USB 3 dongle.

You should be fine with 4 cameras, its more about the IO going through the SoC I suspect that was giving me performance issues.

A few things I've noticed: MacOS Safari it runs for about 10 seconds then stops, Im not sure why.
IOS beta app works Windows 10 Edge everything works great. So keep in mind you can get in a situation where you're chasing your tail and its your client.

If it were me, I'd just grab a few G4 Bullets if the price of used non Ubiquiti cameras is close, while at times I've enjoyed having the 4K, it is usually not needed and things way far out just get denoised too much. My G4 doorbell looks just as good as the 4K camera for what I need.

jkblm commented 3 years ago

@tsspmq I agree - If there are Ubiquiti cameras in stock (less the $1800 PTZ/$200 Doorbell) I will buy them. They work perfect right out of the box on UDM Pro/UNVR. But Ubiquiti has a supply chain problem to keep Protect cameras in stock. When G3 Instant were in stock I was so excited until I made the purchase limited to 1pcs :(

Ubiquiti is lacking good fixed (under $100) and PTZ (under $200) cameras that are true IP66/67 rated.

kraney commented 3 years ago

I can confirm that a Control4 DS2 door station camera does work - which is actually just an OEM of a 2N IP Solo intercom. Two tricks involved -

Other point - I actually am running the proxy directly on the UDM Pro as a docker container, using https://github.com/boostchicken/udm-utilities to make sure it starts reliably.

podman run -d --net=host --name ds2-cam-proxy -v "/etc/unifi-cam-proxy/ds2_client.pem:/client.pem" docker.io/keshavdv/unifi-cam-proxy unifi-cam-proxy --verbose --ip <camer ip> --host 127.0.0.1 --cert /client.pem --token <adoption token> rtsp --http-api 8211  -s rtsp://192.168.1.211:554/h264_stream
jkblm commented 3 years ago

@kraney Thank you for your input on the Control4 DS2 door station camera working in Unifi_Cam_Proxy (UCP). I will add this to the chart with your tips and tricks.

Very interesting that you are running UCP directly on the UDM-Pro. I guess that is why Unifi is releasing UDM Pro SE with larger eMMC to run applications onboard.

Thank you again for your input.

tsspmq commented 3 years ago

I bought 3 instants last week, never saw the 1 per user message. It "might" be because I wasn't logged in even thought I thought I was. I just happened to be getting a few items for parents house and saw them in stock a few different times and added to my order. The orders never showed up in my account but they still showed up at a my door.

This weekend they had domes, bullets and instants in stock on and off most of the weekend.

My unicorn is the Flex. Perfect for the spot I want it in.

tsspmq commented 3 years ago

Earlier I had mentioned I had issues with my Pi and tearing. Turns out it wasnt the Pi it was a switch having an issue. I've got 7 4K streams, 7 720p streams, and 7 D1 streams pulling in through my Pi via rtsp-simple-proxy. Frigate is still on my VM host for now.

jkblm commented 3 years ago

@tsspmq

I have Argon One case with 480GB SSD on the bottom. Nice case for the RBPi4B!

I was able to directly boot Raspberry Pi off the SSD. I was also able to boot Home Assistant/MQTT/Frigate image off the SSD. Helpful hints for booting off SSD and Frigate: https://www.youtube.com/watch?v=rLBdi8B5Wgk https://www.youtube.com/watch?v=n5vleh4ldEc https://www.youtube.com/watch?v=43E5bxuaVj4&t=1219s

What I have not been able to do successfully is run the unifi-cam-proxy on Home Assistant/MQTT/Frigate integration to show up in the Unifi Protect 1.9.0 UNVR/UDMP.

I have Hikvision cameras running great performance in the Rappbian O/S only with unifi-cam-proxy Unifi Protect 1.9.0 Hikvision (3 models) are the only cameras that I can get woking well with unifi-cam-proxy and Unifi Protect 1.9.0

ebo commented 3 years ago

I see a number of people running unifi-cam-proxy on RPi's and other computers, but is it possible, and sane, to run it on the USG or CloudKey (assuming that there is enough processing bandwidth)?

kraney commented 3 years ago

I can at least confirm that it works to run on a UDM-Pro. I believe USG is very similar hardware.

No apparent negative effects. My CPU usage is steady at about 45% and memory at about 70%. That's with one instance of the cam proxy, although I'm also running ntopng on there which is a much higher resource consumer than the cam proxy is. The contribution from cam proxy looks fairly negligible.

Nothing insane about it. It should save some network bandwidth since you won't have another second retransmitting the same video packets onto the network. It will just relay over loopback local to the device.

There's bound to be a limit on how many instances can be run, but I don't know what it is; I'm only running one. Seems like I could run several more with no issues, though.

ebo commented 3 years ago

Very good to know, and exactly what I figured. I will likely try this on a couple of mocked-up installations.

A couple of things to try is to prepend "nice" to the unifi-cam-proxy call. That way if you overtax it, the system will have priority and you will only get degraded video/delays instead of crashing the system.

Since this is written in Python-3, we can also look at using Numba to speed things up (if you have not already). I'll take a look into these things once I get a stable setup to play with -- I had it all running last night, and then tried adding SSH to my setup and borked everything... If anyone has some ideas how to reconnect everything after attempting to setting SSH on things and losing the maps, the monitor, and everything, but still having the system work and produce motion allerts...

PaulioArmani commented 2 years ago

I can confirm that a Control4 DS2 door station camera does work - which is actually just an OEM of a 2N IP Solo intercom. Two tricks involved -

  • I needed to enable audio in the video stream, otherwise unifi just spun forever without showing video. (It's not on by default)
  • I added the --http-api flag and added automation in the DS2 to call it on motion start/stop events.

Other point - I actually am running the proxy directly on the UDM Pro as a docker container, using https://github.com/boostchicken/udm-utilities to make sure it starts reliably.

podman run -d --net=host --name ds2-cam-proxy -v "/etc/unifi-cam-proxy/ds2_client.pem:/client.pem" docker.io/keshavdv/unifi-cam-proxy unifi-cam-proxy --verbose --ip <camer ip> --host 127.0.0.1 --cert /client.pem --token <adoption token> rtsp --http-api 8211  -s rtsp://192.168.1.211:554/h264_stream

Hi @kraney,

An chance you can elaborate a bit more on how --http-api was used to get motion events? I have an Axis camera working fine in Protect for full time recording but would love to be able to get motion evets. Is there any information avilable on how --http-api works? I didn't know it existed until I seen your post above.

Regards,

Paul

PaulioArmani commented 2 years ago

--http-api 8211

Actually, I looked at the code and worked out what I need to do. Adding this flag enables the http api on the cam proxy.

I then setup on my camera a start of motion event to hit http://:8211/start_motion and a stop motion event to hit http://:8211/stop_motion

Thanks for bringing this to my attention, this is exactly what I was looking for :)

Regards,

Paul

kraney commented 2 years ago

Glad you solved it already for yourself. That’s pretty much the path I followed, took a look in the code, saw the option and read how to use it from the code.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

EnDeRWiGiN commented 2 years ago

Something that is not clear is if the pan-tilt-zoom works on 3rd party cameras when using unifi cam proxy? You mentioned you were using the Hikvision PTZ. Are you able to use the Unifi pan tilt zoom controls that are meant for the Camera G4 PTZ?