Skip to content
This repository was archived by the owner on Apr 5, 2025. It is now read-only.

Commit fb7eb15

Browse files
committed
Add PTZ examples
1 parent 9065764 commit fb7eb15

1 file changed

Lines changed: 92 additions & 0 deletions

File tree

doc/motionplus_examples.html

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ <h3><a name="Examples"></a> Examples</h3>
5757
<li> <a href="#haar_train">Haar Model Training</a></li>
5858
<li> <a href="#sound_sample">Sound Frequency Sample</a></li>
5959
<li> <a href="#fail2ban">Fail2Ban example</a></li>
60+
<li> <a href="#ptz">PTZ command examples</a></li>
6061
<p></p>
6162
<p></p>
6263
</ul>
@@ -502,6 +503,97 @@ <h3><a name="fail2ban"></a>Fail2Ban Example</h3>
502503
<br>Make sure to adjust the log file location indicated in the jail file as well as how long to ban the IP address.
503504
</ul>
504505

506+
<h3><a name="ptz"></a>PTZ command examples</h3>
507+
<ul>
508+
The following are some example sources and scripts to send PTZ (Pan Tilt Zoom) commands to cameras.
509+
<br><br>
510+
<a href="https://github.com/667bdrm/sofiactl">sofiactl</a> is a Perl script that can control many imported inexpensive cameras.
511+
<br> Adjust script location, timing, cameraip, user, etc as appropriate.
512+
<small><small><code><ul>
513+
<br>&nbsp;#!/bin/bash
514+
<br>&nbsp;&nbsp;sofiactl.pl --user admin --host cameraip --port 34567 --command OPPTZControl --sd ZoomTile --s2 0.5
515+
<br>&nbsp;&nbsp;sofiactl.pl --user admin --host cameraip --port 34567 --command OPPTZControl --sd ZoomWide --s2 0.5
516+
<br>&nbsp;&nbsp;sofiactl.pl --user admin --host cameraip --port 34567 --command OPPTZControl --sd DirectionUp --s2 2.0
517+
<br>&nbsp;&nbsp;sofiactl.pl --user admin --host cameraip --port 34567 --command OPPTZControl --sd DirectionDown --s2 2.0
518+
<br>&nbsp;&nbsp;sofiactl.pl --user admin --host cameraip --port 34567 --command OPPTZControl --sd DirectionLeft --s2 2.0
519+
<br>&nbsp;&nbsp;sofiactl.pl --user admin --host cameraip --port 34567 --command OPPTZControl --sd DirectionRight --s2 2.0
520+
<br>&nbsp;exit
521+
</ul></code></small></small>
522+
523+
<br>
524+
<a href="https://github.com/Mr-Dave/camxmctl">camxmctl</a> is a c++ program with a sample HTML page that makes adjusting the parameters
525+
easier. It reuses some of the code from Motionplus and is based upon the JSON files and commands in the
526+
<a href="https://github.com/667bdrm/sofiactl">sofiactl</a> script.
527+
<br> Adjust location, timing, cameraip, user, etc as appropriate.
528+
<small><small><code><ul>
529+
<br>&nbsp;#!/bin/bash
530+
<br>&nbsp;&nbsp; tbd. Review sample page to see post commands.
531+
<br>&nbsp;exit
532+
</ul></code></small></small>
533+
534+
<br>
535+
curl scripts. Example 1
536+
<br> Adjust as appropriate.
537+
<small><small><code><ul>
538+
<br>&nbsp;#!/bin/bash
539+
<br>&nbsp;&nbsp;curl -X PUT -H "Content-Type: application/x-www-form-urlencoded" -d 'Param1=1' http://admin@cameraip:80/PTZ/1/TurnDown
540+
<br>&nbsp;&nbsp;sleep 2
541+
<br>&nbsp;&nbsp;curl -X PUT -H "Content-Type: application/x-www-form-urlencoded" -d 'Param1=0' http://admin@cameraip:80/PTZ/1/TurnDown
542+
<br>&nbsp;exit
543+
<br>&nbsp;#!/bin/bash
544+
<br>&nbsp;&nbsp;curl -X PUT -H "Content-Type: application/x-www-form-urlencoded" -d 'Param1=1' http://admin@cameraip:80/PTZ/1/TurnLeft
545+
<br>&nbsp;&nbsp;sleep 2
546+
<br>&nbsp;&nbsp;curl -X PUT -H "Content-Type: application/x-www-form-urlencoded" -d 'Param1=0' http://admin@cameraip:80/PTZ/1/TurnLeft
547+
<br>&nbsp;exit
548+
<br>&nbsp;#!/bin/bash
549+
<br>&nbsp;&nbsp;curl -X PUT -H "Content-Type: application/x-www-form-urlencoded" -d 'Param1=1' http://admin@cameraip:80/PTZ/1/TurnRight
550+
<br>&nbsp;&nbsp;sleep 2
551+
<br>&nbsp;&nbsp;curl -X PUT -H "Content-Type: application/x-www-form-urlencoded" -d 'Param1=0' http://admin@cameraip:80/PTZ/1/TurnRight
552+
<br>&nbsp;exit
553+
<br>&nbsp;#!/bin/bash
554+
<br>&nbsp;&nbsp;curl -X PUT -H "Content-Type: application/x-www-form-urlencoded" -d 'Param1=1' http://admin@cameraip:80/PTZ/1/TurnUp
555+
<br>&nbsp;&nbsp;sleep 2
556+
<br>&nbsp;&nbsp;curl -X PUT -H "Content-Type: application/x-www-form-urlencoded" -d 'Param1=0' http://admin@cameraip:80/PTZ/1/TurnUp
557+
<br>&nbsp;exit
558+
</ul></code></small></small>
559+
560+
<br>
561+
curl scripts. Example 2
562+
<br> Adjust as appropriate.
563+
<small><small><code><ul>
564+
<br>&nbsp;#!/bin/bash
565+
<br>&nbsp;&nbsp;curl 'http://admin:admin@cameraip:80/web/cgi-bin/hi3510/ptzctrl.cgi?-step=0&-act=left&-speed=45'
566+
<br>&nbsp;&nbsp;sleep 1
567+
<br>&nbsp;&nbsp;curl 'http://admin:admin@cameraip:80/web/cgi-bin/hi3510/ptzctrl.cgi?-step=0&-act=stop&-speed=45'
568+
<br>&nbsp;exit
569+
<br>&nbsp;#!/bin/bash
570+
<br>&nbsp;&nbsp;curl 'http://admin:admin@cameraip:80/web/cgi-bin/hi3510/ptzctrl.cgi?-step=0&-act=right&-speed=45'
571+
<br>&nbsp;&nbsp;sleep 1
572+
<br>&nbsp;&nbsp;curl 'http://admin:admin@cameraip:80/web/cgi-bin/hi3510/ptzctrl.cgi?-step=0&-act=stop&-speed=45'
573+
<br>&nbsp;exit
574+
<br>&nbsp;#!/bin/bash
575+
<br>&nbsp;&nbsp;curl 'http://admin:admin@cameraip:80/web/cgi-bin/hi3510/ptzctrl.cgi?-step=0&-act=down&-speed=45'
576+
<br>&nbsp;&nbsp;sleep 1
577+
<br>&nbsp;&nbsp;curl 'http://admin:admin@cameraip:80/web/cgi-bin/hi3510/ptzctrl.cgi?-step=0&-act=stop&-speed=45'
578+
<br>&nbsp;exit
579+
<br>&nbsp;#!/bin/bash
580+
<br>&nbsp;&nbsp;curl 'http://admin:admin@cameraip:80/web/cgi-bin/hi3510/ptzctrl.cgi?-step=0&-act=up&-speed=45'
581+
<br>&nbsp;&nbsp;sleep 1
582+
<br>&nbsp;&nbsp;curl 'http://admin:admin@cameraip:80/web/cgi-bin/hi3510/ptzctrl.cgi?-step=0&-act=stop&-speed=45'
583+
<br>&nbsp;exit
584+
<br>&nbsp;#!/bin/bash
585+
<br>&nbsp;&nbsp;curl 'http://admin:admin@cameraip:80/web/cgi-bin/hi3510/ptzctrl.cgi?-step=0&-act=zoomin&-speed=45'
586+
<br>&nbsp;&nbsp;sleep 1
587+
<br>&nbsp;&nbsp;curl 'http://admin:admin@cameraip:80/web/cgi-bin/hi3510/ptzctrl.cgi?-step=0&-act=stop&-speed=45'
588+
<br>&nbsp;exit
589+
<br>&nbsp;#!/bin/bash
590+
<br>&nbsp;&nbsp;curl 'http://admin:admin@cameraip:80/web/cgi-bin/hi3510/ptzctrl.cgi?-step=0&-act=zoomout&-speed=45'
591+
<br>&nbsp;&nbsp;sleep 1
592+
<br>&nbsp;&nbsp;curl 'http://admin:admin@cameraip:80/web/cgi-bin/hi3510/ptzctrl.cgi?-step=0&-act=stop&-speed=45'
593+
<br>&nbsp;exit
594+
</ul></code></small></small>
595+
</ul>
596+
505597
</section>
506598
</body>
507599
</html>

0 commit comments

Comments
 (0)