keshavdv / unifi-cam-proxy

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

Streaming is not working #333

Closed bashmail closed 6 months ago

bashmail commented 10 months ago

Camera

Hikvision DS-2CD1043G0-I

Firmware version of the camera

V5.5.88 build 200610

Description

I have configured 5 cameras proxy in docker. UniFi Protect on UCK Gen2 Plus detected the cameras as G3 Bullet and auto adopted all 5 cameras. The problem is Streaming is not working neither video is updating. The picture is stuck when the cameras were adopted in Protect.

UniFi Protect 2.8.35 UCK-G2-Plus UniFi OS 3.1.16

Here is my docker-compose file

version: "3.5" services: proxy-1: restart: unless-stopped image: keshavdv/unifi-cam-proxy volumes:

How to reproduce

No response

Expected behaviour

the live stream should work

Screenshots

Screenshot 2023-09-08 015029 Screenshot 2023-09-08 015014 Screenshot 2023-09-08 015006

Aditional information

No response

jhavens12 commented 9 months ago

Same for me - the cameras get adopted but only show a screenshot of when they got adopted

jaszcz0mp commented 9 months ago

Same problem - DS-2CD1047G0-L shows only snapshot in terminal (bare metal installation)

XXX@ex-ubu:~/.local/bin$ sudo unifi-cam-proxy --mac 'XX:XX:XX:XX:XX:XX' -H 192.168.10.9 -i 192.168.10.54 -c /home/XXX/unificamproxy/client.pem -t dYS9gZXt4BrCzQ6SyFeRqR0A917BtNyJ hikvision -u unifi -p XXX [sudo] password for XXX: We renamed asyncio-mqtt to aiomqtt and released a version 1.0.0 in the process. This is the last release under the asyncio-mqtt name. You can find the new repository at https://github.com/sbtinstruments/aiomqtt 2023-09-20 19:33:14 ex-ubu Core[2926] INFO Creating ws connection to wss://192.168.10.9:7442/camera/1.0/ws?token=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 2023-09-20 19:33:14 ex-ubu HikvisionCam[2926] INFO Adopting with token [dYS9gZXt4BrCzQ6SyFeRqR0A917BtNyJ] and mac [08:a1:89:d8:30:76] 2023-09-20 19:33:14 ex-ubu HikvisionCam[2926] INFO Processing [ubnt_avclient_hello] message 2023-09-20 19:33:14 ex-ubu HikvisionCam[2926] INFO Processing [ubnt_avclient_paramAgreement] message 2023-09-20 19:33:15 ex-ubu HikvisionCam[2926] INFO Processing [StopService] message 2023-09-20 19:33:15 ex-ubu HikvisionCam[2926] INFO Processing [ChangeVideoSettings] message ffmpeg version 4.4.2-0ubuntu0.22.04.1 Copyright (c) 2000-2021 the FFmpeg developers built with gcc 11 (Ubuntu 11.2.0-19ubuntu1) configuration: --prefix=/usr --extra-version=0ubuntu0.22.04.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-pocketsphinx --enable-librsvg --enable-libmfx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared libavutil 56. 70.100 / 56. 70.100 libavcodec 58.134.100 / 58.134.100 libavformat 58. 76.100 / 58. 76.100 libavdevice 58. 13.100 / 58. 13.100 libavfilter 7.110.100 / 7.110.100 libswscale 5. 9.100 / 5. 9.100 libswresample 3. 9.100 / 3. 9.100 libpostproc 55. 9.100 / 55. 9.100 2023-09-20 19:33:15 ex-ubu HikvisionCam[2926] INFO Spawning ffmpeg for video2 (owa2HvMxdfIadgrb): ffmpeg -nostdin -loglevel error -y -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -stimeout 15000000 -rtsp_transport tcp -i "rtsp://unifi:XXX@192.168.10.54:554/Streaming/Channels/103/" -c:v copy -ar 32000 -ac 1 -codec:a aac -b:a 32k -metadata streamname=owa2HvMxdfIadgrb -f flv - | /usr/bin/python3 -m unifi.clock_sync | nc 192.168.10.9 7550 2023-09-20 19:33:15 ex-ubu HikvisionCam[2926] INFO Processing [ubnt_avclient_hello] message 2023-09-20 19:33:15 ex-ubu HikvisionCam[2926] INFO Processing [ChangeVideoSettings] message ffmpeg version 4.4.2-0ubuntu0.22.04.1 Copyright (c) 2000-2021 the FFmpeg developers built with gcc 11 (Ubuntu 11.2.0-19ubuntu1) configuration: --prefix=/usr --extra-version=0ubuntu0.22.04.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-pocketsphinx --enable-librsvg --enable-libmfx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared libavutil 56. 70.100 / 56. 70.100 libavcodec 58.134.100 / 58.134.100 libavformat 58. 76.100 / 58. 76.100 libavdevice 58. 13.100 / 58. 13.100 libavfilter 7.110.100 / 7.110.100 libswscale 5. 9.100 / 5. 9.100 libswresample 3. 9.100 / 3. 9.100 libpostproc 55. 9.100 / 55. 9.100 [tcp @ 0x55ac2bde7b00] Port missing in uri rtsp://unifi:XXX@192.168.10.54:554/Streaming/Channels/103/: Invalid argument 2023-09-20 19:33:15 ex-ubu HikvisionCam[2926] INFO Spawning ffmpeg for video1 (nYjo4ExuZKTYfVJo): ffmpeg -nostdin -loglevel error -y -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -stimeout 15000000 -rtsp_transport tcp -i "rtsp://unifi:XXX@192.168.10.54:554/Streaming/Channels/101/" -c:v copy -ar 32000 -ac 1 -codec:a aac -b:a 32k -metadata streamname=nYjo4ExuZKTYfVJo -f flv - | /usr/bin/python3 -m unifi.clock_sync | nc 192.168.10.9 7550 2023-09-20 19:33:15 ex-ubu HikvisionCam[2926] INFO Processing [ChangeVideoSettings] message [tcp @ 0x5629258a6b00] Port missing in uri rtsp://unifi:XXX@192.168.10.54:554/Streaming/Channels/101/: Invalid argument ffmpeg version 4.4.2-0ubuntu0.22.04.1 Copyright (c) 2000-2021 the FFmpeg developers built with gcc 11 (Ubuntu 11.2.0-19ubuntu1) configuration: --prefix=/usr --extra-version=0ubuntu0.22.04.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-pocketsphinx --enable-librsvg --enable-libmfx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared libavutil 56. 70.100 / 56. 70.100 libavcodec 58.134.100 / 58.134.100 libavformat 58. 76.100 / 58. 76.100 libavdevice 58. 13.100 / 58. 13.100 libavfilter 7.110.100 / 7.110.100 libswscale 5. 9.100 / 5. 9.100 libswresample 3. 9.100 / 3. 9.100 libpostproc 55. 9.100 / 55. 9.100 2023-09-20 19:33:15 ex-ubu HikvisionCam[2926] INFO Spawning ffmpeg for video3 (FW2YWi64AsagIEgp): ffmpeg -nostdin -loglevel error -y -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -stimeout 15000000 -rtsp_transport tcp -i "rtsp://unifi:XXX@192.168.10.54:554/Streaming/Channels/103/" -c:v copy -ar 32000 -ac 1 -codec:a aac -b:a 32k -metadata streamname=FW2YWi64AsagIEgp -f flv - | /usr/bin/python3 -m unifi.clock_sync | nc 192.168.10.9 7550 2023-09-20 19:33:15 ex-ubu HikvisionCam[2926] INFO Processing [ubnt_avclient_paramAgreement] message 2023-09-20 19:33:15 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API [tcp @ 0x55ea4870ab00] Port missing in uri rtsp://unifi:XXX@192.168.10.54:554/Streaming/Channels/103/: Invalid argument 2023-09-20 19:33:15 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:15 ex-ubu HikvisionCam[2926] INFO Processing [UpdateFirmwareRequest] message 2023-09-20 19:33:15 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:16 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:16 ex-ubu HikvisionCam[2926] INFO Reconnecting... 2023-09-20 19:33:16 ex-ubu HikvisionCam[2926] INFO Cleaning up instance 2023-09-20 19:33:16 ex-ubu HikvisionCam[2926] INFO Stopping stream video2 2023-09-20 19:33:16 ex-ubu HikvisionCam[2926] INFO Stopping stream video1 2023-09-20 19:33:16 ex-ubu HikvisionCam[2926] INFO Stopping stream video3 2023-09-20 19:33:16 ex-ubu Core[2926] INFO Backing off connect(...) for 2.0s (True) 2023-09-20 19:33:18 ex-ubu Core[2926] INFO Creating ws connection to wss://192.168.10.9:7442/camera/1.0/ws?token=dYS9gZXt4BrCzQ6SyFeRqR0A917BtNyJ 2023-09-20 19:33:18 ex-ubu HikvisionCam[2926] INFO Adopting with token [dYS9gZXt4BrCzQ6SyFeRqR0A917BtNyJ] and mac [08:a1:89:d8:30:76] 2023-09-20 19:33:18 ex-ubu HikvisionCam[2926] INFO Processing [ubnt_avclient_hello] message 2023-09-20 19:33:18 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:18 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:18 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:18 ex-ubu HikvisionCam[2926] INFO Processing [ubnt_avclient_paramAgreement] message 2023-09-20 19:33:18 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:19 ex-ubu HikvisionCam[2926] INFO Processing [StopService] message 2023-09-20 19:33:19 ex-ubu HikvisionCam[2926] INFO Processing [ubnt_avclient_hello] message 2023-09-20 19:33:19 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:19 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:19 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:19 ex-ubu HikvisionCam[2926] INFO Processing [ubnt_avclient_paramAgreement] message 2023-09-20 19:33:19 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:19 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:19 ex-ubu HikvisionCam[2926] INFO Processing [ChangeVideoSettings] message 2023-09-20 19:33:19 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:20 ex-ubu HikvisionCam[2926] INFO Processing [ChangeDeviceSettings] message 2023-09-20 19:33:20 ex-ubu HikvisionCam[2926] INFO Processing [NetworkStatus] message 2023-09-20 19:33:20 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:20 ex-ubu HikvisionCam[2926] INFO Processing [GetSystemStats] message 2023-09-20 19:33:20 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:20 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:20 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:20 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:20 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:21 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:21 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:21 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:21 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:21 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:21 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:22 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:22 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:22 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:22 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:22 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:22 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:22 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:23 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:23 ex-ubu HikvisionCam[2926] INFO Processing [NetworkStatus] message 2023-09-20 19:33:23 ex-ubu HikvisionCam[2926] INFO Processing [GetSystemStats] message 2023-09-20 19:33:23 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:23 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:23 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:23 ex-ubu HikvisionCam[2926] INFO Processing [GetRequest] message 2023-09-20 19:33:23 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:24 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:24 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:24 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:24 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:24 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:24 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:24 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:25 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:25 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:25 ex-ubu HikvisionCam[2926] INFO Processing [ChangeIspSettings] message 2023-09-20 19:33:25 ex-ubu HikvisionCam[2926] INFO Processing [ChangeOsdSettings] message 2023-09-20 19:33:25 ex-ubu HikvisionCam[2926] INFO Processing [ChangeAudioEventsSettings] message 2023-09-20 19:33:25 ex-ubu HikvisionCam[2926] INFO Processing [ChangeSoundLedSettings] message 2023-09-20 19:33:25 ex-ubu HikvisionCam[2926] INFO Processing [ChangeVideoSettings] message 2023-09-20 19:33:25 ex-ubu HikvisionCam[2926] INFO Processing [ChangeSmartMotionSettings] message 2023-09-20 19:33:25 ex-ubu HikvisionCam[2926] INFO Processing [EnableLogging] message 2023-09-20 19:33:25 ex-ubu HikvisionCam[2926] INFO Processing [ChangeDeviceSettings] message 2023-09-20 19:33:25 ex-ubu HikvisionCam[2926] INFO Processing [ChangeDeviceSettings] message 2023-09-20 19:33:25 ex-ubu HikvisionCam[2926] INFO Processing [SmartMotionTest] message 2023-09-20 19:33:25 ex-ubu HikvisionCam[2926] INFO Processing [ChangeVideoSettings] message 2023-09-20 19:33:25 ex-ubu HikvisionCam[2926] INFO Processing [UpdateUsernamePassword] message 2023-09-20 19:33:25 ex-ubu HikvisionCam[2926] INFO Processing [ChangeVideoSettings] message 2023-09-20 19:33:25 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:25 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:25 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:25 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:26 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:26 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:26 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:26 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:26 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:26 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:27 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:27 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:27 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:27 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:27 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:27 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:27 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:28 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:28 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:28 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:28 ex-ubu HikvisionCam[2926] INFO Processing [ChangeVideoSettings] message ffmpeg version 4.4.2-0ubuntu0.22.04.1 Copyright (c) 2000-2021 the FFmpeg developers built with gcc 11 (Ubuntu 11.2.0-19ubuntu1) configuration: --prefix=/usr --extra-version=0ubuntu0.22.04.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-pocketsphinx --enable-librsvg --enable-libmfx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared libavutil 56. 70.100 / 56. 70.100 libavcodec 58.134.100 / 58.134.100 libavformat 58. 76.100 / 58. 76.100 libavdevice 58. 13.100 / 58. 13.100 libavfilter 7.110.100 / 7.110.100 libswscale 5. 9.100 / 5. 9.100 libswresample 3. 9.100 / 3. 9.100 libpostproc 55. 9.100 / 55. 9.100 2023-09-20 19:33:28 ex-ubu HikvisionCam[2926] WARNING Previous ffmpeg process for video1 died. 2023-09-20 19:33:28 ex-ubu HikvisionCam[2926] INFO Spawning ffmpeg for video1 (nYjo4ExuZKTYfVJo): ffmpeg -nostdin -loglevel error -y -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -stimeout 15000000 -rtsp_transport tcp -i "rtsp://unifi:XXX@192.168.10.54:554/Streaming/Channels/101/" -c:v copy -ar 32000 -ac 1 -codec:a aac -b:a 32k -metadata streamname=nYjo4ExuZKTYfVJo -f flv - | /usr/bin/python3 -m unifi.clock_sync | nc 192.168.10.9 7550 2023-09-20 19:33:28 ex-ubu HikvisionCam[2926] INFO Processing [ChangeVideoSettings] message ffmpeg version 4.4.2-0ubuntu0.22.04.1 Copyright (c) 2000-2021 the FFmpeg developers built with gcc 11 (Ubuntu 11.2.0-19ubuntu1) configuration: --prefix=/usr --extra-version=0ubuntu0.22.04.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-pocketsphinx --enable-librsvg --enable-libmfx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared libavutil 56. 70.100 / 56. 70.100 libavcodec 58.134.100 / 58.134.100 libavformat 58. 76.100 / 58. 76.100 libavdevice 58. 13.100 / 58. 13.100 libavfilter 7.110.100 / 7.110.100 libswscale 5. 9.100 / 5. 9.100 libswresample 3. 9.100 / 3. 9.100 libpostproc 55. 9.100 / 55. 9.100 [tcp @ 0x556d0de79b00] Port missing in uri rtsp://unifi:XXX@192.168.10.54:554/Streaming/Channels/101/: Invalid argument 2023-09-20 19:33:28 ex-ubu HikvisionCam[2926] WARNING Previous ffmpeg process for video3 died. 2023-09-20 19:33:28 ex-ubu HikvisionCam[2926] INFO Spawning ffmpeg for video3 (FW2YWi64AsagIEgp): ffmpeg -nostdin -loglevel error -y -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -stimeout 15000000 -rtsp_transport tcp -i "rtsp://unifi:XXX@192.168.10.54:554/Streaming/Channels/103/" -c:v copy -ar 32000 -ac 1 -codec:a aac -b:a 32k -metadata streamname=FW2YWi64AsagIEgp -f flv - | /usr/bin/python3 -m unifi.clock_sync | nc 192.168.10.9 7550 2023-09-20 19:33:28 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API [tcp @ 0x55ccc4dfdb00] Port missing in uri rtsp://unifi:XXX@192.168.10.54:554/Streaming/Channels/103/: Invalid argument 2023-09-20 19:33:29 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:29 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:29 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:29 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:29 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:29 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:30 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:30 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:30 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:30 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:30 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:30 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:30 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:31 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:31 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:31 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:31 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:31 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:31 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:32 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:32 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:32 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:32 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:32 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:32 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:33 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:33 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:33 ex-ubu HikvisionCam[2926] INFO Processing [NetworkStatus] message 2023-09-20 19:33:33 ex-ubu HikvisionCam[2926] INFO Processing [GetSystemStats] message 2023-09-20 19:33:33 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:33 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:33 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:33 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:33 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:34 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:34 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:34 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:34 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:34 ex-ubu HikvisionCam[2926] INFO Processing [GetRequest] message 2023-09-20 19:33:34 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:35 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:35 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:35 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:35 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:35 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:35 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:35 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:36 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:36 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:36 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:36 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:36 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:36 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:37 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:37 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:37 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:37 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:37 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:37 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:38 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:38 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:38 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:38 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:38 ex-ubu HikvisionCam[2926] INFO Processing [ChangeVideoSettings] message ffmpeg version 4.4.2-0ubuntu0.22.04.1 Copyright (c) 2000-2021 the FFmpeg developers built with gcc 11 (Ubuntu 11.2.0-19ubuntu1) configuration: --prefix=/usr --extra-version=0ubuntu0.22.04.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-pocketsphinx --enable-librsvg --enable-libmfx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared libavutil 56. 70.100 / 56. 70.100 libavcodec 58.134.100 / 58.134.100 libavformat 58. 76.100 / 58. 76.100 libavdevice 58. 13.100 / 58. 13.100 libavfilter 7.110.100 / 7.110.100 libswscale 5. 9.100 / 5. 9.100 libswresample 3. 9.100 / 3. 9.100 libpostproc 55. 9.100 / 55. 9.100 2023-09-20 19:33:38 ex-ubu HikvisionCam[2926] WARNING Previous ffmpeg process for video2 died. 2023-09-20 19:33:38 ex-ubu HikvisionCam[2926] INFO Spawning ffmpeg for video2 (owa2HvMxdfIadgrb): ffmpeg -nostdin -loglevel error -y -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -stimeout 15000000 -rtsp_transport tcp -i "rtsp://unifi:XXX@192.168.10.54:554/Streaming/Channels/103/" -c:v copy -ar 32000 -ac 1 -codec:a aac -b:a 32k -metadata streamname=owa2HvMxdfIadgrb -f flv - | /usr/bin/python3 -m unifi.clock_sync | nc 192.168.10.9 7550 2023-09-20 19:33:38 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API [tcp @ 0x55ea2a55cb00] Port missing in uri rtsp://unifi:XXX@192.168.10.54:554/Streaming/Channels/103/: Invalid argument 2023-09-20 19:33:39 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:39 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:39 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:39 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:39 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:39 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:39 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:40 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:40 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:40 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:40 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:40 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:40 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:41 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:41 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:41 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:41 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:41 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:41 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:42 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:42 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:42 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:42 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:42 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:42 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:42 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:43 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:43 ex-ubu HikvisionCam[2926] INFO Processing [NetworkStatus] message 2023-09-20 19:33:43 ex-ubu HikvisionCam[2926] INFO Processing [GetSystemStats] message 2023-09-20 19:33:43 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:43 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:43 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API 2023-09-20 19:33:43 ex-ubu HikvisionCam[2926] INFO Connecting to motion events API ^CTraceback (most recent call last): File "/usr/local/bin/unifi-cam-proxy", line 8, in <module> sys.exit(main()) File "/usr/local/lib/python3.10/dist-packages/unifi/main.py", line 119, in main loop.run_until_complete(c.run()) File "/usr/lib/python3.10/asyncio/base_events.py", line 636, in run_until_complete self.run_forever() File "/usr/lib/python3.10/asyncio/base_events.py", line 603, in run_forever self._run_once() File "/usr/lib/python3.10/asyncio/base_events.py", line 1909, in _run_once handle._run() File "/usr/lib/python3.10/asyncio/events.py", line 80, in _run self._context.run(self._callback, *self._args) File "/usr/local/lib/python3.10/dist-packages/unifi/cams/hikvision.py", line 127, in run async for event in self.cam.Event.notification.alertStream( File "/usr/local/lib/python3.10/dist-packages/hikvisionapi/hikvisionapi.py", line 261, in stream_request async with httpx.AsyncClient(auth=self._auth_method) as client: File "/usr/local/lib/python3.10/dist-packages/httpx/_client.py", line 1397, in __init__ self._transport = self._init_transport( File "/usr/local/lib/python3.10/dist-packages/httpx/_client.py", line 1445, in _init_transport return AsyncHTTPTransport( File "/usr/local/lib/python3.10/dist-packages/httpx/_transports/default.py", line 272, in __init__ ssl_context = create_ssl_context(verify=verify, cert=cert, trust_env=trust_env) File "/usr/local/lib/python3.10/dist-packages/httpx/_config.py", line 52, in create_ssl_context return SSLConfig( File "/usr/local/lib/python3.10/dist-packages/httpx/_config.py", line 76, in __init__ self.ssl_context = self.load_ssl_context() File "/usr/local/lib/python3.10/dist-packages/httpx/_config.py", line 88, in load_ssl_context return self.load_ssl_context_verify() File "/usr/local/lib/python3.10/dist-packages/httpx/_config.py", line 147, in load_ssl_context_verify context.load_verify_locations(cafile=cafile) KeyboardInterrupt 2023-09-20 19:33:43 ex-ubu HikvisionCam[2926] INFO Stopping stream video2 2023-09-20 19:33:43 ex-ubu HikvisionCam[2926] INFO Stopping stream video1 2023-09-20 19:33:43 ex-ubu HikvisionCam[2926] INFO Stopping stream video3

