HTTP API motion detection area?

Any major updates coming, Upcoming Software, General Security advice for others and topics alike Post them here so other users can chat with you.
Ynot
Posts: 11
Joined: Sun Mar 17, 2019 6:32 pm

HTTP API motion detection area?

Postby Ynot » Thu Mar 21, 2019 7:25 pm

Greetings, I would like to understand how the HTTP API can be used to indicate in what area of the image that motion is occurring on an IP4M-1053EW. I have enabled motion detection on the camera as can be seen in the query results below and defined "Region 1" in the web view gui as the entire frame.

".../cgi-bin/configManager.cgi?action=getConfig&name=MotionDetect[0]" returns a number of fields, but I see no changes when motion is occurring and would appreciate some guidance please, as I can find no explanation of the various fields such as "table.MotionDetect[0].Region[0]=0" or what values to expect if there is motion:

Code: Select all

table.MotionDetect[0].DetectVersion=V3.0
table.MotionDetect[0].Enable=true
table.MotionDetect[0].EventHandler.AlarmOut=1
table.MotionDetect[0].EventHandler.AlarmOutChannels[0]=0
table.MotionDetect[0].EventHandler.AlarmOutEnable=true
table.MotionDetect[0].EventHandler.AlarmOutLatch=10
table.MotionDetect[0].EventHandler.BeepEnable=false
table.MotionDetect[0].EventHandler.Dejitter=5
table.MotionDetect[0].EventHandler.Delay=0
table.MotionDetect[0].EventHandler.ExAlarmOut=1
table.MotionDetect[0].EventHandler.ExAlarmOutChannels[0]=0
table.MotionDetect[0].EventHandler.ExAlarmOutEnable=false
table.MotionDetect[0].EventHandler.FlashEnable=false
table.MotionDetect[0].EventHandler.FlashLatch=10
table.MotionDetect[0].EventHandler.LightingLink.Enable=false
table.MotionDetect[0].EventHandler.LightingLink.FilckerIntevalTime=5
table.MotionDetect[0].EventHandler.LightingLink.FilckerLightType=WhiteLight
table.MotionDetect[0].EventHandler.LightingLink.FilckerTimes=5
table.MotionDetect[0].EventHandler.LogEnable=false
table.MotionDetect[0].EventHandler.MailEnable=false
table.MotionDetect[0].EventHandler.Matrix=1
table.MotionDetect[0].EventHandler.MatrixChannels[0]=0
table.MotionDetect[0].EventHandler.MatrixEnable=false
table.MotionDetect[0].EventHandler.MessageEnable=false
table.MotionDetect[0].EventHandler.PtzLink[0][0]=None
table.MotionDetect[0].EventHandler.PtzLink[0][1]=0
table.MotionDetect[0].EventHandler.PtzLinkEnable=false
table.MotionDetect[0].EventHandler.Record=1
table.MotionDetect[0].EventHandler.RecordChannels[0]=0
table.MotionDetect[0].EventHandler.RecordEnable=true
table.MotionDetect[0].EventHandler.RecordLatch=10
table.MotionDetect[0].EventHandler.Snapshot=1
table.MotionDetect[0].EventHandler.SnapshotChannels[0]=0
table.MotionDetect[0].EventHandler.SnapshotEnable=true
table.MotionDetect[0].EventHandler.SnapshotTimes=1
table.MotionDetect[0].EventHandler.TimeSection[0][0]=1 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[0][1]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[0][2]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[0][3]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[0][4]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[0][5]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[1][0]=1 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[1][1]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[1][2]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[1][3]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[1][4]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[1][5]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[2][0]=1 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[2][1]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[2][2]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[2][3]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[2][4]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[2][5]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[3][0]=1 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[3][1]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[3][2]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[3][3]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[3][4]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[3][5]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[4][0]=1 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[4][1]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[4][2]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[4][3]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[4][4]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[4][5]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[5][0]=1 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[5][1]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[5][2]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[5][3]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[5][4]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[5][5]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[6][0]=1 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[6][1]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[6][2]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[6][3]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[6][4]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[6][5]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TipEnable=false
table.MotionDetect[0].EventHandler.Tour=1
table.MotionDetect[0].EventHandler.TourChannels[0]=0
table.MotionDetect[0].EventHandler.TourEnable=false
table.MotionDetect[0].EventHandler.VoiceEnable=false
table.MotionDetect[0].Level=3
table.MotionDetect[0].MotionDetectWindow[0].Id=0
table.MotionDetect[0].MotionDetectWindow[0].Name=Region1
table.MotionDetect[0].MotionDetectWindow[0].Region[0]=4194303
table.MotionDetect[0].MotionDetectWindow[0].Region[1]=4194303
table.MotionDetect[0].MotionDetectWindow[0].Region[2]=4194303
table.MotionDetect[0].MotionDetectWindow[0].Region[3]=4194303
table.MotionDetect[0].MotionDetectWindow[0].Region[4]=4194303
table.MotionDetect[0].MotionDetectWindow[0].Region[5]=4194303
table.MotionDetect[0].MotionDetectWindow[0].Region[6]=4194303
table.MotionDetect[0].MotionDetectWindow[0].Region[7]=4194303
table.MotionDetect[0].MotionDetectWindow[0].Region[8]=4194303
table.MotionDetect[0].MotionDetectWindow[0].Region[9]=4194303
table.MotionDetect[0].MotionDetectWindow[0].Region[10]=4194303
table.MotionDetect[0].MotionDetectWindow[0].Region[11]=4194303
table.MotionDetect[0].MotionDetectWindow[0].Region[12]=4194303
table.MotionDetect[0].MotionDetectWindow[0].Region[13]=4194303
table.MotionDetect[0].MotionDetectWindow[0].Region[14]=4194303
table.MotionDetect[0].MotionDetectWindow[0].Region[15]=4194303
table.MotionDetect[0].MotionDetectWindow[0].Region[16]=4194303
table.MotionDetect[0].MotionDetectWindow[0].Region[17]=4194303
table.MotionDetect[0].MotionDetectWindow[0].Sensitive=28
table.MotionDetect[0].MotionDetectWindow[0].Threshold=5
table.MotionDetect[0].MotionDetectWindow[0].Window[0]=0
table.MotionDetect[0].MotionDetectWindow[0].Window[1]=0
table.MotionDetect[0].MotionDetectWindow[0].Window[2]=8191
table.MotionDetect[0].MotionDetectWindow[0].Window[3]=8191
table.MotionDetect[0].MotionDetectWindow[1].Id=1
table.MotionDetect[0].MotionDetectWindow[1].Name=Region2
table.MotionDetect[0].MotionDetectWindow[1].Region[0]=0
table.MotionDetect[0].MotionDetectWindow[1].Region[1]=0
table.MotionDetect[0].MotionDetectWindow[1].Region[2]=0
table.MotionDetect[0].MotionDetectWindow[1].Region[3]=0
table.MotionDetect[0].MotionDetectWindow[1].Region[4]=0
table.MotionDetect[0].MotionDetectWindow[1].Region[5]=0
table.MotionDetect[0].MotionDetectWindow[1].Region[6]=0
table.MotionDetect[0].MotionDetectWindow[1].Region[7]=0
table.MotionDetect[0].MotionDetectWindow[1].Region[8]=0
table.MotionDetect[0].MotionDetectWindow[1].Region[9]=0
table.MotionDetect[0].MotionDetectWindow[1].Region[10]=0
table.MotionDetect[0].MotionDetectWindow[1].Region[11]=0
table.MotionDetect[0].MotionDetectWindow[1].Region[12]=0
table.MotionDetect[0].MotionDetectWindow[1].Region[13]=0
table.MotionDetect[0].MotionDetectWindow[1].Region[14]=0
table.MotionDetect[0].MotionDetectWindow[1].Region[15]=0
table.MotionDetect[0].MotionDetectWindow[1].Region[16]=0
table.MotionDetect[0].MotionDetectWindow[1].Region[17]=0
table.MotionDetect[0].MotionDetectWindow[1].Sensitive=70
table.MotionDetect[0].MotionDetectWindow[1].Threshold=5
table.MotionDetect[0].MotionDetectWindow[1].Window[0]=0
table.MotionDetect[0].MotionDetectWindow[1].Window[1]=0
table.MotionDetect[0].MotionDetectWindow[1].Window[2]=0
table.MotionDetect[0].MotionDetectWindow[1].Window[3]=0
table.MotionDetect[0].MotionDetectWindow[2].Id=2
table.MotionDetect[0].MotionDetectWindow[2].Name=Region3
table.MotionDetect[0].MotionDetectWindow[2].Region[0]=0
table.MotionDetect[0].MotionDetectWindow[2].Region[1]=0
table.MotionDetect[0].MotionDetectWindow[2].Region[2]=0
table.MotionDetect[0].MotionDetectWindow[2].Region[3]=0
table.MotionDetect[0].MotionDetectWindow[2].Region[4]=0
table.MotionDetect[0].MotionDetectWindow[2].Region[5]=0
table.MotionDetect[0].MotionDetectWindow[2].Region[6]=0
table.MotionDetect[0].MotionDetectWindow[2].Region[7]=0
table.MotionDetect[0].MotionDetectWindow[2].Region[8]=0
table.MotionDetect[0].MotionDetectWindow[2].Region[9]=0
table.MotionDetect[0].MotionDetectWindow[2].Region[10]=0
table.MotionDetect[0].MotionDetectWindow[2].Region[11]=0
table.MotionDetect[0].MotionDetectWindow[2].Region[12]=0
table.MotionDetect[0].MotionDetectWindow[2].Region[13]=0
table.MotionDetect[0].MotionDetectWindow[2].Region[14]=0
table.MotionDetect[0].MotionDetectWindow[2].Region[15]=0
table.MotionDetect[0].MotionDetectWindow[2].Region[16]=0
table.MotionDetect[0].MotionDetectWindow[2].Region[17]=0
table.MotionDetect[0].MotionDetectWindow[2].Sensitive=70
table.MotionDetect[0].MotionDetectWindow[2].Threshold=5
table.MotionDetect[0].MotionDetectWindow[2].Window[0]=0
table.MotionDetect[0].MotionDetectWindow[2].Window[1]=0
table.MotionDetect[0].MotionDetectWindow[2].Window[2]=0
table.MotionDetect[0].MotionDetectWindow[2].Window[3]=0
table.MotionDetect[0].MotionDetectWindow[3].Id=3
table.MotionDetect[0].MotionDetectWindow[3].Name=Region4
table.MotionDetect[0].MotionDetectWindow[3].Region[0]=0
table.MotionDetect[0].MotionDetectWindow[3].Region[1]=0
table.MotionDetect[0].MotionDetectWindow[3].Region[2]=0
table.MotionDetect[0].MotionDetectWindow[3].Region[3]=0
table.MotionDetect[0].MotionDetectWindow[3].Region[4]=0
table.MotionDetect[0].MotionDetectWindow[3].Region[5]=0
table.MotionDetect[0].MotionDetectWindow[3].Region[6]=0
table.MotionDetect[0].MotionDetectWindow[3].Region[7]=0
table.MotionDetect[0].MotionDetectWindow[3].Region[8]=0
table.MotionDetect[0].MotionDetectWindow[3].Region[9]=0
table.MotionDetect[0].MotionDetectWindow[3].Region[10]=0
table.MotionDetect[0].MotionDetectWindow[3].Region[11]=0
table.MotionDetect[0].MotionDetectWindow[3].Region[12]=0
table.MotionDetect[0].MotionDetectWindow[3].Region[13]=0
table.MotionDetect[0].MotionDetectWindow[3].Region[14]=0
table.MotionDetect[0].MotionDetectWindow[3].Region[15]=0
table.MotionDetect[0].MotionDetectWindow[3].Region[16]=0
table.MotionDetect[0].MotionDetectWindow[3].Region[17]=0
table.MotionDetect[0].MotionDetectWindow[3].Sensitive=70
table.MotionDetect[0].MotionDetectWindow[3].Threshold=5
table.MotionDetect[0].MotionDetectWindow[3].Window[0]=0
table.MotionDetect[0].MotionDetectWindow[3].Window[1]=0
table.MotionDetect[0].MotionDetectWindow[3].Window[2]=0
table.MotionDetect[0].MotionDetectWindow[3].Window[3]=0
table.MotionDetect[0].OsdTwinkleEnable=false
table.MotionDetect[0].PirMotionLevel=3
table.MotionDetect[0].PtzManualEnable=true
table.MotionDetect[0].Region[0]=4194303
table.MotionDetect[0].Region[1]=4194303
table.MotionDetect[0].Region[2]=4194303
table.MotionDetect[0].Region[3]=4194303
table.MotionDetect[0].Region[4]=4194303
table.MotionDetect[0].Region[5]=4194303
table.MotionDetect[0].Region[6]=4194303
table.MotionDetect[0].Region[7]=4194303
table.MotionDetect[0].Region[8]=4194303
table.MotionDetect[0].Region[9]=4194303
table.MotionDetect[0].Region[10]=4194303
table.MotionDetect[0].Region[11]=4194303
table.MotionDetect[0].Region[12]=4194303
table.MotionDetect[0].Region[13]=4194303
table.MotionDetect[0].Region[14]=4194303
table.MotionDetect[0].Region[15]=4194303
table.MotionDetect[0].Region[16]=4194303
table.MotionDetect[0].Region[17]=4194303
Last edited by Ynot on Wed Mar 27, 2019 10:24 am, edited 2 times in total.

