camera.pi
Platypush documentation
camera.pi
- class platypush.backend.camera.pi.CameraPiBackend(listen_port, bind_address='0.0.0.0', x_resolution=640, y_resolution=480, redis_queue='platypush/camera/pi', start_recording_on_startup=True, framerate=24, hflip=False, vflip=False, sharpness=0, contrast=0, brightness=50, video_stabilization=False, iso=0, exposure_compensation=0, exposure_mode='auto', meter_mode='average', awb_mode='auto', image_effect='none', color_effects=None, rotation=0, crop=(0.0, 0.0, 1.0, 1.0), **kwargs)[source]
Bases:
Backend
Backend to interact with a Raspberry Pi camera. It can start and stop recordings and take pictures. It can be programmatically controlled through the
platypush.plugins.camera.pi
plugin. Note that the Redis backend must be configured and running to enable camera control.Requires:
picamera (
pip install picamera
)
This backend is DEPRECATED. Use the plugin
platypush.plugins.camera.pi.CameraPiPlugin
instead to run Pi camera actions. If you want to start streaming the camera on application start then simply create an event hook onplatypush.message.event.application.ApplicationStartedEvent
that runscamera.pi.start_streaming
.- __init__(listen_port, bind_address='0.0.0.0', x_resolution=640, y_resolution=480, redis_queue='platypush/camera/pi', start_recording_on_startup=True, framerate=24, hflip=False, vflip=False, sharpness=0, contrast=0, brightness=50, video_stabilization=False, iso=0, exposure_compensation=0, exposure_mode='auto', meter_mode='average', awb_mode='auto', image_effect='none', color_effects=None, rotation=0, crop=(0.0, 0.0, 1.0, 1.0), **kwargs)[source]
See https://www.raspberrypi.org/documentation/usage/camera/python/README.md for a detailed reference about the Pi camera options.
- run()[source]
Starts the backend thread. To be implemented in the derived classes if the loop method isn’t defined.