keshavdv / unifi-cam-proxy

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

Adding Unifi branded cameras #63

Closed martihnus closed 3 years ago

martihnus commented 3 years ago

Hi, trying to add UVC G3, UVC G2 and UVC Dome cameras to Unifi Video with unifi-cam-proxy. Unifi server and unifi-cam-proxy are running on win10 machine. Having issues adding remote UVC G3 to NVR decided to try this. Cameras show up in Unifi Video but don't record or show live feed. Tried changing rtsp stream from s0 to s1, deleting it altogether. Same behaviour in Unifi Video. Has anyone tried to add Unifi cameras? :D Attached log from cmd. Thanks for help.

> 
> C:\Windows\system32>unifi-cam-proxy --host 192.168.X.X --cert "C:\Users\User\Desktop\client.pem" --token generatedtoken rtsp -s rtsp://192.168.X.X:554/s1
> 2021-08-07 07:10:47 PC RTSPCam[14252] INFO Spawning stream for snapshots: ffmpeg -nostdin -y -re -rtsp_transport tcp -i "rtsp://192.168.X.X:554/s1" -vf fps=1 -update 1 C:\Users\User\AppData\Local\Temp\tmp7sd1a4cn/screen.jpg
> 2021-08-07 07:10:47 PC Core[14252] INFO Creating ws connection to wss://192.168.X.X:7442/camera/1.0/ws?token=generatedtoken
> 2021-08-07 07:10:47 PC RTSPCam[14252] INFO Adopting with token [generatedtoken] and mac [AABBCCDDEEFF]
> 2021-08-07 07:10:47 PC RTSPCam[14252] INFO Processing [ubnt_avclient_hello] message
> 2021-08-07 07:10:47 PC RTSPCam[14252] INFO Processing [ubnt_avclient_paramAgreement] message
> 2021-08-07 07:10:47 PC RTSPCam[14252] INFO Processing [ChangeVideoSettings] message
> 2021-08-07 07:10:47 PC RTSPCam[14252] INFO Processing [ChangeVideoSettings] message
> 2021-08-07 07:10:47 PC RTSPCam[14252] INFO Processing [ChangeIspSettings] message
> 2021-08-07 07:10:50 PC RTSPCam[14252] INFO Processing [ChangeIspSettings] message
> 2021-08-07 07:10:50 PC RTSPCam[14252] INFO Processing [ChangeDeviceSettings] message
> 2021-08-07 07:10:50 PC RTSPCam[14252] INFO Processing [ChangeOsdSettings] message
> 2021-08-07 07:10:50 PC RTSPCam[14252] INFO Processing [ChangeSoundLedSettings] message
> 2021-08-07 07:10:50 PC RTSPCam[14252] INFO Processing [ChangeAnalyticsSettings] message
> 2021-08-07 07:10:50 PC RTSPCam[14252] INFO Processing [NetworkStatus] message
> 2021-08-07 07:10:50 PC RTSPCam[14252] INFO Processing [ChangeVideoSettings] message
> 2021-08-07 07:10:50 PC RTSPCam[14252] INFO Spawning ffmpeg for video1 (8y3Yd_AABBCCDDEEFF_0): ffmpeg -nostdin -y -stimeout 15000000 -rtsp_transport tcp -i "rtsp://192.168.X.X:554/s1" -c:v copy -ar 32000 -ac 1 -codec:a aac -b:a 32k -metadata streamname=8y3Yd_AABBCCDDEEFF_0 -f flv - | c:\python39\python.exe -m unifi.clock_sync | nc 192.168.X.X 6666
> 2021-08-07 07:10:51 PC RTSPCam[14252] INFO Processing [GetRequest] message
> 2021-08-07 07:10:51 PC RTSPCam[14252] WARNING Snapshot file C:\Users\User\AppData\Local\Temp\tmp7sd1a4cn\screen.jpg is not ready yet, skipping upload
> 2021-08-07 07:10:56 PC RTSPCam[14252] INFO Processing [GetRequest] message
> 2021-08-07 07:10:56 PC RTSPCam[14252] WARNING Snapshot file C:\Users\User\AppData\Local\Temp\tmp7sd1a4cn\screen.jpg is not ready yet, skipping upload
> 2021-08-07 07:10:56 PC RTSPCam[14252] INFO Processing [ChangeVideoSettings] message
> 2021-08-07 07:10:56 PC RTSPCam[14252] INFO Spawning ffmpeg for video2 (V2P3N_AABBCCDDEEFF_1): ffmpeg -nostdin -y -stimeout 15000000 -rtsp_transport tcp -i "rtsp://192.168.X.X:554/s1" -c:v copy -ar 32000 -ac 1 -codec:a aac -b:a 32k -metadata streamname=V2P3N_AABBCCDDEEFF_1 -f flv - | c:\python39\python.exe -m unifi.clock_sync | nc 192.168.X.X 6666
> 2021-08-07 07:11:01 PC RTSPCam[14252] INFO Processing [ubnt_avclient_time] message
> 2021-08-07 07:11:01 PC RTSPCam[14252] INFO Processing [ChangeVideoSettings] message
> 2021-08-07 07:11:01 PC RTSPCam[14252] INFO Spawning ffmpeg for video1 (8y3Yd_AABBCCDDEEFF_0): ffmpeg -nostdin -y -stimeout 15000000 -rtsp_transport tcp -i "rtsp://192.168.X.X:554/s1" -c:v copy -ar 32000 -ac 1 -codec:a aac -b:a 32k -metadata streamname=8y3Yd_AABBCCDDEEFF_0 -f flv - | c:\python39\python.exe -m unifi.clock_sync | nc 192.168.X.X 6666
keshavdv commented 3 years ago

If you are using original Ubiquiti equipment, I'd probably suggest skipping this project and just using a raw TCP proxy on the appropriate ports for the best experience. The project has most recently focused a lot more on Protect so it's totally possible that the Unifi Video integration is now broken.

With that said, from your log output, it seems like you're trying to run this on Windows which has never been tested. I'd suggest using the Docker container from the docs instead of running it natively to make sure that all the required dependencies are available.

stale[bot] commented 3 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.