DahuaMotionDetect
Posts: 4
Joined: Sun Mar 24, 2019 5:38 am

Re: HTTP API motion detection area?

Postby DahuaMotionDetect » Sun Mar 24, 2019 5:57 am

Hi, I have a Dahua camera with a similar API. You are seeing the video motion detection settings. To see the actual video motion data, you need to connect to

Code: Select all

/SubscribeNotify.cgi?sessionId=SESSIONID
on new models or

Code: Select all

/cgi-bin/videomotion.cgi?sessionId=SESSIONID
on old models. With either one you need to attach the motion stream first by initializing a factory (generator) instance with a POST request to

Code: Select all

/RPC2
with the following data:

Code: Select all

{'method': 'devVideoDetect.factory.instance', 'params': {'channel': 0}, 'session': SESSIONID, 'id': 1}
The reply will be a JSON with

Code: Select all

'result'
as the factory (generator) OBJECT. Then you attach the motion with a POST request to

Code: Select all

/RPC2
with the following data:

Code: Select all

{'method': 'devVideoDetect.attachMotionData', 'params': {'proc': SESSION_PROC}, 'session': SESSIONID, 'object': OBJECT, 'id': 1}


Note that the POST requests must have a valid session cookie that matches the session ID, which is obtained by performing a Digest login on

