PSA: unifi-cam-proxy docker. Bring non-Unifi cameras into Unifi Protect

Hi folks,
Absolutely NOT my work, but shout out to the dev (Sponsor here)
https://github.com/keshavdv/unifi-cam-proxy

Depending if you consolidate all your cams through a variety of methods or you prefer to have things grouped - I wanted to just point this docker out.

I add have added my non-Unifi cameras (Nanit, and a reolink) into Unifi Protect so that I can have one easy to manage integration with HA.
(Note Nanit needed scrypted to auth)

Could be useful for some, as I only just stumbled across it, so sharing as its super cool, and slick :slight_smile:

1 Like

It works well, but it has been broken for up-to-date protect versions for a while. I don’t know the current status, but the docker image (last I checked) is also many months out of date from the mainline branch.

i saw some folks having issue and moved to dev branch. Mine is running fine however

What version of protect are you on?

Unifi OS: 3.2.9
Protect: 2.1.11

good to know!

Hi jaburges, how did you manage to install Reolink on Unifi protect? I’m struggling for more than 3 days. I have UDM SE and Reolink 811a. I have been able to make token and to create client.pem certificate, but when I try to run it in docker, it’s showing me an error.

you need to add the unifi-cam-proxy command in the docker command (or Post Arguemts)

unifi-cam-proxy --host X.X.X.X --name Your Cam --model ‘UVC G3 Flex’ -c /client.pem -t rtsp -s rtsp://RTSPURL --snapshot-url “<url_to_snapshot_Image”

Hi jaburges, you mean here below like in picture? I’m sorry, but I can’t figure it out as I have never worked with docker :slight_smile:
In my docker-compose.yaml file I have command line with all the details, but it seams that is not working

Can you check if bellow settings on my Docker are correct?

That looks like the Synology UX - I’d suggest watching a few YouTube videos on synology docker.

I use Unraid now (had synology a long time ago) but the principle is the same. I seem to remember though with synology and more complex build your own dockers you had to use the command line/shell - someone familiar with synology can advise you where to put the command to run.

Yes, it’s a Synology NAS. I downloaded container, I have cient.pem file in docker folder together with docker-compose.yml but whenever I start docker container after few seconds is crashed. Do I need to change anything in compose file ( volumes:
- “./client.pem:/client.pem”) or add Mount path in Docker? I’m already crazy because of this :slight_smile:

What’s the error in the logs tab?

It’s always like this

so the log is telling you you aren’t running the command to instruct unifi-cam-proxy on what to do when it starts/runs.

Look for a setting that allows you to add a command to the docker when it starts in the Synology UX.

unifi-cam-proxy --host <YOUR_UNIFI_BOX_IP> --cert ./cert.pem --token --name <camera_name> etc etc

OK, after I spent almost a whole night to try to figure this out, I have made it possible to use the command that you mention. And I have camera added to Protect. :slight_smile:

But the problem is that I only see snapshot. I don’t see live video.

Any idea why?

Thanks in advance.

What is your command? (just X out sensitive info) but copy it exactly

“unifi-cam-proxy --host xxx.xxx.x.x --name Reolink --model ‘UVC G3’ --cert /client.pem --token xxxxxxxxxxxxxxxxxxxxxxxxx rtsp -s rtsp://xxxxx:[email protected]:554/h264Preview_01_main”

Ok
Error looked like it was from the client.pem part. Have you mapped the file you obtained from running the SSL script to the docker.
Something like this volume mapping in the synology GUI.
Volumes:
/path/to/file/client.pem:/client.pem

Also in advance have you checked with VLC or something else the RTSP stream worked

Yes, I have volume mapping. And I have checked in VLC, the stream is working.
What I think that the problem is, I need to use another command for Reolink camera.
On the unifi-camera-proxy it say that I need to use this command below. But command in that format don’t work in my Docker.

unifi-cam-proxy -H {NVR IP} -i {camera IP} -c /client.pem -t {Adoption token}
reolink
-u {username}
-p {password}
-s “main”
–ffmpeg-args=‘-c:v copy -bsf:v “h264_metadata=tick_rate=60000/1001” -ar 32000 -ac 1 -codec:a aac -b:a 32k’

its a brilliant project - unfortunately my streams crash all the time and the project seems to make little progress to getting it to work - I use the latest protect but it seems the issue is the actual stream generation towards protect - I tried direct, via frigate etc. no chance to get it stable