IpCamera: New IP Camera Binding

camera
ip-cam
onvif
Tags: #<Tag:0x00007f0153ea8228> #<Tag:0x00007f0153ecf1e8> #<Tag:0x00007f0153eced88>

(_) #481

@matt1
How can i help you to add more functionality to dahua IPC?


(B K) #482

@matt1 - I’m trying to get your binding working with my QCAM NVR (NV3108E) and POE cameras (IP3M952E). These are basically Amcrest cameras, so I would have thought the Amcrest API would work, but I’m having a hard time getting images or even initializing the cameras. Let me know if these settings seem familiar (to Amcrest) or if it’s possible to modify the binding slightly to add support for these.

I’ve tested the feeds with iSpy, and the settings are as follows:

ONVIF API access:
http://ipaddress:8000/onvif/device_service

NVR RTSP URLs:
rtsp://user:password@ipaddress:554/h264Preview_01_main
rtsp://user:password@ipaddress:554/h264Preview_01_sub
rtsp://user:password@ipaddress:554/h264Preview_02_main
rtsp://user:password@ipaddress:554/h264Preview_02_sub

and so on, for each channel.

When I try to add these using the ipCamera binding, I keep getting a 405 (Unsupported command) error in the ONVIF response…

Let me know if you need any other info!


(Skinah) #483

@Kristo
Just report back if using it as Amcrest worked as suggested last time I posted a reply to you, then try playing with the API in any browser to work out what needs to be done to get the streaming alarm feed to work. The URL should open a stream in the browser and when an alarm goes off some kind of text will display in the browser, then each time an alarm is tripped the text will change without you needing to do anything.

It could be a simple need to leave the square brackets off like this example, or perhaps if you have an alarm code added to the watch list that your camera does not support it may break the stream from starting. Maybe try channel=1… Just try things to see what works as I have no Dahua cameras.

/cgi-bin/eventManager.cgi?action=attach&channel=0&codes=VideoMotion,MDResult,VideoBlind,VideoLoss,CrossLineDetection

@bartus

The binding does not support RTSP yet, only snapshots. Try downloading the amcrest API document which is linked to in the very first post of this thread and try some of the API out on your camera in any browser to see if it works. Amcrest cameras appear to be made by Dahua.


(B K) #484