FialaDavid commented 9 months ago

Try the dev branch. I can get them to work with the following. Also by providing Protect user credentials, you can generate the adoption tokens automatically with the dev branch.

services:
  proxy-1:
    image: keshavdv/unifi-cam-proxy:dev
    volumes:
      - "/Users/user/docker/unifi-cam-proxy/client.pem:/client.pem"
    restart: unless-stopped
    command: unifi-cam-proxy -H "10.0.0.14" --nvr-username "user" --nvr-password "password" -i "10.0.0.151" --mac "xx:xx:xx:xx:xx:xx" -c /client.pem hikvision -u "admin" -p "Sup3rPas$" --substream 1

The Hikvision cameras are set to:

Stream Type: Main Stream(Normal)
Video Type: Video&Audio
Resolution: 2688x1520
Bitrate Type: Variable
Video Quality: Higher
Frame Rate fps: 15
Max. Bitrate Kbps: 3072
Video Encoding: H.264
H.264+: OFF
Profile: Main Profile
I Frame Interval: 70
SVC: OFF
Smoothing: 50

I also had to reduce security:

System/Security/Authentication/WEB Authentication   –>   digest/basic
bashmail commented 9 months ago

Try the dev branch. I can get them to work with the following. Also by providing Protect user credentials, you can generate the adoption tokens automatically with the dev branch.

