device.camera_device module

class device.camera_device.CameraDevice(device='/dev/video0', port=5200, quality='medium', noviewer_timeout=30, **kwargs)[source]

Bases: HardwareBase

Stream camera video at http://this-ip-address:5200/stream.mpjpeg [Low latency 500ms-1000ms]

Additionally, the stream can be encoded (h264) and send over RTMP to a remote streaming service for large audiences (e.g. YouTube Livestreams). [High latency 10-40s]

Use watching() and check_watching() methods to automatically stop the video stream when nobody is watching.

check_watching()[source]

Call this method periodically (background task) to check if somebody was recently watching the video feed. If no watching() call took place during the specified noviewer_timeout, the video stream is stopped.

is_rtmp_running()[source]
is_video_running()[source]
property quality
property quality_options
set_quality(quality)[source]
start_rtmp_stream(rtmp_url, key)[source]
start_video()[source]
stop_rtmp_stream()[source]
stop_video()[source]
watching()[source]

Users can call this method periodically to signalize that they are (still) watching the video stream. See check_watching() for more info.

This method also starts the camera stream if not yet running.