Code: Select all

/RPC2_Login


Then you connect to the attached motion stream with a GET request and

Code: Select all

Accept: */*
It sends the motion data as JSON over a TCP stream.

This was great with the old models because it allowed for very fast tours, with the motion detect stream constantly being received even with PTZ commands being given. New models that support "Enable Manual Control Trigger" silence the motion stream when a PTZ command is given.

I've contacted Dahua about this and I hope they fix this and allow a constant motion detect stream. Otherwise I'll have to downgrade the firmware on every new Dahua camera just so it can perform motion detection uninterrupted while PTZ commands are given.

Ynot
Posts: 11
Joined: Sun Mar 17, 2019 6:32 pm

Re: HTTP API motion detection area?

Postby Ynot » Sun Mar 24, 2019 11:27 am

It seems that those Dahua constructs aren't available on the Amcrest ... searching the HTTP API for "SubscribeNotify" or "videomotion" returns no results. The cgi-bin queries both return "Error Bad Request!"

DahuaMotionDetect
Posts: 4
Joined: Sun Mar 24, 2019 5:38 am

Re: HTTP API motion detection area?

Postby DahuaMotionDetect » Wed Mar 27, 2019 7:17 am

Can you post the full HTTP requests you're making? It should look like this:

Digest login:

Code: Select all

curl "http://0.0.0.0/RPC2_Login" -H "User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:60.0) Gecko/20100101 Firefox/60.0" -H "Accept: application/json, text/javascript, */*; q=0.01" -H "Accept-Language: en-GB,en;q=0.5" --compressed -H "Referer: http://0.0.0.0/" -H "Content-Type: application/x-www-form-urlencoded; charset=UTF-8" -H "X-Requested-With: XMLHttpRequest" -H "Connection: keep-alive" --data "{""method"":""global.login"",""params"":{""userName"":""admin"",""password"":"""",""clientType"":""Web3.0"",""loginType"":""Direct""},""id"":2}"


