camera.gstreamer

class platypush.plugins.camera.gstreamer.CameraGstreamerPlugin(device: Optional[str] = '/dev/video0', **opts)[source]

Plugin to interact with a camera over GStreamer.

Requires:

  • gst-python

On Debian and derived systems:

  • [sudo] apt-get install python3-gi python3-gst-1.0

On Arch and derived systems:

  • [sudo] pacman -S gst-python

__init__(device: Optional[str] = '/dev/video0', **opts)[source]
Parameters
  • device – Path to the camera device (default /dev/video0).

  • opts – Camera options - see constructor of platypush.plugins.camera.CameraPlugin.

capture_frame(camera: platypush.plugins.camera.gstreamer.model.GStreamerCamera, *args, **kwargs) Optional[PIL.Image.Image][source]

Capture a frame from a device using the plugin-specific logic - to be implemented by the derived classes.

Parameters

device – An initialized platypush.plugins.camera.Camera object.

prepare_device(camera: platypush.plugins.camera.gstreamer.model.GStreamerCamera) platypush.common.gstreamer.Pipeline[source]

Prepare a device using the plugin-specific logic - to be implemented by the derived classes.

Parameters

device – An initialized platypush.plugins.camera.Camera object.

release_device(camera: platypush.plugins.camera.gstreamer.model.GStreamerCamera)[source]

Release a device using the plugin-specific logic - to be implemented by the derived classes.

Parameters

device – An initialized platypush.plugins.camera.Camera object.

start_camera(camera: platypush.plugins.camera.gstreamer.model.GStreamerCamera, preview: bool = False, *args, **kwargs)[source]

Start a camera capture session.

Parameters
  • camera – An initialized platypush.plugins.camera.Camera object.

  • preview – Show a preview of the camera frames.