services:
  proxy-1:
    image: keshavdv/unifi-cam-proxy:dev
    volumes:
      - "/Users/user/docker/unifi-cam-proxy/client.pem:/client.pem"
    restart: unless-stopped
    command: unifi-cam-proxy -H "10.0.0.14" --nvr-username "user" --nvr-password "password" -i "10.0.0.151" --mac "xx:xx:xx:xx:xx:xx" -c /client.pem hikvision -u "admin" -p "Sup3rPas$" --substream 1

The Hikvision cameras are set to:

Stream Type: Main Stream(Normal)
Video Type: Video&Audio
Resolution: 2688x1520
Bitrate Type: Variable
Video Quality: Higher
Frame Rate fps: 15
Max. Bitrate Kbps: 3072
Video Encoding: H.264
H.264+: OFF
Profile: Main Profile
I Frame Interval: 70
SVC: OFF
Smoothing: 50

I also had to reduce security:

System/Security/Authentication/WEB Authentication   –>   digest/basic

I matched mine configuration from camera as well as docker compose with yours. Problem apparently solved but only on mobile application. Live streaming is working fine in Mobile Application but not on web browser. I am using UniFi CloudKey Gen2 Plus. BTW, on 2 cameras I matched the configuration but on remaining 3 cameras I just switched to H.264 codecs instead of H.265. So the main thing here is Video Encoding setting must be H.264

bashmail commented 9 months ago

One more update. Dev branch lacks motion detection feature while it is working fine in normal branch.

Llewllyn commented 9 months ago

I have a similar problem, i am running Unifi Protect on a UDM Pro and i can see my cameras on the list and i can view the recordings but when i try to see the live view Unifi Protect will crash after a few seconds. I am running protect version 2.9.22 from the EA Chanel but i was having the same issues in the Latest stable version, I am going to try on a UNVR-4 to see if that fixes it.

Deberk commented 8 months ago

Similar issue for me. Camera is integrated but I only get a new screenshot every ~30 seconds and no real live stream. In the Unifi Protect App (Android) everything is fine, live stream is working. Using the .dev version and a normal rtsp stream.

Using a UNVR with 4 bays. UNVR v3.1.16 Protect 2.8.35

njbrown09 commented 8 months ago

Working on the same thing. I seem to get it working, however it keeps freezing and motion has crazy artifacting. Any ideas?

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