"realm" is {"params": {"realm": realm}} and nonce is {"params": {"random": random}} . You use the realm and nonce and username and password to create a digest login. You md5hash "user:realm:password" then md5hash "user:nonce:previous_hash" and send it as {"params": "password": password}

Code: Select all

curl "http://0.0.0.0/RPC2_Login" -H "User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:60.0) Gecko/20100101 Firefox/60.0" -H "Accept: application/json, text/javascript, */*; q=0.01" -H "Accept-Language: en-GB,en;q=0.5" --compressed -H "Referer: http://0.0.0.0/" -H "Content-Type: application/x-www-form-urlencoded; charset=UTF-8" -H "X-Requested-With: XMLHttpRequest" -H "Connection: keep-alive" --data "{""method"":""global.login"",""params"":{""userName"":""admin"",""password"":""AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"",""clientType"":""Web3.0"",""loginType"":""Direct"",""authorityType"":""Default""},""id"":5,""session"":""e5f06ef1810067d6e3437f2af897e3dd""}"


Then you create a devVideoDetect factory instance (only required for newer cameras):

Code: Select all

curl "http://0.0.0.0/RPC2" -H "User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:60.0) Gecko/20100101 Firefox/60.0" -H "Accept: application/json, text/javascript, */*; q=0.01" -H "Accept-Language: en-GB,en;q=0.5" --compressed -H "Referer: http://0.0.0.0/" -H "Content-Type: application/x-www-form-urlencoded; charset=UTF-8" -H "X-Requested-With: XMLHttpRequest" -H "Connection: keep-alive" -H "Cookie: DhWebClientSessionID=e5f06ef1810067d6e3437f2af897e3dd; username=admin; DHVideoWHMode=Original"%"20Rate" --data "{""method"":""devVideoDetect.factory.instance"",""params"":{""channel"":0},""id"":279,""session"":""e5f06ef1810067d6e3437f2af897e3dd""}"