@matt1 thanks! Just to close the loop, I actually was able to locate the original QCAM NVR API document (https://s3.amazonaws.com/amcrest-files/Documentation/Qcam+CGI+API+SDK.pdf), from which it looks like the API is very different from Amcrest (I tried the Amcrest cgi-bin commands with no luck). Unfortunately, I don’t see any http snapshot URLs in the API (it seems to be a configuration API only), so looks like QCAM cameras/NVRs won’t be supported unless RTSP (FFMPEG) works.


(_) #485

HI @matt1,
Thanks for answer,
I tested Amcrest and functionality is same like in Dahua (motion switch is working but no motion detection status) i tried also different mods of

/cgi-bin/eventManager.cgi?action=attach&channel=0&codes=VideoMotion,MDResult,VideoBlind,VideoLoss,CrossLineDetection

but non of version was working - strange think that it did’t get any feedback form camera like normally when you made mistake in function (ErrorBad Request!)

only below one is working, but it have to be checked one by one:

/cgi-bin/eventManager.cgi?action=getEventIndexes&code=VideoMotion

If you can integrate also IO control functionality like you did in Hikvision will be nice

/cgi-bin/alarm.cgi?action=getInSlots

answer

result=2 / two inputs

/cgi-bin/alarm.cgi?action=getOutSlots

answer

result=2 / two outputs

/cgi-bin/alarm.cgi?action=getInState
result=0 //no alarm
result=1 //alarm ch. 1
result=2 //alarm ch. 2
result=3 //alarm ch. 1 & alarm ch. 2
/cgi-bin/alarm.cgi?action=getOutState

answer

result=0
result=1
result=2
result=3

off

http://192.168.2.11/cgi-bin/configManager.cgi?action=setConfig&AlarmOut[0].Mode=2
http://192.168.2.11/cgi-bin/configManager.cgi?action=setConfig&AlarmOut[1].Mode=2

answer:

OK

on

http://192.168.2.11/cgi-bin/configManager.cgi?action=setConfig&AlarmOut[0].Mode=1
http://192.168.2.11/cgi-bin/configManager.cgi?action=setConfig&AlarmOut[1].Mode=1

answer:

OK


(Skinah) #486

@bartus
If the camera is ONVIF try using the onvif device manager software or my binding via onvif, I am pretty sure that for a camera to be able to advertise it is ONVIF it must be capable of snapshots and the url will be found with that software.


(_) #487

Hi @matt1,

I used amcrest last API

http://192.168.2.10/cgi-bin/eventManager.cgi?action=attach&codes=[All]

and in browser i can see small square when motion detection activated
image

Log form beginign of test i will place also one from time when camera detect motion but need to make synchro fo time

2018-09-30 11:38:57.640 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Checking the selected Media Profile is a valid number.
2018-09-30 11:38:57.642 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Fetching a Token for the selected Media Profile.
2018-09-30 11:38:57.644 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - About to fetch some information about the Media Profiles from the camera
2018-09-30 11:38:57.646 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - *********** Media Profile 0 details reported by camera at IP:192.168.2.11 ***********
2018-09-30 11:38:57.648 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Camera will use this Media Profile unless you change it in the bindings settings.
2018-09-30 11:38:57.649 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Media Profile 0 is named:VideoEncoderConfig_Channel1_MainStream
2018-09-30 11:38:57.651 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Media Profile 0 uses video encoder	:null
2018-09-30 11:38:57.653 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Media Profile 0 uses video quality	:0.0
2018-09-30 11:38:57.655 [WARN ] [ing.ipcamera.handler.IpCameraHandler] - Following NPE occured when trying to connect to the camera with ONVIF.java.lang.NullPointerException
2018-09-30 11:38:58.044 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Sending camera at IP:192.168.2.11, 	URL:/cgi-bin/snapshot.cgi?channel=0
2018-09-30 11:38:58.047 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Just locked in main1
2018-09-30 11:38:58.050 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Just unlocked main1
2018-09-30 11:38:58.386 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - CommonCameraHandler created.... 0 channels tracked (some of these may be closed).
2018-09-30 11:38:58.422 [TRACE] [ipcamera.internal.MyNettyAuthHandler] - MyNettyAuthHandler is now setup for 	GET:/cgi-bin/snapshot.cgi?channel=0
2018-09-30 11:38:58.425 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Have  opened  a  brand NEW channel:0 	GET:/cgi-bin/snapshot.cgi?channel=0
2018-09-30 11:38:58.546 [TRACE] [ipcamera.internal.MyNettyAuthHandler] - 401: Normal for DIGEST authorization. 	URL:/cgi-bin/snapshot.cgi?channel=0
2018-09-30 11:38:58.555 [DEBUG] [ipcamera.internal.MyNettyAuthHandler] - 401: Mark as closing, the  channel:0 	GET:/cgi-bin/snapshot.cgi?channel=0
2018-09-30 11:38:58.558 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Resending using a fresh DIGEST 	URL:/cgi-bin/snapshot.cgi?channel=0
2018-09-30 11:38:58.560 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Sending camera at IP:192.168.2.11, 	URL:/cgi-bin/snapshot.cgi?channel=0
2018-09-30 11:38:58.562 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Just locked in main1
2018-09-30 11:38:58.563 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Just unlocked main1
2018-09-30 11:38:58.572 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - CommonCameraHandler created.... 1 channels tracked (some of these may be closed).
2018-09-30 11:38:58.580 [TRACE] [ipcamera.internal.MyNettyAuthHandler] - MyNettyAuthHandler is now setup for 	GET:/cgi-bin/snapshot.cgi?channel=0
2018-09-30 11:38:58.582 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Have  opened  a  brand NEW channel:1 	GET:/cgi-bin/snapshot.cgi?channel=0
2018-09-30 11:38:58.598 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - DefaultHttpResponse(decodeResult: success, version: HTTP/1.1)
HTTP/1.1 401 Unauthorized
WWW-Authenticate: Digest realm="Login to 3L07B61PAA00051", qop="auth", nonce="176278346", opaque="fdd3940804f910daf85891da3cfd35007043bdc7"
Connection: close
CONTENT-LENGTH: 0
2018-09-30 11:38:58.601 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Channel marked as closing, channel:0 	URL:/cgi-bin/snapshot.cgi?channel=0
2018-09-30 11:38:58.603 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Message passed on from new code, must be EmptyLastHttpContent
2018-09-30 11:38:58.605 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - EmptyLastHttpContent
2018-09-30 11:38:58.609 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - commonCameraHandler closed channel:0 	URL:/cgi-bin/snapshot.cgi?channel=0
2018-09-30 11:38:58.610 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Closing CommonCameraHandler. 		URL:/cgi-bin/snapshot.cgi?channel=0
2018-09-30 11:38:59.014 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Channel marked as closing, channel:1 	URL:/cgi-bin/snapshot.cgi?channel=0
2018-09-30 11:38:59.016 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Message passed on from new code, must be EmptyLastHttpContent
2018-09-30 11:38:59.061 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - DefaultHttpContent(data: PooledSlicedByteBuf(ridx: 0, widx: 893, cap: 893/893, unwrapped: PooledUnsafeDirectByteBuf(ridx: 1024, widx: 1024, cap: 1024)), decoderResult: success)
2018-09-30 11:38:59.071 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - DefaultHttpContent(data: PooledSlicedByteBuf(ridx: 0, widx: 8192, cap: 8192/8192, unwrapped: PooledUnsafeDirectByteBuf(ridx: 8192, widx: 16384, cap: 16384)), decoderResult: success)
2018-09-30 11:38:59.090 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - DefaultHttpContent(data: PooledSlicedByteBuf(ridx: 0, widx: 8192, cap: 8192/8192, unwrapped: PooledUnsafeDirectByteBuf(ridx: 16384, widx: 16384, cap: 16384)), decoderResult: success)
2018-09-30 11:38:59.103 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - DefaultHttpContent(data: PooledSlicedByteBuf(ridx: 0, widx: 8192, cap: 8192/8192, unwrapped: PooledUnsafeDirectByteBuf(ridx: 8192, widx: 65536, cap: 65536)), decoderResult: success)
2018-09-30 11:38:59.115 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - DefaultHttpContent(data: PooledSlicedByteBuf(ridx: 0, widx: 8192, cap: 8192/8192, unwrapped: PooledUnsafeDirectByteBuf(ridx: 16384, widx: 65536, cap: 65536)), decoderResult: success)
2018-09-30 11:38:59.120 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - DefaultHttpContent(data: PooledSlicedByteBuf(ridx: 0, widx: 8192, cap: 8192/8192, unwrapped: PooledUnsafeDirectByteBuf(ridx: 24576, widx: 65536, cap: 65536)), decoderResult: success)
2018-09-30 11:38:59.125 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - DefaultHttpContent(data: PooledSlicedByteBuf(ridx: 0, widx: 8192, cap: 8192/8192, unwrapped: PooledUnsafeDirectByteBuf(ridx: 32768, widx: 65536, cap: 65536)), decoderResult: success)
2018-09-30 11:38:59.129 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - DefaultHttpContent(data: PooledSlicedByteBuf(ridx: 0, widx: 8192, cap: 8192/8192, unwrapped: PooledUnsafeDirectByteBuf(ridx: 40960, widx: 65536, cap: 65536)), decoderResult: success)
2018-09-30 11:38:59.133 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - DefaultHttpContent(data: PooledSlicedByteBuf(ridx: 0, widx: 8192, cap: 8192/8192, unwrapped: PooledUnsafeDirectByteBuf(ridx: 49152, widx: 65536, cap: 65536)), decoderResult: success)
2018-09-30 11:38:59.137 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - DefaultHttpContent(data: PooledSlicedByteBuf(ridx: 0, widx: 8192, cap: 8192/8192, unwrapped: PooledUnsafeDirectByteBuf(ridx: 57344, widx: 65536, cap: 65536)), decoderResult: success)
2018-09-30 11:38:59.142 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - DefaultHttpContent(data: PooledSlicedByteBuf(ridx: 0, widx: 8192, cap: 8192/8192, unwrapped: PooledUnsafeDirectByteBuf(ridx: 65536, widx: 65536, cap: 65536)), decoderResult: success)
2018-09-30 11:38:59.148 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - DefaultHttpContent(data: PooledSlicedByteBuf(ridx: 0, widx: 8192, cap: 8192/8192, unwrapped: PooledUnsafeDirectByteBuf(ridx: 8192, widx: 65536, cap: 65536)), decoderResult: success)
2018-09-30 11:38:59.152 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - DefaultHttpContent(data: PooledSlicedByteBuf(ridx: 0, widx: 8192, cap: 8192/8192, unwrapped: PooledUnsafeDirectByteBuf(ridx: 16384, widx: 65536, cap: 65536)), decoderResult: success)
2018-09-30 11:38:59.157 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - DefaultHttpContent(data: PooledSlicedByteBuf(ridx: 0, widx: 8192, cap: 8192/8192, unwrapped: PooledUnsafeDirectByteBuf(ridx: 24576, widx: 65536, cap: 65536)), decoderResult: success)
2018-09-30 11:38:59.161 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - DefaultHttpContent(data: PooledSlicedByteBuf(ridx: 0, widx: 8192, cap: 8192/8192, unwrapped: PooledUnsafeDirectByteBuf(ridx: 32768, widx: 65536, cap: 65536)), decoderResult: success)
2018-09-30 11:38:59.165 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - DefaultHttpContent(data: PooledSlicedByteBuf(ridx: 0, widx: 8192, cap: 8192/8192, unwrapped: PooledUnsafeDirectByteBuf(ridx: 40960, widx: 65536, cap: 65536)), decoderResult: success)
2018-09-30 11:38:59.170 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - DefaultHttpContent(data: PooledSlicedByteBuf(ridx: 0, widx: 8192, cap: 8192/8192, unwrapped: PooledUnsafeDirectByteBuf(ridx: 49152, widx: 65536, cap: 65536)), decoderResult: success)
2018-09-30 11:38:59.174 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - DefaultHttpContent(data: PooledSlicedByteBuf(ridx: 0, widx: 8192, cap: 8192/8192, unwrapped: PooledUnsafeDirectByteBuf(ridx: 57344, widx: 65536, cap: 65536)), decoderResult: success)
2018-09-30 11:38:59.179 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - DefaultHttpContent(data: PooledSlicedByteBuf(ridx: 0, widx: 8192, cap: 8192/8192, unwrapped: PooledUnsafeDirectByteBuf(ridx: 65536, widx: 65536, cap: 65536)), decoderResult: success)
2018-09-30 11:38:59.184 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - DefaultHttpContent(data: PooledSlicedByteBuf(ridx: 0, widx: 8192, cap: 8192/8192, unwrapped: PooledUnsafeDirectByteBuf(ridx: 8192, widx: 14333, cap: 65536)), decoderResult: success)
2018-09-30 11:38:59.193 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - DefaultLastHttpContent(data: PooledSlicedByteBuf(ridx: 0, widx: 6141, cap: 6141/6141, unwrapped: PooledUnsafeDirectByteBuf(ridx: 14333, widx: 14333, cap: 65536)), decoderResult: success)
2018-09-30 11:38:59.264 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Snapshot recieved: Binding will now close the channel.
2018-09-30 11:38:59.268 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - commonCameraHandler closed channel:1 	URL:/cgi-bin/snapshot.cgi?channel=0
2018-09-30 11:38:59.271 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Closing CommonCameraHandler. 		URL:/cgi-bin/snapshot.cgi?channel=0
2018-09-30 11:38:59.446 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Sending camera at IP:192.168.2.11, 	URL:/cgi-bin/configManager.cgi?action=getConfig&name=VideoMotion
2018-09-30 11:38:59.448 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Just locked in main1
2018-09-30 11:38:59.450 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Just unlocked main1
2018-09-30 11:38:59.540 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - CommonCameraHandler created.... 2 channels tracked (some of these may be closed).
2018-09-30 11:38:59.551 [TRACE] [ipcamera.internal.MyNettyAuthHandler] - MyNettyAuthHandler is now setup for 	GET:/cgi-bin/configManager.cgi?action=getConfig&name=VideoMotion
2018-09-30 11:38:59.553 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Have  opened  a  brand NEW channel:2 	GET:/cgi-bin/configManager.cgi?action=getConfig&name=VideoMotion
2018-09-30 11:38:59.556 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Sending camera at IP:192.168.2.11, 	URL:/cgi-bin/configManager.cgi?action=getConfig&name=CrossLineDetection
2018-09-30 11:38:59.558 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Just locked in main1
2018-09-30 11:38:59.577 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Just unlocked main1
2018-09-30 11:38:59.623 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - CommonCameraHandler created.... 3 channels tracked (some of these may be closed).
2018-09-30 11:38:59.630 [TRACE] [ipcamera.internal.MyNettyAuthHandler] - MyNettyAuthHandler is now setup for 	GET:/cgi-bin/configManager.cgi?action=getConfig&name=CrossLineDetection
2018-09-30 11:38:59.632 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Have  opened  a  brand NEW channel:3 	GET:/cgi-bin/configManager.cgi?action=getConfig&name=CrossLineDetection
2018-09-30 11:38:59.634 [WARN ] [ing.ipcamera.handler.IpCameraHandler] - The alarm checking stream was not running. Cleaning channels and then going to re-start it now.
2018-09-30 11:38:59.637 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - ******** Cleaning channels for camera at 192.168.2.11 *********
2018-09-30 11:38:59.639 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Clean channels is now locked
2018-09-30 11:38:59.641 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Channel status is -1 for URL:/cgi-bin/snapshot.cgi?channel=0
2018-09-30 11:38:59.643 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Channel status is -1 for URL:/cgi-bin/snapshot.cgi?channel=0
2018-09-30 11:38:59.644 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Channel status is 1 for URL:/cgi-bin/configManager.cgi?action=getConfig&name=VideoMotion
2018-09-30 11:38:59.646 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Channel status is 1 for URL:/cgi-bin/configManager.cgi?action=getConfig&name=CrossLineDetection
2018-09-30 11:38:59.650 [TRACE] [ipcamera.internal.MyNettyAuthHandler] - 401: Normal for DIGEST authorization. 	URL:/cgi-bin/configManager.cgi?action=getConfig&name=VideoMotion
2018-09-30 11:38:59.655 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Clean channels is now unlocking
2018-09-30 11:38:59.657 [DEBUG] [ipcamera.internal.MyNettyAuthHandler] - 401: Mark as closing, the  channel:0 	GET:/cgi-bin/configManager.cgi?action=getConfig&name=VideoMotion
2018-09-30 11:38:59.660 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Sending camera at IP:192.168.2.11, 	URL:/cgi-bin/eventManager.cgi?action=attach&codes=[VideoMotion,MDResult,VideoBlind,VideoLoss,CrossLineDetection]&channel=[0]
2018-09-30 11:38:59.660 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Resending using a fresh DIGEST 	URL:/cgi-bin/configManager.cgi?action=getConfig&name=VideoMotion
2018-09-30 11:38:59.663 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Just locked in main1
2018-09-30 11:38:59.663 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Sending camera at IP:192.168.2.11, 	URL:/cgi-bin/configManager.cgi?action=getConfig&name=VideoMotion
2018-09-30 11:38:59.666 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Just locked in main1
2018-09-30 11:38:59.666 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Just unlocked main1
2018-09-30 11:38:59.668 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Just unlocked main1
2018-09-30 11:38:59.683 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - CommonCameraHandler created.... 2 channels tracked (some of these may be closed).
2018-09-30 11:38:59.695 [TRACE] [ipcamera.internal.MyNettyAuthHandler] - MyNettyAuthHandler is now setup for 	GET:/cgi-bin/eventManager.cgi?action=attach&codes=[VideoMotion,MDResult,VideoBlind,VideoLoss,CrossLineDetection]&channel=[0]
2018-09-30 11:38:59.697 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Have  opened  a  brand NEW channel:2 	GET:/cgi-bin/eventManager.cgi?action=attach&codes=[VideoMotion,MDResult,VideoBlind,VideoLoss,CrossLineDetection]&channel=[0]
2018-09-30 11:38:59.705 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - CommonCameraHandler created.... 3 channels tracked (some of these may be closed).
2018-09-30 11:38:59.713 [TRACE] [ipcamera.internal.MyNettyAuthHandler] - 401: Normal for DIGEST authorization. 	URL:/cgi-bin/configManager.cgi?action=getConfig&name=CrossLineDetection
2018-09-30 11:38:59.716 [DEBUG] [ipcamera.internal.MyNettyAuthHandler] - 401: Mark as closing, the  channel:1 	GET:/cgi-bin/configManager.cgi?action=getConfig&name=CrossLineDetection
2018-09-30 11:38:59.717 [TRACE] [ipcamera.internal.MyNettyAuthHandler] - MyNettyAuthHandler is now setup for 	GET:/cgi-bin/configManager.cgi?action=getConfig&name=VideoMotion
2018-09-30 11:38:59.719 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Have  opened  a  brand NEW channel:3 	GET:/cgi-bin/configManager.cgi?action=getConfig&name=VideoMotion
2018-09-30 11:38:59.722 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Resending using a fresh DIGEST 	URL:/cgi-bin/configManager.cgi?action=getConfig&name=CrossLineDetection
2018-09-30 11:38:59.722 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - DefaultHttpResponse(decodeResult: success, version: HTTP/1.1)
HTTP/1.1 401 Unauthorized
WWW-Authenticate: Digest realm="Login to 3L07B61PAA00051", qop="auth", nonce="1778096972", opaque="fdd3940804f910daf85891da3cfd35007043bdc7"
Connection: close
CONTENT-LENGTH: 0
2018-09-30 11:38:59.724 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Sending camera at IP:192.168.2.11, 	URL:/cgi-bin/configManager.cgi?action=getConfig&name=CrossLineDetection
2018-09-30 11:38:59.726 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Just locked in main1
2018-09-30 11:38:59.731 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Channel marked as closing, channel:0 	URL:/cgi-bin/configManager.cgi?action=getConfig&name=VideoMotion
2018-09-30 11:38:59.728 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Just unlocked main1
2018-09-30 11:38:59.734 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Message passed on from new code, must be EmptyLastHttpContent
2018-09-30 11:38:59.738 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - EmptyLastHttpContent
2018-09-30 11:38:59.738 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - CommonCameraHandler created.... 4 channels tracked (some of these may be closed).
2018-09-30 11:38:59.744 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - commonCameraHandler closed channel:0 	URL:/cgi-bin/configManager.cgi?action=getConfig&name=VideoMotion
2018-09-30 11:38:59.746 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Closing CommonCameraHandler. 		URL:/cgi-bin/configManager.cgi?action=getConfig&name=VideoMotion
2018-09-30 11:38:59.746 [TRACE] [ipcamera.internal.MyNettyAuthHandler] - MyNettyAuthHandler is now setup for 	GET:/cgi-bin/configManager.cgi?action=getConfig&name=CrossLineDetection
2018-09-30 11:38:59.748 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Have  opened  a  brand NEW channel:4 	GET:/cgi-bin/configManager.cgi?action=getConfig&name=CrossLineDetection
2018-09-30 11:38:59.750 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - DefaultHttpResponse(decodeResult: success, version: HTTP/1.1)
HTTP/1.1 401 Unauthorized
WWW-Authenticate: Digest realm="Login to 3L07B61PAA00051", qop="auth", nonce="1095115415", opaque="fdd3940804f910daf85891da3cfd35007043bdc7"
Connection: close
CONTENT-LENGTH: 0
2018-09-30 11:38:59.754 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Channel marked as closing, channel:1 	URL:/cgi-bin/configManager.cgi?action=getConfig&name=CrossLineDetection
2018-09-30 11:38:59.756 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Message passed on from new code, must be EmptyLastHttpContent
2018-09-30 11:38:59.757 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - EmptyLastHttpContent
2018-09-30 11:38:59.759 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - commonCameraHandler closed channel:1 	URL:/cgi-bin/configManager.cgi?action=getConfig&name=CrossLineDetection
2018-09-30 11:38:59.761 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Closing CommonCameraHandler. 		URL:/cgi-bin/configManager.cgi?action=getConfig&name=CrossLineDetection
2018-09-30 11:38:59.905 [TRACE] [ipcamera.internal.MyNettyAuthHandler] - 401: Normal for DIGEST authorization. 	URL:/cgi-bin/eventManager.cgi?action=attach&codes=[VideoMotion,MDResult,VideoBlind,VideoLoss,CrossLineDetection]&channel=[0]
2018-09-30 11:38:59.907 [DEBUG] [ipcamera.internal.MyNettyAuthHandler] - 401: Mark as closing, the  channel:2 	GET:/cgi-bin/eventManager.cgi?action=attach&codes=[VideoMotion,MDResult,VideoBlind,VideoLoss,CrossLineDetection]&channel=[0]
2018-09-30 11:38:59.910 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Resending using a fresh DIGEST 	URL:/cgi-bin/eventManager.cgi?action=attach&codes=[VideoMotion,MDResult,VideoBlind,VideoLoss,CrossLineDetection]&channel=[0]
2018-09-30 11:38:59.912 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Sending camera at IP:192.168.2.11, 	URL:/cgi-bin/eventManager.cgi?action=attach&codes=[VideoMotion,MDResult,VideoBlind,VideoLoss,CrossLineDetection]&channel=[0]
2018-09-30 11:38:59.914 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Just locked in main1
2018-09-30 11:38:59.915 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Just unlocked main1
2018-09-30 11:38:59.920 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - CommonCameraHandler created.... 5 channels tracked (some of these may be closed).
2018-09-30 11:38:59.926 [TRACE] [ipcamera.internal.MyNettyAuthHandler] - MyNettyAuthHandler is now setup for 	GET:/cgi-bin/eventManager.cgi?action=attach&codes=[VideoMotion,MDResult,VideoBlind,VideoLoss,CrossLineDetection]&channel=[0]
2018-09-30 11:38:59.928 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Have  opened  a  brand NEW channel:5 	GET:/cgi-bin/eventManager.cgi?action=attach&codes=[VideoMotion,MDResult,VideoBlind,VideoLoss,CrossLineDetection]&channel=[0]
2018-09-30 11:38:59.930 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - DefaultHttpResponse(decodeResult: success, version: HTTP/1.1)
HTTP/1.1 401 Unauthorized
WWW-Authenticate: Digest realm="Login to 3L07B61PAA00051", qop="auth", nonce="5750680", opaque="fdd3940804f910daf85891da3cfd35007043bdc7"
Connection: close
CONTENT-LENGTH: 0
2018-09-30 11:38:59.932 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Channel marked as closing, channel:2 	URL:/cgi-bin/eventManager.cgi?action=attach&codes=[VideoMotion,MDResult,VideoBlind,VideoLoss,CrossLineDetection]&channel=[0]
2018-09-30 11:38:59.934 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Message passed on from new code, must be EmptyLastHttpContent
2018-09-30 11:38:59.935 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - EmptyLastHttpContent
2018-09-30 11:38:59.937 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - commonCameraHandler closed channel:2 	URL:/cgi-bin/eventManager.cgi?action=attach&codes=[VideoMotion,MDResult,VideoBlind,VideoLoss,CrossLineDetection]&channel=[0]
2018-09-30 11:38:59.939 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Closing CommonCameraHandler. 		URL:/cgi-bin/eventManager.cgi?action=attach&codes=[VideoMotion,MDResult,VideoBlind,VideoLoss,CrossLineDetection]&channel=[0]
2018-09-30 11:38:59.944 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - DefaultHttpResponse(decodeResult: success, version: HTTP/1.1)
HTTP/1.1 400 Bad Request
Connection: close
Content-type: text/plain;charset=utf-8
Content-Length: 21
2018-09-30 11:38:59.946 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Channel marked as closing, channel:4 	URL:/cgi-bin/configManager.cgi?action=getConfig&name=CrossLineDetection
2018-09-30 11:38:59.949 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Message passed on from new code, must be EmptyLastHttpContent
2018-09-30 11:38:59.951 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - DefaultLastHttpContent(data: PooledSlicedByteBuf(ridx: 0, widx: 21, cap: 21/21, unwrapped: PooledUnsafeDirectByteBuf(ridx: 128, widx: 128, cap: 1024)), decoderResult: success)
2018-09-30 11:38:59.954 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - HTTP Result back from camera is 	:Error
Bad Request!
:
2018-09-30 11:38:59.958 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - commonCameraHandler closed channel:4 	URL:/cgi-bin/configManager.cgi?action=getConfig&name=CrossLineDetection
2018-09-30 11:38:59.964 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Closing CommonCameraHandler. 		URL:/cgi-bin/configManager.cgi?action=getConfig&name=CrossLineDetection
2018-09-30 11:39:00.029 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - DefaultHttpResponse(decodeResult: success, version: HTTP/1.1)
HTTP/1.1 400 Bad Request
Connection: close
Content-type: text/plain;charset=utf-8
Content-Length: 21
2018-09-30 11:39:00.031 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Channel marked as closing, channel:3 	URL:/cgi-bin/configManager.cgi?action=getConfig&name=VideoMotion
2018-09-30 11:39:00.032 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Message passed on from new code, must be EmptyLastHttpContent
2018-09-30 11:39:00.034 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - DefaultLastHttpContent(data: PooledSlicedByteBuf(ridx: 0, widx: 21, cap: 21/21, unwrapped: PooledUnsafeDirectByteBuf(ridx: 128, widx: 128, cap: 1024)), decoderResult: success)
2018-09-30 11:39:00.036 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - HTTP Result back from camera is 	:Error
Bad Request!
:
2018-09-30 11:39:00.039 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - commonCameraHandler closed channel:3 	URL:/cgi-bin/configManager.cgi?action=getConfig&name=VideoMotion
2018-09-30 11:39:00.040 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Closing CommonCameraHandler. 		URL:/cgi-bin/configManager.cgi?action=getConfig&name=VideoMotion
2018-09-30 11:39:00.049 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - DefaultHttpResponse(decodeResult: success, version: HTTP/1.1)
HTTP/1.1 200 OK
Cache-Control: no-cache
Pragma: no-cache
Expires: Thu, 01 Dec 2099 16:00:00 GMT
Connection: Keep-Alive
Content-Type: multipart/x-mixed-replace; boundary=myboundary
2018-09-30 11:39:00.050 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Message passed on from new code, must be EmptyLastHttpContent
2018-09-30 11:39:00.052 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - DefaultHttpContent(data: PooledSlicedByteBuf(ridx: 0, widx: 188, cap: 188/188, unwrapped: PooledUnsafeDirectByteBuf(ridx: 188, widx: 188, cap: 1024)), decoderResult: success)
2018-09-30 11:39:00.054 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - HTTP Result back from camera is 	:HTTP/1.1 200 OK
Cache-Control: no-cache
Pragma: no-cache
Expires: Thu, 01 Dec 2099 16:00:00 GMT
Connection: Keep-Alive
Content-Type: multipart/x-mixed-replace; boundary=myboundary

:

(Kim Andersen) #488

Will this binding work with Ubiquiti cams?


(Mark) #489

Hi,

I got it working with Y-cam YCBLHD8 Bullet HD 1080p and Phylink PLC-129SPW.

I had trouble with the generic ONVIF which caused Openhab to freeze and needed a reboot to recover. HTTP only is working with jpeg snapshot showing in sitemap. No issues so far.

Nice work thanks.


(Matt) #490

How can I use this with an mjpeg stream out of Blue Iris? For example, this URL provides an mjpeg stream, with no authentication required locally: [http://192.168.x.x:81/mjpg/back-south/video.mjpg

I want to be able to use that mjpeg stream in a variety of places just like I do with other ONVIF cameras in this binding.


(Skinah) #491

This binding does not do video, only snapshots.
Read the manual on web view and video items and widgets as these should work for mjpeg streams with no authorisation enabled.


(_) #492

Hello @matt1,
Any chance to tune binding for Dahua cams?


(Teo) #493

Is it possible to include support for VRCAM cameras?

ONVIF is not supported and the producer is JUAN.

Here there are useful informaions about these cams:

I have a couple of these cameras (one P2 and one P4) and i will be happy to help.


(Denny Tsai) #494

Hi matt1,

I’m new to Openhab and just found your binding.
I’ve tested it with my Hikvision Model:
DS-7208HQHI-F1 / N
Everything works perfectly. Thank you!


(Skinah) #495

Great, I have added the model to the known working list.

@Orso
Do they have an API to allow alarm checking? If no it is not worth the time getting them running as cameras that have multiple features already working do not cost that much. Most cameras should work as a ‘http only’ thing but if it is only a picture and no alarms then how useful the camera is will be limited. See first post of this thread for what brands have what working features.

@Kristo
Yes I have done some testing with the link in your previous post (big thanks for helping) and it works at opening a stream on my Amcrest camera which is made by Dahua, I just need some more time to do some testing and adding the changes. I have already added some other features users have requested so I need to make a new build soon, just finding the time is hard at the moment.


(Teo) #496

As far as i know, the manufacturer doesn’t give any help to developers.
Currently i get the snapshot without even username and password …

http://192.168.x.x/snapshot

In the camera App (VR Camera, but all the developer’s apps work with these cams…i’ve tried them) has the motion sensing function and i get the log as well as the field for sensitivity configuration.
Everything known about this camera is on the link i’va attached in my first post.

I think it wouldn’t be too difficult to include the streaming support.

Streaming

Streaming happens TCP port 64444 with a handshake looking like:

login = 'LTCP...u'.replace('.',b'\x00')
loginSoup = '<SOUP version="1.0"><auth usr="admin" psw="" eseeid="" nat="symmetric" client="" imei="" isp="" buddleid=""/></SOUP>.'.replace('.',b'\x00')

#response LTCP...?<SOUP version="1.0"><auth usr="admin" psw="" error="0"/></SOUP>

create = 'LTCP...R'.replace('.',b'\x00')
createSoup = '<SOUP version="1.1"><vcon cmd="create" id="132137576" app="RemoteSetup" /></SOUP>.'.replace('.',b'\x00')

startStream = 'LTCP...O'.replace('.',b'\x00')
startStreamSoup = '<SOUP version="1.0"><streamreq ch="vin0" stream="stream0" opt="start"/></SOUP>.'.replace('.',b'\x00')

#response LTCP...[<SOUP version="1.0"><streamreq ch="vin0" stream="stream0" opt="start" cam_des="P1"/></SOUP>

About motion detect, we need to investigate further…


(Andrew Pawelski) #497

@matt1 can this be set up as an add on in the marketplace?


(_) #498

@matt1

Thanks a lot for your effort i’m ready to do testing as one of cam is still not installed on final place and is easier to do


(Nakh Home) #500


i have tried in this add-on in the past. do you think that all the improvements done it will work with my camera???


(Daniel Weber) #501

Hi @matt1,

I just want to thank you for this binding. It works quite well with my Reolink cams RLC-410 and RLC-411 (ONVIF mode). However I always have to query the SnapshotURI (onvifCamera.getMedia().getSnapshotUri(profileToken)) to get a fresh/updated snapshot. If you want I can create a PR with my simple changes.

Best regards
Daniel