Skip to content

Latest commit

 

History

History
28 lines (28 loc) · 1.47 KB

README.md

File metadata and controls

28 lines (28 loc) · 1.47 KB

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!