Then attach motion data. Mind that the object is the factory request's reply's "result" parameter.

Code: Select all

curl "http://0.0.0.0/RPC2" -H "User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:60.0) Gecko/20100101 Firefox/60.0" -H "Accept: application/json, text/javascript, */*; q=0.01" -H "Accept-Language: en-GB,en;q=0.5" --compressed -H "Referer: http://0.0.0.0/" -H "Content-Type: application/x-www-form-urlencoded; charset=UTF-8" -H "X-Requested-With: XMLHttpRequest" -H "Connection: keep-alive" -H "Cookie: DhWebClientSessionID=e5f06ef1810067d6e3437f2af897e3dd; username=admin; DHVideoWHMode=Original"%"20Rate" --data "{""method"":""devVideoDetect.attachMotionData"",""params"":{""proc"":1},""id"":342,""session"":""e5f06ef1810067d6e3437f2af897e3dd"",""object"":396503800}"


Then you can receive the video motion data stream. On newer cameras:

Code: Select all

curl "http://0.0.0.0/SubscribeNotify.cgi?sessionId=e5f06ef1810067d6e3437f2af897e3dd" -H "User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:60.0) Gecko/20100101 Firefox/60.0" -H "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8" -H "Accept-Language: en-GB,en;q=0.5" --compressed -H "Referer: http://0.0.0.0/" -H "Connection: keep-alive" -H "Cookie: DhWebClientSessionID=e5f06ef1810067d6e3437f2af897e3dd; username=admin; DHVideoWHMode=Original"%"20Rate" -H "Upgrade-Insecure-Requests: 1"


