@@ -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 > #!/bin/bash
514+ < br > sofiactl.pl --user admin --host cameraip --port 34567 --command OPPTZControl --sd ZoomTile --s2 0.5
515+ < br > sofiactl.pl --user admin --host cameraip --port 34567 --command OPPTZControl --sd ZoomWide --s2 0.5
516+ < br > sofiactl.pl --user admin --host cameraip --port 34567 --command OPPTZControl --sd DirectionUp --s2 2.0
517+ < br > sofiactl.pl --user admin --host cameraip --port 34567 --command OPPTZControl --sd DirectionDown --s2 2.0
518+ < br > sofiactl.pl --user admin --host cameraip --port 34567 --command OPPTZControl --sd DirectionLeft --s2 2.0
519+ < br > sofiactl.pl --user admin --host cameraip --port 34567 --command OPPTZControl --sd DirectionRight --s2 2.0
520+ < br > 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 > #!/bin/bash
530+ < br > tbd. Review sample page to see post commands.
531+ < br > 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 > #!/bin/bash
539+ < br > curl -X PUT -H "Content-Type: application/x-www-form-urlencoded" -d 'Param1=1' http://admin@cameraip:80/PTZ/1/TurnDown
540+ < br > sleep 2
541+ < br > curl -X PUT -H "Content-Type: application/x-www-form-urlencoded" -d 'Param1=0' http://admin@cameraip:80/PTZ/1/TurnDown
542+ < br > exit
543+ < br > #!/bin/bash
544+ < br > curl -X PUT -H "Content-Type: application/x-www-form-urlencoded" -d 'Param1=1' http://admin@cameraip:80/PTZ/1/TurnLeft
545+ < br > sleep 2
546+ < br > curl -X PUT -H "Content-Type: application/x-www-form-urlencoded" -d 'Param1=0' http://admin@cameraip:80/PTZ/1/TurnLeft
547+ < br > exit
548+ < br > #!/bin/bash
549+ < br > curl -X PUT -H "Content-Type: application/x-www-form-urlencoded" -d 'Param1=1' http://admin@cameraip:80/PTZ/1/TurnRight
550+ < br > sleep 2
551+ < br > curl -X PUT -H "Content-Type: application/x-www-form-urlencoded" -d 'Param1=0' http://admin@cameraip:80/PTZ/1/TurnRight
552+ < br > exit
553+ < br > #!/bin/bash
554+ < br > curl -X PUT -H "Content-Type: application/x-www-form-urlencoded" -d 'Param1=1' http://admin@cameraip:80/PTZ/1/TurnUp
555+ < br > sleep 2
556+ < br > curl -X PUT -H "Content-Type: application/x-www-form-urlencoded" -d 'Param1=0' http://admin@cameraip:80/PTZ/1/TurnUp
557+ < br > 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 > #!/bin/bash
565+ < br > curl 'http://admin:admin@cameraip:80/web/cgi-bin/hi3510/ptzctrl.cgi?-step=0&-act=left&-speed=45'
566+ < br > sleep 1
567+ < br > curl 'http://admin:admin@cameraip:80/web/cgi-bin/hi3510/ptzctrl.cgi?-step=0&-act=stop&-speed=45'
568+ < br > exit
569+ < br > #!/bin/bash
570+ < br > curl 'http://admin:admin@cameraip:80/web/cgi-bin/hi3510/ptzctrl.cgi?-step=0&-act=right&-speed=45'
571+ < br > sleep 1
572+ < br > curl 'http://admin:admin@cameraip:80/web/cgi-bin/hi3510/ptzctrl.cgi?-step=0&-act=stop&-speed=45'
573+ < br > exit
574+ < br > #!/bin/bash
575+ < br > curl 'http://admin:admin@cameraip:80/web/cgi-bin/hi3510/ptzctrl.cgi?-step=0&-act=down&-speed=45'
576+ < br > sleep 1
577+ < br > curl 'http://admin:admin@cameraip:80/web/cgi-bin/hi3510/ptzctrl.cgi?-step=0&-act=stop&-speed=45'
578+ < br > exit
579+ < br > #!/bin/bash
580+ < br > curl 'http://admin:admin@cameraip:80/web/cgi-bin/hi3510/ptzctrl.cgi?-step=0&-act=up&-speed=45'
581+ < br > sleep 1
582+ < br > curl 'http://admin:admin@cameraip:80/web/cgi-bin/hi3510/ptzctrl.cgi?-step=0&-act=stop&-speed=45'
583+ < br > exit
584+ < br > #!/bin/bash
585+ < br > curl 'http://admin:admin@cameraip:80/web/cgi-bin/hi3510/ptzctrl.cgi?-step=0&-act=zoomin&-speed=45'
586+ < br > sleep 1
587+ < br > curl 'http://admin:admin@cameraip:80/web/cgi-bin/hi3510/ptzctrl.cgi?-step=0&-act=stop&-speed=45'
588+ < br > exit
589+ < br > #!/bin/bash
590+ < br > curl 'http://admin:admin@cameraip:80/web/cgi-bin/hi3510/ptzctrl.cgi?-step=0&-act=zoomout&-speed=45'
591+ < br > sleep 1
592+ < br > curl 'http://admin:admin@cameraip:80/web/cgi-bin/hi3510/ptzctrl.cgi?-step=0&-act=stop&-speed=45'
593+ < br > exit
594+ </ ul > </ code > </ small > </ small >
595+ </ ul >
596+
505597 </ section >
506598 </ body >
507599</ html >
0 commit comments