Python Library for Vivotek IP Cameras
Project description
python-vivotek
A Python library for Vivotek IP cameras.
Getting Started
Install
This library currently supports Python 3.4 and up.
pip3 install libpyvivotek
# Or for only the current user
pip3 install --user libpyvivotek
Usage
from libpyvivotek import VivotekCamera
cam = VivotekCamera(host='192.168.1.123', port=443, usr='user', pwd='passw0rd',
digest_auth=True, ssl=True, verify_ssl=True, sec_lvl='admin')
print("Camera model is %s" % cam.model_name)
# Camera model is IB8369A
Security Level
Four security levels are currently supported:
- anonymous
- viewer
- operator
- admin
Using the anonymous
security level does not require a user or password. The operator
or admin
security level is required to set parameters.
Load password from Keyring
We can use Python Keyring to load the password rather than from a string.
# Install the package
pip install --user keyring
# Set the password using the command-line interface.
python -m keyring set camera user passw0rd
import keyring
from libpyvivotek import VivotekCamera
cam = VivotekCamera(host='192.168.1.123', port=443, usr='user',
pwd=keyring.get_password('camera', 'user'))
print("Camera model is %s" % cam.model_name)
# Camera model is IB8369A
View a snapshot image
We can optionally specify the image quality to snapshot()
from 1 to 5 with a default of 3.
from libpyvivotek import VivotekCamera
from PIL import Image
from io import BytesIO
import keyring
cam = VivotekCamera(host='192.168.1.123', port=443, usr='user',
pwd=keyring.get_password('camera', 'user'))
snapshot = Image.open(BytesIO(cam.snapshot(quality=3)))
snapshot.show()
Getting parameters
cam.get_param('capability_api_httpversion')
# "0311b_1"
cam.get_param('capability_naudioin')
# "0"
cam.get_param('capability_protocol_https')
# "1"
cam.get_param('event_i0_enable')
# "1"
cam.get_param('motion_c0_enable')
# "1"
Setting parameters
cam.set_param('event_i0_enable', 1)
# "1"
cam.set_param('event_i0_enable', 0)
# "0"
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
libpyvivotek-0.4.0.tar.gz
(3.8 kB
view details)
Built Distribution
File details
Details for the file libpyvivotek-0.4.0.tar.gz
.
File metadata
- Download URL: libpyvivotek-0.4.0.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4deecfc1ee517c70f5327319770c49ec077e3100b1c234591bbb9a31c6639e9b |
|
MD5 | 39abf2a8863b5a91805f481ef7558b62 |
|
BLAKE2b-256 | d90d0fa80b1b3cb707eed1a52da6f6e2fcdefeb108d0ef8219d94291af587895 |
File details
Details for the file libpyvivotek-0.4.0-py3-none-any.whl
.
File metadata
- Download URL: libpyvivotek-0.4.0-py3-none-any.whl
- Upload date:
- Size: 16.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 19556df03fd72ced230f84f006e9edfc983c9619431725965bf9a698bb49469d |
|
MD5 | a9349a4b32e92f782d9856f499337309 |
|
BLAKE2b-256 | 822864888057c3ab9b2f07922d2db7be5c28b5690790af36806858c67db7ac16 |