On older cameras:

Code: Select all

curl "http://0.0.0.0/cgi-bin/videomotion.cgi?sessionId=e5f06ef1810067d6e3437f2af897e3dd" -H "User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:60.0) Gecko/20100101 Firefox/60.0" -H "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8" -H "Accept-Language: en-GB,en;q=0.5" --compressed -H "Referer: http://0.0.0.0/" -H "Connection: keep-alive" -H "Cookie: DhWebClientSessionID=e5f06ef1810067d6e3437f2af897e3dd; username=admin; DHVideoWHMode=Original"%"20Rate" -H "Upgrade-Insecure-Requests: 1"


If your camera has a web interface that shows a video motion data graph, this is where it's getting its data from. You can use your browser's network inspector to see the entire exchange.

Ynot
Posts: 11
Joined: Sun Mar 17, 2019 6:32 pm

Re: HTTP API motion detection area?

Postby Ynot » Wed Mar 27, 2019 10:10 am

I use "wget -O- -q --user=user --password=password http://192.168.1.4/cgi-bin/... " and parse the results. As already mentioned, the Amcrest HTTP API has no "videomotion.cgi" or "SubscribeNotify.cgi", so I don't understand your usage of them. I'd be grateful if we could discuss the Amcrest HTTP API rather than Dahua's.

DahuaMotionDetect
Posts: 4
Joined: Sun Mar 24, 2019 5:38 am

Re: HTTP API motion detection area?

Postby DahuaMotionDetect » Thu Mar 28, 2019 12:26 am

* Go to "Video Detect" on the web interfaceas described by Amcrest Support
* Press F12 to open the browser's developer tools, select the network tab. You will see a lot of network traffic, but you'll be able to go over each request quickly. You'll find XHR requests to RPC2_Login and RPC2 exactly as I described above.
* Click "Event". Any URLs for the event stream (sparse) will be displayed as network requests in the developer tools pane.
* Click "Video Detection" and then "Detection Area". Any URLs for the video motion detect stream (detailed) will be displayed as network requests in the developer tools pane.

This will give you all the requests you need to make to get receive motion detection events from the event stream or the video motion detection stream.

Ynot
Posts: 11
Joined: Sun Mar 17, 2019 6:32 pm

Re: HTTP API motion detection area?

Postby Ynot » Fri Mar 29, 2019 2:58 pm

The Amcrest Web Viewer on Linux doesn't have an F12 function in "Event->Video Detection", as it isn't a "browser".

DahuaMotionDetect
Posts: 4
Joined: Sun Mar 24, 2019 5:38 am

Re: HTTP API motion detection area?

Postby DahuaMotionDetect » Tue Apr 02, 2019 8:10 am



Return to “General Security Chat”

Who is online

Users browsing this forum: No registered users and 1 guest