windless1015 / python-onvif

control hikcamera using onvif test code

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

python-onvif

test code to control hikcamera using onvif

Requirement

  1. python-onvif-zeep
  2. opencv-python
pip install onvif_zeep
pip install opencv-python

Introduction

The move.py can achieve move function like absolute move and relate move (including up,down,left and right four axises), meanwhile, it uses functional language. And the ptz_control.py can achieve get configurations, move, goto presets, etc. It uses oop(Object Oriented Programming). You can chooses the style you like.

Using

For move.py, you need to change this line as your ip, passwd and username. Then you can run

python move.py

and see camera move successfully if connecting. And for ptz_control.py, your should replace this line 's ip, username, passwd ans port as yours, and you can write your own main function like this :

if __name__ == '__main__':
    ptz = ptzControl()
    ptz.goto_preset()
    ptz.zoom_relative(0.5,0.4)

Then run like this :

pyhton ptz_control.py

enjoy it!

About

control hikcamera using onvif test code

License:MIT License


Languages

Language:Python 100.0%