Python Library for Foscam IP Cameras
Project description
Python Library for Foscam IP Cameras
Getting Started
Install
$ pip install python-foscam
Simple example
Here is a simple example to move camera lens up and stop after 1s.
from libpyfoscam import FoscamCamera
from time import sleep
mycam = FoscamCamera('192.168.0.113', 88, 'admin', 'superuser')
mycam.ptz_move_up()
sleep(1)
mycam.ptz_stop_run()
Asynchronous feature
This example uses the asynchronous feature provided by FoscamCamera.
Normally, a command is sent synchronously, waiting for results and blocking the main thread.
By initializing FoscamCamera with daemon=True (defaults to False), commands are sent asynchronously.
mycam = FoscamCamera('192.168.0.113', 88, 'admin', 'superuser', daemon=True)
mycam.get_ip_info()
mycam.get_port_info()
mycam.refresh_wifi_list()
Send command with callback
This example illustrates the use of a callback function when the command completes.
from libpyfoscam import FoscamCamera, FOSCAM_SUCCESS
def print_ipinfo(returncode, params):
if returncode != FOSCAM_SUCCESS:
print 'Failed to get IPInfo!'
return
print 'IP: %s, Mask: %s' % (params['ip'], params['mask'])
mycam = FoscamCamera('192.168.0.113', 88, 'admin', 'superuser', daemon=False)
mycam.get_ip_info(print_ipinfo)
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
libpyfoscam-1.2.tar.gz
(20.8 kB
view hashes)
Built Distribution
libpyfoscam-1.2-py3-none-any.whl
(20.2 kB
view hashes)
Close
Hashes for libpyfoscam-1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ecf8e63b73796c2164ec73bec597cc6f0b0a1f1f3811aff46f83b72d26dfe672 |
|
MD5 | c01d4afb671d51b1ea9de080f7083659 |
|
BLAKE2b-256 | 871b879b55add316826609b918936a47afa3e9c9927482a9b0f4aeeddd97c84e |