keshavdv / unifi-cam-proxy

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

Reolink 822a No Video #88

Closed osxster closed 2 years ago

osxster commented 3 years ago

Hello,

I just purchased a Reolink 822a Camera. Trying to fun this from a Mac, but I am also just reading now that there is no H265 implementation in Unifi Protect. Does anyone know what the correct options and or command line is to get an H264 stream out of the Reolink 822a camera? Or is that not the problem? I don't think it is a problem with the camera as I can connect to it via VLC using the same RTSP string.

The command line I am using is:

unifi-cam-proxy -H 192.168.Y.1 -i 192.168.Y.X -c client.pem -t tokengoeshere rtsp -s rtsp://unifi:unifi1@192.168.Y.X:554/h264Preview_01_sub --ffmpeg-args '-c:v copy -vbsf "h264_metadata=tick_rate=60000/1001:fixed_frame_rate_flag=1" -ar 32000 -ac 2 -codec:a aac -b:a 32k'

I am using the low res h264 url I read about on the Reolink support site thinking that maybe I would at least be able to get that working if there was an issue with h265.

unifi-cam-proxy -H 192.168.Y.1 -i 192.168.Y.X -c client.pem -t tokengoeshere rtsp -s rtsp://unifi:unifi1@192.168.Y.X:554/h264Preview_01_sub --ffmpeg-args '-c:v copy -vbsf "h264_metadata=tick_rate=60000/1001:fixed_frame_rate_flag=1" -ar 32000 -ac 2 -codec:a aac -b:a 32k' 2021-09-19 13:57:10 localhost RTSPCam[59165] INFO Spawning stream for snapshots: ffmpeg -nostdin -y -re -rtsp_transport tcp -i "rtsp://unifi:unifi1@192.168.Y.X:554/h264Preview_01_sub" -vf fps=1 -update 1 /var/folders/zq/mmp1d8xs4dn19_bbhlyckfg00000gn/T/tmpvmtmiltv/screen.jpg 2021-09-19 13:57:10 localhost Core[59165] INFO Creating ws connection to wss://192.168.Y.1:7442/camera/1.0/ws?token=tokengoeshere 2021-09-19 13:57:10 localhost RTSPCam[59165] INFO Adopting with token [tokengoeshere] and mac [AABBCCDDEEFF] 2021-09-19 13:57:10 localhost RTSPCam[59165] INFO Processing [ubnt_avclient_hello] message 2021-09-19 13:57:10 localhost RTSPCam[59165] INFO Processing [ubnt_avclient_hello] message 2021-09-19 13:57:10 localhost RTSPCam[59165] INFO Processing [ubnt_avclient_paramAgreement] message 2021-09-19 13:57:10 localhost RTSPCam[59165] INFO Processing [ubnt_avclient_paramAgreement] message 2021-09-19 13:57:10 localhost RTSPCam[59165] INFO Processing [StopService] message 2021-09-19 13:57:11 localhost RTSPCam[59165] INFO Processing [ChangeVideoSettings] message 2021-09-19 13:57:11 localhost RTSPCam[59165] INFO Spawning ffmpeg for video1 (RepnEbI60ZS4ePNi): ffmpeg -nostdin -y -stimeout 15000000 -rtsp_transport tcp -i "rtsp://unifi:unifi1@192.168.Y.X:554/h264Preview_01_sub" -c:v copy -vbsf "h264_metadata=tick_rate=60000/1001:fixed_frame_rate_flag=1" -ar 32000 -ac 2 -codec:a aac -b:a 32k -metadata streamname=RepnEbI60ZS4ePNi -f flv - | /usr/local/opt/python@3.9/bin/python3.9 -m unifi.clock_sync | nc 192.168.Y.1 7550 2021-09-19 13:57:11 localhost RTSPCam[59165] INFO Processing [ChangeVideoSettings] message 2021-09-19 13:57:11 localhost RTSPCam[59165] INFO Spawning ffmpeg for video2 (fFa746DOraNdNgpw): ffmpeg -nostdin -y -stimeout 15000000 -rtsp_transport tcp -i "rtsp://unifi:unifi1@192.168.Y.X:554/h264Preview_01_sub" -c:v copy -vbsf "h264_metadata=tick_rate=60000/1001:fixed_frame_rate_flag=1" -ar 32000 -ac 2 -codec:a aac -b:a 32k -metadata streamname=fFa746DOraNdNgpw -f flv - | /usr/local/opt/python@3.9/bin/python3.9 -m unifi.clock_sync | nc 192.168.Y.1 7550 2021-09-19 13:57:11 localhost RTSPCam[59165] INFO Processing [ChangeVideoSettings] message 2021-09-19 13:57:11 localhost RTSPCam[59165] INFO Spawning ffmpeg for video3 (cAJMr4rlhtmYfbm5): ffmpeg -nostdin -y -stimeout 15000000 -rtsp_transport tcp -i "rtsp://unifi:unifi1@192.168.Y.X:554/h264Preview_01_sub" -c:v copy -vbsf "h264_metadata=tick_rate=60000/1001:fixed_frame_rate_flag=1" -ar 32000 -ac 2 -codec:a aac -b:a 32k -metadata streamname=cAJMr4rlhtmYfbm5 -f flv - | /usr/local/opt/python@3.9/bin/python3.9 -m unifi.clock_sync | nc 192.168.Y.1 7550 2021-09-19 13:57:11 localhost RTSPCam[59165] INFO Processing [UpdateFirmwareRequest] message 2021-09-19 13:57:11 localhost RTSPCam[59165] INFO Reconnecting... 2021-09-19 13:57:11 localhost RTSPCam[59165] INFO Cleaning up instance 2021-09-19 13:57:11 localhost RTSPCam[59165] INFO Stopping stream video1 2021-09-19 13:57:11 localhost RTSPCam[59165] INFO Stopping stream video2 2021-09-19 13:57:11 localhost RTSPCam[59165] INFO Stopping stream video3 2021-09-19 13:57:11 localhost Core[59165] INFO Backing off connect(...) for 2.0s (True) 2021-09-19 13:57:13 localhost Core[59165] INFO Creating ws connection to wss://192.168.Y.1:7442/camera/1.0/ws?token=tokengoeshere 2021-09-19 13:57:13 localhost RTSPCam[59165] INFO Adopting with token [tokengoeshere] and mac [AABBCCDDEEFF] 2021-09-19 13:57:13 localhost RTSPCam[59165] INFO Processing [ubnt_avclient_hello] message 2021-09-19 13:57:13 localhost RTSPCam[59165] INFO Processing [ubnt_avclient_hello] message 2021-09-19 13:57:14 localhost RTSPCam[59165] INFO Processing [ubnt_avclient_paramAgreement] message 2021-09-19 13:57:14 localhost RTSPCam[59165] INFO Processing [StopService] message 2021-09-19 13:57:14 localhost RTSPCam[59165] INFO Processing [ubnt_avclient_paramAgreement] message 2021-09-19 13:57:14 localhost RTSPCam[59165] INFO Processing [ChangeDeviceSettings] message 2021-09-19 13:57:15 localhost RTSPCam[59165] INFO Processing [NetworkStatus] message 2021-09-19 13:57:15 localhost RTSPCam[59165] INFO Processing [GetSystemStats] message 2021-09-19 13:57:15 localhost RTSPCam[59165] INFO Processing [GetRequest] message 2021-09-19 13:57:15 localhost RTSPCam[59165] INFO Spawning stream for snapshots: ffmpeg -nostdin -y -re -rtsp_transport tcp -i "rtsp://unifi:unifi1@192.168.Y.X:554/h264Preview_01_sub" -vf fps=1 -update 1 /var/folders/zq/mmp1d8xs4dn19_bbhlyckfg00000gn/T/tmpvmtmiltv/screen.jpg 2021-09-19 13:57:15 localhost RTSPCam[59165] WARNING Snapshot file /var/folders/zq/mmp1d8xs4dn19_bbhlyckfg00000gn/T/tmpvmtmiltv/screen.jpg is not ready yet, skipping upload 2021-09-19 13:57:17 localhost RTSPCam[59165] INFO Processing [GetSystemStats] message 2021-09-19 13:57:17 localhost RTSPCam[59165] INFO Processing [NetworkStatus] message 2021-09-19 13:57:20 localhost RTSPCam[59165] INFO Processing [ChangeIspSettings] message 2021-09-19 13:57:20 localhost RTSPCam[59165] INFO Processing [ChangeOsdSettings] message 2021-09-19 13:57:20 localhost RTSPCam[59165] INFO Processing [ChangeSoundLedSettings] message 2021-09-19 13:57:20 localhost RTSPCam[59165] INFO Processing [ChangeVideoSettings] message 2021-09-19 13:57:20 localhost RTSPCam[59165] INFO Processing [ChangeSmartMotionSettings] message 2021-09-19 13:57:20 localhost RTSPCam[59165] INFO Processing [EnableLogging] message 2021-09-19 13:57:20 localhost RTSPCam[59165] INFO Processing [ChangeDeviceSettings] message 2021-09-19 13:57:20 localhost RTSPCam[59165] INFO Processing [ChangeDeviceSettings] message 2021-09-19 13:57:20 localhost RTSPCam[59165] INFO Processing [SmartMotionTest] message 2021-09-19 13:57:20 localhost RTSPCam[59165] INFO Processing [ChangeVideoSettings] message 2021-09-19 13:57:20 localhost RTSPCam[59165] INFO Processing [UpdateUsernamePassword] message 2021-09-19 13:57:20 localhost RTSPCam[59165] INFO Processing [ChangeVideoSettings] message 2021-09-19 13:57:21 localhost RTSPCam[59165] INFO Processing [ChangeVideoSettings] message 2021-09-19 13:57:21 localhost RTSPCam[59165] INFO Spawning ffmpeg for video2 (fFa746DOraNdNgpw): ffmpeg -nostdin -y -stimeout 15000000 -rtsp_transport tcp -i "rtsp://unifi:unifi1@192.168.Y.X:554/h264Preview_01_sub" -c:v copy -vbsf "h264_metadata=tick_rate=60000/1001:fixed_frame_rate_flag=1" -ar 32000 -ac 2 -codec:a aac -b:a 32k -metadata streamname=fFa746DOraNdNgpw -f flv - | /usr/local/opt/python@3.9/bin/python3.9 -m unifi.clock_sync | nc 192.168.Y.1 7550 2021-09-19 13:57:27 localhost RTSPCam[59165] INFO Processing [GetSystemStats] message 2021-09-19 13:57:27 localhost RTSPCam[59165] INFO Processing [NetworkStatus] message 2021-09-19 13:57:31 localhost RTSPCam[59165] INFO Processing [ChangeVideoSettings] message 2021-09-19 13:57:31 localhost RTSPCam[59165] INFO Spawning ffmpeg for video1 (RepnEbI60ZS4ePNi): ffmpeg -nostdin -y -stimeout 15000000 -rtsp_transport tcp -i "rtsp://unifi:unifi1@192.168.Y.X:554/h264Preview_01_sub" -c:v copy -vbsf "h264_metadata=tick_rate=60000/1001:fixed_frame_rate_flag=1" -ar 32000 -ac 2 -codec:a aac -b:a 32k -metadata streamname=RepnEbI60ZS4ePNi -f flv - | /usr/local/opt/python@3.9/bin/python3.9 -m unifi.clock_sync | nc 192.168.Y.1 7550 2021-09-19 13:57:31 localhost RTSPCam[59165] INFO Processing [ChangeVideoSettings] message 2021-09-19 13:57:31 localhost RTSPCam[59165] INFO Spawning ffmpeg for video3 (cAJMr4rlhtmYfbm5): ffmpeg -nostdin -y -stimeout 15000000 -rtsp_transport tcp -i "rtsp://unifi:unifi1@192.168.Y.X:554/h264Preview_01_sub" -c:v copy -vbsf "h264_metadata=tick_rate=60000/1001:fixed_frame_rate_flag=1" -ar 32000 -ac 2 -codec:a aac -b:a 32k -metadata streamname=cAJMr4rlhtmYfbm5 -f flv - | /usr/local/opt/python@3.9/bin/python3.9 -m unifi.clock_sync | nc 192.168.Y.1 7550 2021-09-19 13:57:33 localhost RTSPCam[59165] INFO Processing [ChangeVideoSettings] message 2021-09-19 13:57:33 localhost RTSPCam[59165] INFO Spawning ffmpeg for video2 (fFa746DOraNdNgpw): ffmpeg -nostdin -y -stimeout 15000000 -rtsp_transport tcp -i "rtsp://unifi:unifi1@192.168.Y.X:554/h264Preview_01_sub" -c:v copy -vbsf "h264_metadata=tick_rate=60000/1001:fixed_frame_rate_flag=1" -ar 32000 -ac 2 -codec:a aac -b:a 32k -metadata streamname=fFa746DOraNdNgpw -f flv - | /usr/local/opt/python@3.9/bin/python3.9 -m unifi.clock_sync | nc 192.168.Y.1 7550 2021-09-19 13:57:37 localhost RTSPCam[59165] INFO Processing [GetSystemStats] message 2021-09-19 13:57:37 localhost RTSPCam[59165] INFO Processing [NetworkStatus] message 2021-09-19 13:57:46 localhost RTSPCam[59165] INFO Processing [ChangeVideoSettings] message 2021-09-19 13:57:46 localhost RTSPCam[59165] INFO Spawning ffmpeg for video2 (fFa746DOraNdNgpw): ffmpeg -nostdin -y -stimeout 15000000 -rtsp_transport tcp -i "rtsp://unifi:unifi1@192.168.Y.X:554/h264Preview_01_sub" -c:v copy -vbsf "h264_metadata=tick_rate=60000/1001:fixed_frame_rate_flag=1" -ar 32000 -ac 2 -codec:a aac -b:a 32k -metadata streamname=fFa746DOraNdNgpw -f flv - | /usr/local/opt/python@3.9/bin/python3.9 -m unifi.clock_sync | nc 192.168.Y.1 7550 2021-09-19 13:57:46 localhost RTSPCam[59165] INFO Processing [ChangeVideoSettings] message 2021-09-19 13:57:46 localhost RTSPCam[59165] INFO Spawning ffmpeg for video1 (RepnEbI60ZS4ePNi): ffmpeg -nostdin -y -stimeout 15000000 -rtsp_transport tcp -i "rtsp://unifi:unifi1@192.168.Y.X:554/h264Preview_01_sub" -c:v copy -vbsf "h264_metadata=tick_rate=60000/1001:fixed_frame_rate_flag=1" -ar 32000 -ac 2 -codec:a aac -b:a 32k -metadata streamname=RepnEbI60ZS4ePNi -f flv - | /usr/local/opt/python@3.9/bin/python3.9 -m unifi.clock_sync | nc 192.168.Y.1 7550 2021-09-19 13:57:46 localhost RTSPCam[59165] INFO Processing [ChangeVideoSettings] message 2021-09-19 13:57:46 localhost RTSPCam[59165] INFO Spawning ffmpeg for video3 (cAJMr4rlhtmYfbm5): ffmpeg -nostdin -y -stimeout 15000000 -rtsp_transport tcp -i "rtsp://unifi:unifi1@192.168.Y.X:554/h264Preview_01_sub" -c:v copy -vbsf "h264_metadata=tick_rate=60000/1001:fixed_frame_rate_flag=1" -ar 32000 -ac 2 -codec:a aac -b:a 32k -metadata streamname=cAJMr4rlhtmYfbm5 -f flv - | /usr/local/opt/python@3.9/bin/python3.9 -m unifi.clock_sync | nc 192.168.Y.1 7550

If there is more debug you need, please let me know and how to produce it.

GhostlyCrowd commented 3 years ago

This is the same issue i am having it worked on the mobile app and was recording once, then i shut it down never to work again, all it does it keep respawning the video 1-3 streams now over and over

prismsky commented 3 years ago

Based on the specs, it seems like this camera is h.265 only. Unifi Protect doesn't support h.265, so unless you transcode, I don't think it would be possible.

I had to return my 810a because the only codec for main stream that it supported was h.265.

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.