keshavdv / unifi-cam-proxy

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

hikvision issue #22

Closed jurajs5 closed 3 years ago

jurajs5 commented 3 years ago

when i try to import camera, it looks like:

Screenshot 2021-04-28 at 6 15 22

in unifi protect:

Screenshot 2021-04-28 at 6 15 52
jurajs5 commented 3 years ago

so I removed python 2.x and done whole installation from begining - looks better, i now have camera in unifi protect, however. it stops after few sec with following error:

Screenshot 2021-04-28 at 7 50 58

in unifi looks like disconnected after this error

jurajs5 commented 3 years ago

i tried to replace with different hikvision camera - same issue

keshavdv commented 3 years ago

Which specific model of Hikvision camera are you testing with?

jurajs5 commented 3 years ago

now i have connected: DS-2CD2085FWD-I fw: V5.6.3 build 190923

jurajs5 commented 3 years ago

Another observation i can not change or add name - its still same: UVC G3 EEFF, and MAC: AA:BB:CC:DD:EE:FF. Is this correct? I can change model - that is working fine, now G4 PRO

jurajs5 commented 3 years ago

after day and night troubleshoting i was able setup camera its working with command and i have video: unifi-cam-proxy --host 192.168.1.15 -i 192.168.1.74 --cert client.pem --token XY --model 'UVC G4 Pro' -m 'AA:BB:CC:00:11:22' rtsp -s rtsp://user:pass@192.168.1.74:554/Streaming/Channels/1/ if i try unifi-cam-proxy --host 192.168.1.15 -i 192.168.1.74 --cert client.pem --token token --model 'UVC G4 Pro' -m 'AA:BB:CC:00:11:22' hikvison -u user -p pass i got loop of 10sec and endless info about disconecting and reconecting camera - with no video Screenshot 2021-04-29 at 07 30 12

My question is - can be corrected this issue with hikvision setup and is there any way how to control FPS and resolution coming from unifi-cam-proxy?

thank you

keshavdv commented 3 years ago

I suspect the Hikvision implementation doesn't work because PTZ isn't supported. Can you share the following:

  1. Output of curl --digest 'http://<username>:<password>@192.168.1.74/ISAPI/PTZCtrl/channels/1/capabilities' -v
  2. Output with --verbose enabled:
    unifi-cam-proxy -v --host 192.168.1.15 -i 192.168.1.74 --cert client.pem --token XY --model 'UVC G4 Pro' -m 'AA:BB:CC:00:11:22' rtsp -s rtsp://user:pass@192.168.1.74:554/Streaming/Channels/1/
jurajs5 commented 3 years ago

but none of my cameras are PTZ and i never even try to use id

jurajs5 commented 3 years ago

