generated from pavel.muhortov/template-bash
add hikvision templates
This commit is contained in:
parent
814c6db38b
commit
32efe22c33
40
info/hikvision/README.md
Normal file
40
info/hikvision/README.md
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
## How to use Hikvision templates in bash with curl
|
||||||
|
|
||||||
|
### `Define connection parameters`
|
||||||
|
```bash
|
||||||
|
camuser=user
|
||||||
|
campass=pass
|
||||||
|
camaddr=192.168.254.254
|
||||||
|
camport=80
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
### `Define action parameters`
|
||||||
|
> All variables beginning with **"@"** and ending with **"@"** must be changed to valid data.
|
||||||
|
> Request path, request type, content type are specified between **"\<!-- "** and **"-->"**.
|
||||||
|
|
||||||
|
Example of defining parameters from CGI "GetCapabilities" template:
|
||||||
|
```bash
|
||||||
|
dat=""
|
||||||
|
url=$(cat ./hikvision/template/cgi_GetCapabilities.html | grep 'PATH' | cut -d' ' -f3)
|
||||||
|
req=$(cat ./hikvision/template/cgi_GetCapabilities.html | grep 'METHOD' | cut -d' ' -f3)
|
||||||
|
```
|
||||||
|
Example of defining parameters from XML "SetTextOverlay" template:
|
||||||
|
```bash
|
||||||
|
dat=$(cat ./hikvision/template/xml_SetTextOverlay.xml)
|
||||||
|
dat=${dat//@ID@/1}
|
||||||
|
dat=${dat//@ENABLED@/true}
|
||||||
|
dat=${dat//@XXXX@/0}
|
||||||
|
dat=${dat//@YYYY@/0}
|
||||||
|
dat=${dat//@MSG@/"text"}
|
||||||
|
url=$(cat ./hikvision/template/xml_SetTextOverlay.xml | grep 'PATH' | cut -d' ' -f3)
|
||||||
|
url=${url//@CHANNEL@/101}
|
||||||
|
req=$(cat ./hikvision/template/xml_SetTextOverlay.xml | grep 'METHOD' | cut -d' ' -f3)
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
### `Send action request`
|
||||||
|
```bash
|
||||||
|
curl -d "$dat" -X "$req" "http://$camuser:$campass@$camaddr:$camport/$url"
|
||||||
|
```
|
||||||
|
|
3
info/hikvision/template/cgi_GetCapabilities.html
Normal file
3
info/hikvision/template/cgi_GetCapabilities.html
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
<!-- PATH: /ISAPI/PTZCtrl/channels/1/capabilities -->
|
||||||
|
<!-- METHOD: GET -->
|
||||||
|
<!-- TYPE: application/x-www-form-urlencoded -->
|
3
info/hikvision/template/cgi_GetJPEG.html
Normal file
3
info/hikvision/template/cgi_GetJPEG.html
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
<!-- PATH: /Streaming/channels/@ID@/picture?snapShotImageType=JPEG&videoResolutionWidth=@XXXX@&videoResolutionHeight=@YYYY@ -->
|
||||||
|
<!-- METHOD: GET -->
|
||||||
|
<!-- TYPE: application/x-www-form-urlencoded -->
|
3
info/hikvision/template/cgi_GetPosition.html
Normal file
3
info/hikvision/template/cgi_GetPosition.html
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
<!-- PATH: /ISAPI/PTZCtrl/channels/@CHANNEL@/status -->
|
||||||
|
<!-- METHOD: GET -->
|
||||||
|
<!-- TYPE: application/x-www-form-urlencoded -->
|
3
info/hikvision/template/cgi_GetReboot.html
Normal file
3
info/hikvision/template/cgi_GetReboot.html
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
<!-- PATH: /System/reboot -->
|
||||||
|
<!-- METHOD: GET -->
|
||||||
|
<!-- TYPE: application/x-www-form-urlencoded -->
|
4
info/hikvision/template/cgi_PtzDown.html
Normal file
4
info/hikvision/template/cgi_PtzDown.html
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
<!-- PATH: /PTZ/channels/1/PTZControl?command=TILT_DOWN&speed=@SSSS@&mode=start -->
|
||||||
|
<!-- METHOD: GET -->
|
||||||
|
<!-- TYPE: application/x-www-form-urlencoded -->
|
||||||
|
<!-- SSSS: 1..7 -->
|
4
info/hikvision/template/cgi_PtzLeft.html
Normal file
4
info/hikvision/template/cgi_PtzLeft.html
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
<!-- PATH: /PTZ/channels/1/PTZControl?command=PAN_LEFT&speed=@SSSS@&mode=start -->
|
||||||
|
<!-- METHOD: GET -->
|
||||||
|
<!-- TYPE: application/x-www-form-urlencoded -->
|
||||||
|
<!-- SSSS: 1..7 -->
|
4
info/hikvision/template/cgi_PtzPreset.html
Normal file
4
info/hikvision/template/cgi_PtzPreset.html
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
<!-- PATH: /PTZ/channels/1/PTZControl?command=GOTO_PRESET&presetNo=@ID@&speed=@SSSS@&mode=start -->
|
||||||
|
<!-- METHOD: GET -->
|
||||||
|
<!-- TYPE: application/x-www-form-urlencoded -->
|
||||||
|
<!-- SSSS: 1..7 -->
|
4
info/hikvision/template/cgi_PtzRight.html
Normal file
4
info/hikvision/template/cgi_PtzRight.html
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
<!-- PATH: /PTZ/channels/1/PTZControl?command=PAN_RIGHT&speed=@SSSS@&mode=start -->
|
||||||
|
<!-- METHOD: GET -->
|
||||||
|
<!-- TYPE: application/x-www-form-urlencoded -->
|
||||||
|
<!-- SSSS: 1..7 -->
|
3
info/hikvision/template/cgi_PtzStop.html
Normal file
3
info/hikvision/template/cgi_PtzStop.html
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
<!-- PATH: /PTZ/channels/1/PTZControl?command=GOTO_PRESET&mode=stop -->
|
||||||
|
<!-- METHOD: GET -->
|
||||||
|
<!-- TYPE: application/x-www-form-urlencoded -->
|
4
info/hikvision/template/cgi_PtzUp.html
Normal file
4
info/hikvision/template/cgi_PtzUp.html
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
<!-- PATH: /PTZ/channels/1/PTZControl?command=TILT_UP&speed=@SSSS@&mode=start -->
|
||||||
|
<!-- METHOD: GET -->
|
||||||
|
<!-- TYPE: application/x-www-form-urlencoded -->
|
||||||
|
<!-- SSSS: 1..7 -->
|
4
info/hikvision/template/cgi_PtzZoomIn.html
Normal file
4
info/hikvision/template/cgi_PtzZoomIn.html
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
<!-- PATH: /PTZ/channels/1/PTZControl?command=ZOOM_OUT&speed=@SSSS@&mode=start -->
|
||||||
|
<!-- METHOD: GET -->
|
||||||
|
<!-- TYPE: application/x-www-form-urlencoded -->
|
||||||
|
<!-- SSSS: 1..7 -->
|
4
info/hikvision/template/cgi_PtzZoomOut.html
Normal file
4
info/hikvision/template/cgi_PtzZoomOut.html
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
<!-- PATH: /PTZ/channels/1/PTZControl?command=ZOOM_IN&speed=@SSSS@&mode=start -->
|
||||||
|
<!-- METHOD: GET -->
|
||||||
|
<!-- TYPE: application/x-www-form-urlencoded -->
|
||||||
|
<!-- SSSS: 1..7 -->
|
12
info/hikvision/template/xml_GoAbsolute.xml
Normal file
12
info/hikvision/template/xml_GoAbsolute.xml
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<PTZData>
|
||||||
|
<AbsoluteHigh>
|
||||||
|
<elevation>@YYYY@</elevation>
|
||||||
|
<azimuth>@XXXX@</azimuth>
|
||||||
|
<absoluteZoom>@ZZZZ@</absoluteZoom>
|
||||||
|
</AbsoluteHigh>
|
||||||
|
</PTZData>
|
||||||
|
<!-- PATH: /ISAPI/PTZCtrl/channels/@CHANNEL@/absolute -->
|
||||||
|
<!-- METHOD: PUT -->
|
||||||
|
<!-- TYPE: text/xml -->
|
||||||
|
<!-- XXXX: 0..3600 YYYY: -900..2700 ZZZZ: 0..1000 -->
|
12
info/hikvision/template/xml_GoContinuous.xml
Normal file
12
info/hikvision/template/xml_GoContinuous.xml
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<PTZData>
|
||||||
|
<pan>@XXXX@</pan>
|
||||||
|
<tilt>@YYYY@</tilt>
|
||||||
|
<zoom>@ZZZZ@</zoom>
|
||||||
|
</PTZData>
|
||||||
|
<!-- PATH: /ISAPI/PTZCtrl/channels/@CHANNEL@/continuous -->
|
||||||
|
<!-- METHOD: PUT -->
|
||||||
|
<!-- TYPE: text/xml -->
|
||||||
|
<!-- XXXX: -100..100 YYYY: -100..100 ZZZZ: -100..100 -->
|
||||||
|
<!-- x360* = 3300..10 sec x1* = 9,167..0,028 sec -->
|
||||||
|
<!-- Max action time: 180sec -->
|
5
info/hikvision/template/xml_GoHomeposition.xml
Normal file
5
info/hikvision/template/xml_GoHomeposition.xml
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<PTZData></PTZData>
|
||||||
|
<!-- PATH: /ISAPI/PTZCtrl/channels/@CHANNEL@/homeposition/goto -->
|
||||||
|
<!-- METHOD: PUT -->
|
||||||
|
<!-- TYPE: text/xml -->
|
13
info/hikvision/template/xml_GoMomentary.xml
Normal file
13
info/hikvision/template/xml_GoMomentary.xml
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<PTZData>
|
||||||
|
<pan>@XXXX@</pan>
|
||||||
|
<tilt>@YYYY@</tilt>
|
||||||
|
<zoom>@ZZZZ@</zoom>
|
||||||
|
<Momentary>
|
||||||
|
<duration>@TTTT@</duration>
|
||||||
|
</Momentary>
|
||||||
|
</PTZData>
|
||||||
|
<!-- PATH: /ISAPI/PTZCtrl/channels/@CHANNEL@/momentary -->
|
||||||
|
<!-- METHOD: PUT -->
|
||||||
|
<!-- TYPE: text/xml -->
|
||||||
|
<!-- XXXX: -100..100 YYYY: -100..100 ZZZZ: -100..100 TTTT: -->
|
5
info/hikvision/template/xml_SetHomeposition.xml
Normal file
5
info/hikvision/template/xml_SetHomeposition.xml
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<PTZData></PTZData>
|
||||||
|
<!-- PATH: /ISAPI/PTZCtrl/channels/@CHANNEL@/homeposition -->
|
||||||
|
<!-- METHOD: PUT -->
|
||||||
|
<!-- TYPE: text/xml -->
|
13
info/hikvision/template/xml_SetTextOverlay.xml
Normal file
13
info/hikvision/template/xml_SetTextOverlay.xml
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<TextOverlayList version="1.0" xmlns="http://www.hikvision.com/ver10/XMLSchema">
|
||||||
|
<TextOverlay>
|
||||||
|
<id>@ID@</id>
|
||||||
|
<enabled>@ENABLED@</enabled>
|
||||||
|
<posX>@XXXX@</posX>
|
||||||
|
<posY>@YYYY@</posY>
|
||||||
|
<message>@MSG@</message>
|
||||||
|
</TextOverlay>
|
||||||
|
</TextOverlayList>
|
||||||
|
<!-- PATH: /Video/inputs/channels/@CHANNEL@/overlays/text -->
|
||||||
|
<!-- METHOD: PUT -->
|
||||||
|
<!-- TYPE: text/xml -->
|
Loading…
Reference in New Issue
Block a user