Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

commanding ip camera(onvif-ptz-control-python)

#!/usr/bin/python

#-------------------------------------------------------------------------------
#Test of Python and Quatanium Python-ONVIF with NETCAT camera PT-PTZ2087
#ONVIF Client implementation is in Python
#For IP control of PTZ, the camera should be compliant with ONVIF Profile S
#The PTZ2087 reports it is ONVIF 2.04 but is actually 2.4 (Netcat said text not changed after upgrade)
#------------------------------------------------------------------------------

import onvifconfig

if __name__ == '__main__':

    #Do all setup initializations
    ptz = onvifconfig.ptzcam()

#*****************************************************************************
# IP camera motion tests
#*****************************************************************************
    print 'Starting tests...'

    #Set preset
    ptz.move_pan(1.0, 1)  #move to a new home position
    ptz.set_preset('home')

    # move right -- (velocity, duration of move)
    ptz.move_pan(1.0, 2)

    # move left
    ptz.move_pan(-1.0, 2)

    # move down
    ptz.move_tilt(-1.0, 2)

    # Move up
    ptz.move_tilt(1.0, 2)

    # zoom in
    ptz.zoom(8.0, 2)

    # zoom out
    ptz.zoom(-8.0, 2)

    #Absolute pan-tilt (pan position, tilt position, velocity)
    #DOES NOT RESULT IN CAMERA MOVEMENT
    ptz.move_abspantilt(-1.0, 1.0, 1.0)
    ptz.move_abspantilt(1.0, -1.0, 1.0)

    #Relative move (pan increment, tilt increment, velocity)
    #DOES NOT RESULT IN CAMERA MOVEMENT
    ptz.move_relative(0.5, 0.5, 8.0)

    #Get presets
    ptz.get_preset()
    #Go back to preset
    ptz.goto_preset('home')

    exit()
Comment

PREVIOUS NEXT
Code Example
Python :: Obtener el valor ASCII de un carácter en Python 
Python :: how to assign a value to a key dictionary in a list python 
Python :: python opendatasets 
Python :: python notification image 
Python :: how to code a jumping function in python 
Python :: how do i make snake game using python for beginners without pygame 
Python :: pls work 
Python :: Parallel run of a function with multiple arguments partial 
Python :: get list of all document in django-elasticsearch-dsl 
Python :: vijay 
Python :: python remainder divide by 60 
Python :: python pseudocode IF, ELSE statement 
Python :: TypeError: get() takes 1 positional argument but 2 were given 
Python :: jumpssh execute multiple commands 
Python :: python geodata visualize 
Python :: where is memory and register in python python 
Python :: 1047 uri solution 
Python :: python vs python3 
Python :: string to 2d array python 
Python :: python list of all definitions in python file 
Python :: accessing list elements in python 
Python :: Python Tkinter Label Widget Syntax 
Python :: How to clear out a set in python 
Python :: page views count django 
Python :: python yield async awiat 
Python :: Python | Program to print duplicates from a list of integers 
Python :: packing a tuple 
Python :: python is not operator 
Python :: how to assign key and value to hash dictionary in python 
Python :: Dizideki en son elemani alma 
ADD CONTENT
Topic
Content
Source link
Name
8+2 =