pi@raspberry:~ $ unifi-cam-proxy --host 192.168.1.15 -i 192.168.1.74 --cert client.pem --token NyoRhH3MD0hbJyaG2evGw9x1XAnGCmU2 --model 'UVC G4 Pro' -m 'AA:BB:CC:00:11:22' --verbose rtsp -s rtsp://admin:pass@192.168.1.74:554/Streaming/Channels/1 2021-04-29 13:24:50 raspberry Core[1894] INFO Creating ws connection to wss://192.168.1.15:7442/camera/1.0/ws?token=NyoRhH3MD0hbJyaG2evGw9x1XAnGCmU2 2021-04-29 13:24:50 raspberry RTSPCam[1894] INFO Initiating adoption with token [NyoRhH3MD0hbJyaG2evGw9x1XAnGCmU2] and mac [AA:BB:CC:00:11:22] 2021-04-29 13:24:50 raspberry RTSPCam[1894] DEBUG Sending: {'from': 'ubnt_avclient', 'functionName': 'ubnt_avclient_hello', 'inResponseTo': 0, 'messageId': 1, 'payload': {'adoptionCode': 'NyoRhH3MD0hbJyaG2evGw9x1XAnGCmU2', 'connectionHost': '192.168.1.15', 'connectionSecurePort': 7442, 'fwVersion': 'UVC.S2L.v4.23.8.67.0eba6e3.200526.1046', 'hwrev': 19, 'idleTime': 191.96, 'ip': '192.168.1.74', 'mac': 'AA:BB:CC:00:11:22', 'model': 'UVC G4 Pro', 'name': 'unifi-cam-proxy', 'protocolVersion': 67, 'rebootTimeoutSec': 30, 'semver': 'v4.4.8', 'totalLoad': 0.5474, 'upgradeTimeoutSec': 150, 'uptime': 0.2968754768371582, 'features': {}}, 'responseExpected': False, 'to': 'UniFiVideo'} 2021-04-29 13:24:50 raspberry RTSPCam[1894] INFO Processing [ubnt_avclient_hello] message 2021-04-29 13:24:50 raspberry RTSPCam[1894] DEBUG Message contents: {'from': 'UniFiVideo', 'to': 'ubnt_avclient', 'functionName': 'ubnt_avclient_hello', 'messageId': 99787, 'inResponseTo': 1, 'payload': {'protocolVersion': 67, 'controllerName': 'unifi.virtualit.info', 'controllerUuid': '59a9baff-8096-4d74-8ca3-b5ecab501591', 'controllerVersion': '1.18.0-beta.10', 'overrideUuid': True}} 2021-04-29 13:24:50 raspberry RTSPCam[1894] INFO Processing [ubnt_avclient_hello] message 2021-04-29 13:24:50 raspberry RTSPCam[1894] DEBUG Message contents: {'from': 'UniFiVideo', 'to': 'ubnt_avclient', 'functionName': 'ubnt_avclient_hello', 'messageId': 99788, 'inResponseTo': 1, 'payload': {'protocolVersion': 67, 'controllerName': 'unifi.virtualit.info', 'controllerUuid': '59a9baff-8096-4d74-8ca3-b5ecab501591', 'controllerVersion': '1.18.0-beta.10', 'overrideUuid': True}} 2021-04-29 13:24:51 raspberry RTSPCam[1894] INFO Processing [ubnt_avclient_paramAgreement] message 2021-04-29 13:24:51 raspberry RTSPCam[1894] DEBUG Message contents: {'from': 'UniFiVideo', 'to': 'ubnt_avclient', 'responseExpected': True, 'functionName': 'ubnt_avclient_paramAgreement', 'messageId': 99792, 'inResponseTo': 0, 'payload': {'enableStatusCodes': True, 'useHeartbeats': False, 'heartbeatsTimeoutMs': 60000}} 2021-04-29 13:24:51 raspberry RTSPCam[1894] DEBUG Sending: {'from': 'ubnt_avclient', 'functionName': 'ubnt_avclient_paramAgreement', 'inResponseTo': 99792, 'messageId': 2, 'payload': {'authToken': 'NyoRhH3MD0hbJyaG2evGw9x1XAnGCmU2', 'features': {}}, 'responseExpected': False, 'to': 'UniFiVideo'} 2021-04-29 13:24:51 raspberry RTSPCam[1894] INFO Processing [ubnt_avclient_paramAgreement] message 2021-04-29 13:24:51 raspberry RTSPCam[1894] DEBUG Message contents: {'from': 'UniFiVideo', 'to': 'ubnt_avclient', 'responseExpected': True, 'functionName': 'ubnt_avclient_paramAgreement', 'messageId': 99793, 'inResponseTo': 0, 'payload': {'enableStatusCodes': True, 'useHeartbeats': False, 'heartbeatsTimeoutMs': 60000}} 2021-04-29 13:24:51 raspberry RTSPCam[1894] DEBUG Sending: {'from': 'ubnt_avclient', 'functionName': 'ubnt_avclient_paramAgreement', 'inResponseTo': 99793, 'messageId': 3, 'payload': {'authToken': 'NyoRhH3MD0hbJyaG2evGw9x1XAnGCmU2', 'features': {}}, 'responseExpected': False, 'to': 'UniFiVideo'} 2021-04-29 13:24:51 raspberry RTSPCam[1894] INFO Processing [StartService] message 2021-04-29 13:24:51 raspberry RTSPCam[1894] DEBUG Message contents: {'from': 'UniFiVideo', 'to': 'ubnt_avclient', 'responseExpected': False, 'functionName': 'StartService', 'messageId': 99794, 'inResponseTo': 0, 'payload': {'service': 'ssh'}} 2021-04-29 13:24:51 raspberry RTSPCam[1894] INFO Processing [ChangeVideoSettings] message 2021-04-29 13:24:51 raspberry RTSPCam[1894] DEBUG Message contents: {'from': 'UniFiVideo', 'to': 'ubnt_avclient', 'responseExpected': False, 'functionName': 'ChangeVideoSettings', 'messageId': 99795, 'inResponseTo': 0, 'payload': {'video': {'video1': {'avSerializer': {'type': 'extendedFlv', 'parameters': {'streamName': '7zaivswWwOaFlCJc'}, 'destinations': ['tcp://192.168.1.15:7550?retryInterval=1&connectTimeout=5']}}}}} 2021-04-29 13:24:51 raspberry RTSPCam[1894] INFO Spawning ffmpeg for video1 (7zaivswWwOaFlCJc): ffmpeg -nostdin -y -rtsp_transport tcp -i "rtsp://admin:pass@192.168.1.74:554/Streaming/Channels/1" -f lavfi -i aevalsrc=0 -vcodec copy -strict -2 -c:a aac -metadata streamname=7zaivswWwOaFlCJc -f flv - | /usr/bin/python -m unifi.clock_sync | nc 192.168.1.15 7550 2021-04-29 13:24:51 raspberry RTSPCam[1894] DEBUG Sending: {'from': 'ubnt_avclient', 'functionName': 'ChangeVideoSettings', 'inResponseTo': 99795, 'messageId': 4, 'payload': {'audio': {'bitRate': 32000, 'channels': 1, 'description': 'audio track', 'enableTemporalNoiseShaping': False, 'enabled': True, 'mode': 0, 'quality': 0, 'sampleRate': 11025, 'type': 'aac', 'volume': 100}, 'firmwarePath': '/lib/firmware/', 'video': {'enableHrd': False, 'hdrMode': 0, 'lowDelay': False, 'mjpg': {'avSerializer': {'destinations': ['file:///tmp/snap.jpeg', 'file:///tmp/snap_av.jpg'], 'parameters': {'audioId': 1000, 'enableTimestampsOverlapAvoidance': False, 'suppressAudio': True, 'suppressVideo': False, 'videoId': 1001}, 'type': 'mjpg'}, 'bitRateCbrAvg': 500000, 'bitRateVbrMax': 500000, 'bitRateVbrMin': None, 'description': 'JPEG pictures', 'enabled': True, 'fps': 5, 'height': 720, 'isCbr': False, 'maxFps': 5, 'minClientAdaptiveBitRate': 0, 'minMotionAdaptiveBitRate': 0, 'nMultiplier': None, 'name': 'mjpg', 'quality': 80, 'sourceId': 3, 'streamId': 8, 'streamOrdinal': 3, 'type': 'mjpg', 'validBitrateRangeMax': 6000000, 'validBitrateRangeMin': 32000, 'width': 1280}, 'video1': {'M': 1, 'N': 30, 'avSerializer': {'destinations': ['tcp://192.168.1.15:7550?retryInterval=1&connectTimeout=5'], 'parameters': {'audioId': None, 'streamName': '7zaivswWwOaFlCJc', 'suppressAudio': None, 'suppressVideo': None, 'videoId': None}, 'type': 'extendedFlv'}, 'bitRateCbrAvg': 1400000, 'bitRateVbrMax': 2800000, 'bitRateVbrMin': 48000, 'description': 'Hi quality video track', 'enabled': True, 'fps': 15, 'gopModel': 0, 'height': 720, 'horizontalFlip': False, 'isCbr': False, 'maxFps': 30, 'minClientAdaptiveBitRate': 0, 'minMotionAdaptiveBitRate': 0, 'nMultiplier': 6, 'name': 'video1', 'sourceId': 0, 'streamId': 1, 'streamOrdinal': 0, 'type': 'h264', 'validBitrateRangeMax': 2800000, 'validBitrateRangeMin': 32000, 'validFpsValues': [1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15, 16, 18, 20, 24, 25, 30], 'verticalFlip': False, 'width': 1280}, 'video2': {'M': 1, 'N': 30, 'avSerializer': {'destinations': ['file:///dev/null'], 'parameters': None, 'type': 'extendedFlv'}, 'bitRateCbrAvg': 500000, 'bitRateVbrMax': 1200000, 'bitRateVbrMin': 48000, 'currentVbrBitrate': 1200000, 'description': 'Medium quality video track', 'enabled': True, 'fps': 15, 'gopModel': 0, 'height': 400, 'horizontalFlip': False, 'isCbr': False, 'maxFps': 30, 'minClientAdaptiveBitRate': 0, 'minMotionAdaptiveBitRate': 0, 'nMultiplier': 6, 'name': 'video2', 'sourceId': 1, 'streamId': 2, 'streamOrdinal': 1, 'type': 'h264', 'validBitrateRangeMax': 1500000, 'validBitrateRangeMin': 32000, 'validFpsValues': [1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15, 16, 18, 20, 24, 25, 30], 'verticalFlip': False, 'width': 720}, 'video3': {'M': 1, 'N': 30, 'avSerializer': {'destinations': ['file:///dev/null'], 'parameters': None, 'type': 'extendedFlv'}, 'bitRateCbrAvg': 300000, 'bitRateVbrMax': 200000, 'bitRateVbrMin': 48000, 'currentVbrBitrate': 200000, 'description': 'Low quality video track', 'enabled': True, 'fps': 15, 'gopModel': 0, 'height': 360, 'horizontalFlip': False, 'isCbr': False, 'maxFps': 30, 'minClientAdaptiveBitRate': 0, 'minMotionAdaptiveBitRate': 0, 'nMultiplier': 6, 'name': 'video3', 'sourceId': 2, 'streamId': 4, 'streamOrdinal': 2, 'type': 'h264', 'validBitrateRangeMax': 750000, 'validBitrateRangeMin': 32000, 'validFpsValues': [1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15, 16, 18, 20, 24, 25, 30], 'verticalFlip': False, 'width': 640}, 'vinFps': 30}}, 'responseExpected': False, 'to': 'UniFiVideo'} 2021-04-29 13:24:51 raspberry RTSPCam[1894] INFO Processing [ChangeVideoSettings] message 2021-04-29 13:24:51 raspberry RTSPCam[1894] DEBUG Message contents: {'from': 'UniFiVideo', 'to': 'ubnt_avclient', 'responseExpected': False, 'functionName': 'ChangeVideoSettings', 'messageId': 99796, 'inResponseTo': 0, 'payload': {'video': {'video2': {'avSerializer': {'type': 'extendedFlv', 'parameters': {'streamName': 'gtcn231INgsZVxqD'}, 'destinations': ['tcp://192.168.1.15:7550?retryInterval=1&connectTimeout=5']}}}}} 2021-04-29 13:24:51 raspberry RTSPCam[1894] INFO Spawning ffmpeg for video2 (gtcn231INgsZVxqD): ffmpeg -nostdin -y -rtsp_transport tcp -i "rtsp://admin:pass@192.168.1.74:554/Streaming/Channels/1" -f lavfi -i aevalsrc=0 -vcodec copy -strict -2 -c:a aac -metadata streamname=gtcn231INgsZVxqD -f flv - | /usr/bin/python -m unifi.clock_sync | nc 192.168.1.15 7550 2021-04-29 13:24:51 raspberry RTSPCam[1894] DEBUG Sending: {'from': 'ubnt_avclient', 'functionName': 'ChangeVideoSettings', 'inResponseTo': 99796, 'messageId': 5, 'payload': {'audio': {'bitRate': 32000, 'channels': 1, 'description': 'audio track', 'enableTemporalNoiseShaping': False, 'enabled': True, 'mode': 0, 'quality': 0, 'sampleRate': 11025, 'type': 'aac', 'volume': 100}, 'firmwarePath': '/lib/firmware/', 'video': {'enableHrd': False, 'hdrMode': 0, 'lowDelay': False, 'mjpg': {'avSerializer': {'destinations': ['file:///tmp/snap.jpeg', 'file:///tmp/snap_av.jpg'], 'parameters': {'audioId': 1000, 'enableTimestampsOverlapAvoidance': False, 'suppressAudio': True, 'suppressVideo': False, 'videoId': 1001}, 'type': 'mjpg'}, 'bitRateCbrAvg': 500000, 'bitRateVbrMax': 500000, 'bitRateVbrMin': None, 'description': 'JPEG pictures', 'enabled': True, 'fps': 5, 'height': 720, 'isCbr': False, 'maxFps': 5, 'minClientAdaptiveBitRate': 0, 'minMotionAdaptiveBitRate': 0, 'nMultiplier': None, 'name': 'mjpg', 'quality': 80, 'sourceId': 3, 'streamId': 8, 'streamOrdinal': 3, 'type': 'mjpg', 'validBitrateRangeMax': 6000000, 'validBitrateRangeMin': 32000, 'width': 1280}, 'video1': {'M': 1, 'N': 30, 'avSerializer': {'destinations': ['file:///dev/null'], 'parameters': {'audioId': None, 'streamName': '7zaivswWwOaFlCJc', 'suppressAudio': None, 'suppressVideo': None, 'videoId': None}, 'type': 'extendedFlv'}, 'bitRateCbrAvg': 1400000, 'bitRateVbrMax': 2800000, 'bitRateVbrMin': 48000, 'description': 'Hi quality video track', 'enabled': True, 'fps': 15, 'gopModel': 0, 'height': 720, 'horizontalFlip': False, 'isCbr': False, 'maxFps': 30, 'minClientAdaptiveBitRate': 0, 'minMotionAdaptiveBitRate': 0, 'nMultiplier': 6, 'name': 'video1', 'sourceId': 0, 'streamId': 1, 'streamOrdinal': 0, 'type': 'h264', 'validBitrateRangeMax': 2800000, 'validBitrateRangeMin': 32000, 'validFpsValues': [1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15, 16, 18, 20, 24, 25, 30], 'verticalFlip': False, 'width': 1280}, 'video2': {'M': 1, 'N': 30, 'avSerializer': {'destinations': ['tcp://192.168.1.15:7550?retryInterval=1&connectTimeout=5'], 'parameters': {'audioId': None, 'streamName': 'gtcn231INgsZVxqD', 'suppressAudio': None, 'suppressVideo': None, 'videoId': None}, 'type': 'extendedFlv'}, 'bitRateCbrAvg': 500000, 'bitRateVbrMax': 1200000, 'bitRateVbrMin': 48000, 'currentVbrBitrate': 1200000, 'description': 'Medium quality video track', 'enabled': True, 'fps': 15, 'gopModel': 0, 'height': 400, 'horizontalFlip': False, 'isCbr': False, 'maxFps': 30, 'minClientAdaptiveBitRate': 0, 'minMotionAdaptiveBitRate': 0, 'nMultiplier': 6, 'name': 'video2', 'sourceId': 1, 'streamId': 2, 'streamOrdinal': 1, 'type': 'h264', 'validBitrateRangeMax': 1500000, 'validBitrateRangeMin': 32000, 'validFpsValues': [1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15, 16, 18, 20, 24, 25, 30], 'verticalFlip': False, 'width': 720}, 'video3': {'M': 1, 'N': 30, 'avSerializer': {'destinations': ['file:///dev/null'], 'parameters': None, 'type': 'extendedFlv'}, 'bitRateCbrAvg': 300000, 'bitRateVbrMax': 200000, 'bitRateVbrMin': 48000, 'currentVbrBitrate': 200000, 'description': 'Low quality video track', 'enabled': True, 'fps': 15, 'gopModel': 0, 'height': 360, 'horizontalFlip': False, 'isCbr': False, 'maxFps': 30, 'minClientAdaptiveBitRate': 0, 'minMotionAdaptiveBitRate': 0, 'nMultiplier': 6, 'name': 'video3', 'sourceId': 2, 'streamId': 4, 'streamOrdinal': 2, 'type': 'h264', 'validBitrateRangeMax': 750000, 'validBitrateRangeMin': 32000, 'validFpsValues': [1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15, 16, 18, 20, 24, 25, 30], 'verticalFlip': False, 'width': 640}, 'vinFps': 30}}, 'responseExpected': False, 'to': 'UniFiVideo'} 2021-04-29 13:24:51 raspberry RTSPCam[1894] INFO Processing [ChangeVideoSettings] message 2021-04-29 13:24:51 raspberry RTSPCam[1894] DEBUG Message contents: {'from': 'UniFiVideo', 'to': 'ubnt_avclient', 'responseExpected': False, 'functionName': 'ChangeVideoSettings', 'messageId': 99797, 'inResponseTo': 0, 'payload': {'video': {'video3': {'avSerializer': {'type': 'extendedFlv', 'parameters': {'streamName': 'T1Lqcq3i0mFcL4RZ'}, 'destinations': ['tcp://192.168.1.15:7550?retryInterval=1&connectTimeout=5']}}}}} 2021-04-29 13:24:51 raspberry RTSPCam[1894] INFO Spawning ffmpeg for video3 (T1Lqcq3i0mFcL4RZ): ffmpeg -nostdin -y -rtsp_transport tcp -i "rtsp://admin:pass@192.168.1.74:554/Streaming/Channels/1" -f lavfi -i aevalsrc=0 -vcodec copy -strict -2 -c:a aac -metadata streamname=T1Lqcq3i0mFcL4RZ -f flv - | /usr/bin/python -m unifi.clock_sync | nc 192.168.1.15 7550 2021-04-29 13:24:51 raspberry RTSPCam[1894] DEBUG Sending: {'from': 'ubnt_avclient', 'functionName': 'ChangeVideoSettings', 'inResponseTo': 99797, 'messageId': 6, 'payload': {'audio': {'bitRate': 32000, 'channels': 1, 'description': 'audio track', 'enableTemporalNoiseShaping': False, 'enabled': True, 'mode': 0, 'quality': 0, 'sampleRate': 11025, 'type': 'aac', 'volume': 100}, 'firmwarePath': '/lib/firmware/', 'video': {'enableHrd': False, 'hdrMode': 0, 'lowDelay': False, 'mjpg': {'avSerializer': {'destinations': ['file:///tmp/snap.jpeg', 'file:///tmp/snap_av.jpg'], 'parameters': {'audioId': 1000, 'enableTimestampsOverlapAvoidance': False, 'suppressAudio': True, 'suppressVideo': False, 'videoId': 1001}, 'type': 'mjpg'}, 'bitRateCbrAvg': 500000, 'bitRateVbrMax': 500000, 'bitRateVbrMin': None, 'description': 'JPEG pictures', 'enabled': True, 'fps': 5, 'height': 720, 'isCbr': False, 'maxFps': 5, 'minClientAdaptiveBitRate': 0, 'minMotionAdaptiveBitRate': 0, 'nMultiplier': None, 'name': 'mjpg', 'quality': 80, 'sourceId': 3, 'streamId': 8, 'streamOrdinal': 3, 'type': 'mjpg', 'validBitrateRangeMax': 6000000, 'validBitrateRangeMin': 32000, 'width': 1280}, 'video1': {'M': 1, 'N': 30, 'avSerializer': {'destinations': ['file:///dev/null'], 'parameters': {'audioId': None, 'streamName': '7zaivswWwOaFlCJc', 'suppressAudio': None, 'suppressVideo': None, 'videoId': None}, 'type': 'extendedFlv'}, 'bitRateCbrAvg': 1400000, 'bitRateVbrMax': 2800000, 'bitRateVbrMin': 48000, 'description': 'Hi quality video track', 'enabled': True, 'fps': 15, 'gopModel': 0, 'height': 720, 'horizontalFlip': False, 'isCbr': False, 'maxFps': 30, 'minClientAdaptiveBitRate': 0, 'minMotionAdaptiveBitRate': 0, 'nMultiplier': 6, 'name': 'video1', 'sourceId': 0, 'streamId': 1, 'streamOrdinal': 0, 'type': 'h264', 'validBitrateRangeMax': 2800000, 'validBitrateRangeMin': 32000, 'validFpsValues': [1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15, 16, 18, 20, 24, 25, 30], 'verticalFlip': False, 'width': 1280}, 'video2': {'M': 1, 'N': 30, 'avSerializer': {'destinations': ['file:///dev/null'], 'parameters': {'audioId': None, 'streamName': 'gtcn231INgsZVxqD', 'suppressAudio': None, 'suppressVideo': None, 'videoId': None}, 'type': 'extendedFlv'}, 'bitRateCbrAvg': 500000, 'bitRateVbrMax': 1200000, 'bitRateVbrMin': 48000, 'currentVbrBitrate': 1200000, 'description': 'Medium quality video track', 'enabled': True, 'fps': 15, 'gopModel': 0, 'height': 400, 'horizontalFlip': False, 'isCbr': False, 'maxFps': 30, 'minClientAdaptiveBitRate': 0, 'minMotionAdaptiveBitRate': 0, 'nMultiplier': 6, 'name': 'video2', 'sourceId': 1, 'streamId': 2, 'streamOrdinal': 1, 'type': 'h264', 'validBitrateRangeMax': 1500000, 'validBitrateRangeMin': 32000, 'validFpsValues': [1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15, 16, 18, 20, 24, 25, 30], 'verticalFlip': False, 'width': 720}, 'video3': {'M': 1, 'N': 30, 'avSerializer': {'destinations': ['tcp://192.168.1.15:7550?retryInterval=1&connectTimeout=5'], 'parameters': {'audioId': None, 'streamName': 'T1Lqcq3i0mFcL4RZ', 'suppressAudio': None, 'suppressVideo': None, 'videoId': None}, 'type': 'extendedFlv'}, 'bitRateCbrAvg': 300000, 'bitRateVbrMax': 200000, 'bitRateVbrMin': 48000, 'currentVbrBitrate': 200000, 'description': 'Low quality video track', 'enabled': True, 'fps': 15, 'gopModel': 0, 'height': 360, 'horizontalFlip': False, 'isCbr': False, 'maxFps': 30, 'minClientAdaptiveBitRate': 0, 'minMotionAdaptiveBitRate': 0, 'nMultiplier': 6, 'name': 'video3', 'sourceId': 2, 'streamId': 4, 'streamOrdinal': 2, 'type': 'h264', 'validBitrateRangeMax': 750000, 'validBitrateRangeMin': 32000, 'validFpsValues': [1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15, 16, 18, 20, 24, 25, 30], 'verticalFlip': False, 'width': 640}, 'vinFps': 30}}, 'responseExpected': False, 'to': 'UniFiVideo'} 2021-04-29 13:24:52 raspberry RTSPCam[1894] INFO Processing [UpdateFirmwareRequest] message 2021-04-29 13:24:52 raspberry RTSPCam[1894] DEBUG Message contents: {'from': 'UniFiVideo', 'to': 'ubnt_avclient', 'responseExpected': False, 'functionName': 'UpdateFirmwareRequest', 'messageId': 99798, 'inResponseTo': 0, 'payload': {'uri': 'https://192.168.1.15:7444/internal/update?platform=s5l&product=uvc&updateType=firmware&version=4.36.8', 'timeoutMs': 600000}} 2021-04-29 13:24:52 raspberry RTSPCam[1894] DEBUG Pretending to upgrade to: UVC.S5L.v4.36.8.67.6390eea.210317.1039 2021-04-29 13:24:52 raspberry RTSPCam[1894] INFO Reconnecting... 2021-04-29 13:24:52 raspberry RTSPCam[1894] INFO Cleaning up instance 2021-04-29 13:24:52 raspberry RTSPCam[1894] INFO Stopping stream video1 2021-04-29 13:24:52 raspberry RTSPCam[1894] INFO Stopping stream video2 2021-04-29 13:24:52 raspberry RTSPCam[1894] INFO Stopping stream video3 2021-04-29 13:24:52 raspberry Core[1894] INFO Backing off connect(...) for 2.0s (True) 2021-04-29 13:24:54 raspberry Core[1894] INFO Creating ws connection to wss://192.168.1.15:7442/camera/1.0/ws?token=NyoRhH3MD0hbJyaG2evGw9x1XAnGCmU2 2021-04-29 13:24:54 raspberry RTSPCam[1894] INFO Initiating adoption with token [NyoRhH3MD0hbJyaG2evGw9x1XAnGCmU2] and mac [AA:BB:CC:00:11:22] 2021-04-29 13:24:54 raspberry RTSPCam[1894] DEBUG Sending: {'from': 'ubnt_avclient', 'functionName': 'ubnt_avclient_hello', 'inResponseTo': 0, 'messageId': 7, 'payload': {'adoptionCode': 'NyoRhH3MD0hbJyaG2evGw9x1XAnGCmU2', 'connectionHost': '192.168.1.15', 'connectionSecurePort': 7442, 'fwVersion': 'UVC.S5L.v4.36.8.67.6390eea.210317.1039\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', 'hwrev': 19, 'idleTime': 191.96, 'ip': '192.168.1.74', 'mac': 'AA:BB:CC:00:11:22', 'model': 'UVC G4 Pro', 'name': 'unifi-cam-proxy', 'protocolVersion': 67, 'rebootTimeoutSec': 30, 'semver': 'v4.4.8', 'totalLoad': 0.5474, 'upgradeTimeoutSec': 150, 'uptime': 4.808112382888794, 'features': {}}, 'responseExpected': False, 'to': 'UniFiVideo'} 2021-04-29 13:24:54 raspberry RTSPCam[1894] INFO Processing [ubnt_avclient_hello] message 2021-04-29 13:24:54 raspberry RTSPCam[1894] DEBUG Message contents: {'from': 'UniFiVideo', 'to': 'ubnt_avclient', 'functionName': 'ubnt_avclient_hello', 'messageId': 99799, 'inResponseTo': 7, 'payload': {'protocolVersion': 67, 'controllerName': 'unifi.virtualit.info', 'controllerUuid': '59a9baff-8096-4d74-8ca3-b5ecab501591', 'controllerVersion': '1.18.0-beta.10', 'overrideUuid': True}} 2021-04-29 13:24:55 raspberry RTSPCam[1894] INFO Processing [ubnt_avclient_hello] message 2021-04-29 13:24:55 raspberry RTSPCam[1894] DEBUG Message contents: {'from': 'UniFiVideo', 'to': 'ubnt_avclient', 'functionName': 'ubnt_avclient_hello', 'messageId': 99800, 'inResponseTo': 7, 'payload': {'protocolVersion': 67, 'controllerName': 'unifi.virtualit.info', 'controllerUuid': '59a9baff-8096-4d74-8ca3-b5ecab501591', 'controllerVersion': '1.18.0-beta.10', 'overrideUuid': True}} 2021-04-29 13:24:55 raspberry RTSPCam[1894] INFO Processing [ubnt_avclient_paramAgreement] message 2021-04-29 13:24:55 raspberry RTSPCam[1894] DEBUG Message contents: {'from': 'UniFiVideo', 'to': 'ubnt_avclient', 'responseExpected': True, 'functionName': 'ubnt_avclient_paramAgreement', 'messageId': 99801, 'inResponseTo': 0, 'payload': {'enableStatusCodes': True, 'useHeartbeats': False, 'heartbeatsTimeoutMs': 60000}} 2021-04-29 13:24:55 raspberry RTSPCam[1894] DEBUG Sending: {'from': 'ubnt_avclient', 'functionName': 'ubnt_avclient_paramAgreement', 'inResponseTo': 99801, 'messageId': 8, 'payload': {'authToken': 'NyoRhH3MD0hbJyaG2evGw9x1XAnGCmU2', 'features': {}}, 'responseExpected': False, 'to': 'UniFiVideo'} 2021-04-29 13:24:55 raspberry RTSPCam[1894] INFO Processing [ubnt_avclient_paramAgreement] message 2021-04-29 13:24:55 raspberry RTSPCam[1894] DEBUG Message contents: {'from': 'UniFiVideo', 'to': 'ubnt_avclient', 'responseExpected': True, 'functionName': 'ubnt_avclient_paramAgreement', 'messageId': 99802, 'inResponseTo': 0, 'payload': {'enableStatusCodes': True, 'useHeartbeats': False, 'heartbeatsTimeoutMs': 60000}} 2021-04-29 13:24:55 raspberry RTSPCam[1894] DEBUG Sending: {'from': 'ubnt_avclient', 'functionName': 'ubnt_avclient_paramAgreement', 'inResponseTo': 99802, 'messageId': 9, 'payload': {'authToken': 'NyoRhH3MD0hbJyaG2evGw9x1XAnGCmU2', 'features': {}}, 'responseExpected': False, 'to': 'UniFiVideo'} 2021-04-29 13:24:55 raspberry RTSPCam[1894] INFO Processing [StartService] message 2021-04-29 13:24:55 raspberry RTSPCam[1894] DEBUG Message contents: {'from': 'UniFiVideo', 'to': 'ubnt_avclient', 'responseExpected': False, 'functionName': 'StartService', 'messageId': 99803, 'inResponseTo': 0, 'payload': {'service': 'ssh'}} 2021-04-29 13:24:56 raspberry RTSPCam[1894] INFO Processing [ChangeDeviceSettings] message 2021-04-29 13:24:56 raspberry RTSPCam[1894] DEBUG Message contents: {'from': 'UniFiVideo', 'to': 'ubnt_avclient', 'responseExpected': True, 'functionName': 'ChangeDeviceSettings', 'messageId': 99804, 'inResponseTo': 0, 'payload': {'timezone': 'Europe/Prague'}} 2021-04-29 13:24:56 raspberry RTSPCam[1894] DEBUG Sending: {'from': 'ubnt_avclient', 'functionName': 'ChangeDeviceSettings', 'inResponseTo': 99804, 'messageId': 10, 'payload': {'name': 'unifi-cam-proxy', 'timezone': 'PST8PDT,M3.2.0,M11.1.0'}, 'responseExpected': False, 'to': 'UniFiVideo'} 2021-04-29 13:24:56 raspberry RTSPCam[1894] INFO Processing [GetRequest] message 2021-04-29 13:24:56 raspberry RTSPCam[1894] DEBUG Message contents: {'from': 'UniFiVideo', 'to': 'ubnt_avclient', 'responseExpected': True, 'functionName': 'GetRequest', 'messageId': 99805, 'inResponseTo': 0, 'payload': {'what': 'snapshot', 'uri': 'https://192.168.1.15:7444/internal/camera-upload/ncwMza1UdBUkb84U0RWeu9YRFq6Xh6M0', 'timeoutMs': 30000}} 2021-04-29 13:24:56 raspberry RTSPCam[1894] INFO Spawning stream for snapshots: ffmpeg -nostdin -y -re -rtsp_transport tcp -i "rtsp://admin:pass@192.168.1.74:554/Streaming/Channels/1" -vf fps=1 -update 1 /tmp/tmp4ylccyx6/screen.jpg 2021-04-29 13:24:56 raspberry RTSPCam[1894] WARNING Snapshot file /tmp/tmp4ylccyx6/screen.jpg is not ready yet, skipping upload 2021-04-29 13:24:56 raspberry RTSPCam[1894] DEBUG Sending: {'from': 'ubnt_avclient', 'functionName': 'GetRequest', 'inResponseTo': 99805, 'messageId': 11, 'payload': {}, 'responseExpected': False, 'to': 'UniFiVideo'} 2021-04-29 13:24:59 raspberry RTSPCam[1894] INFO Processing [GetSystemStats] message 2021-04-29 13:24:59 raspberry RTSPCam[1894] DEBUG Message contents: {'from': 'UniFiVideo', 'to': 'ubnt_avclient', 'responseExpected': True, 'functionName': 'GetSystemStats', 'messageId': 99809, 'inResponseTo': 0, 'payload': {}} 2021-04-29 13:25:00 raspberry RTSPCam[1894] INFO Processing [NetworkStatus] message 2021-04-29 13:25:00 raspberry RTSPCam[1894] DEBUG Message contents: {'from': 'UniFiVideo', 'to': 'ubnt_avclient', 'responseExpected': True, 'functionName': 'NetworkStatus', 'messageId': 99813, 'inResponseTo': 0, 'payload': {}} 2021-04-29 13:25:00 raspberry RTSPCam[1894] DEBUG Sending: {'from': 'ubnt_avclient', 'functionName': 'NetworkStatus', 'inResponseTo': 99813, 'messageId': 12, 'payload': {'connectionState': 2, 'connectionStateDescription': 'CONNECTED', 'defaultInterface': 'eth0', 'dhcpLeasetime': 86400, 'dnsServer': '8.8.8.8 4.2.2.2', 'gateway': '192.168.103.1', 'ipAddress': '192.168.1.74', 'linkDuplex': 1, 'linkSpeedMbps': 100, 'mode': 'dhcp', 'networkMask': '255.255.255.0'}, 'responseExpected': False, 'to': 'UniFiVideo'} 2021-04-29 13:25:09 raspberry RTSPCam[1894] INFO Processing [GetSystemStats] message 2021-04-29 13:25:09 raspberry RTSPCam[1894] DEBUG Message contents: {'from': 'UniFiVideo', 'to': 'ubnt_avclient', 'responseExpected': True, 'functionName': 'GetSystemStats', 'messageId': 99817, 'inResponseTo': 0, 'payload': {}} 2021-04-29 13:25:10 raspberry RTSPCam[1894] INFO Processing [NetworkStatus] message 2021-04-29 13:25:10 raspberry RTSPCam[1894] DEBUG Message contents: {'from': 'UniFiVideo', 'to': 'ubnt_avclient', 'responseExpected': True, 'functionName': 'NetworkStatus', 'messageId': 99821, 'inResponseTo': 0, 'payload': {}} 2021-04-29 13:25:10 raspberry RTSPCam[1894] DEBUG Sending: {'from': 'ubnt_avclient', 'functionName': 'NetworkStatus', 'inResponseTo': 99821, 'messageId': 13, 'payload': {'connectionState': 2, 'connectionStateDescription': 'CONNECTED', 'defaultInterface': 'eth0', 'dhcpLeasetime': 86400, 'dnsServer': '8.8.8.8 4.2.2.2', 'gateway': '192.168.103.1', 'ipAddress': '192.168.1.74', 'linkDuplex': 1, 'linkSpeedMbps': 100, 'mode': 'dhcp', 'networkMask': '255.255.255.0'}, 'responseExpected': False, 'to': 'UniFiVideo'}

jurajs5 commented 3 years ago

output:

keshavdv commented 3 years ago

I pushed a fix to the hikvision-ptz branch. Can you try it out after installing it locally with the following?

pip3 install git+https://github.com/keshavdv/unifi-cam-proxy@hikvision-ptz
jurajs5 commented 3 years ago
keshavdv commented 3 years ago

Can you share the output of unifi-cam-proxy with the --verbose flag again?

SirMishaa commented 3 years ago

@jurajs5 Up ? I have the model DS-2CD2045FWD-I and I would like to know if it will be compatible using this (wonderful) plugin before buy the Network Video Recorder

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.