camera.gstreamer#

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

Bases: CameraPlugin

Plugin to interact with a camera over GStreamer.

Requires:

  • gst-python

  • pygobject

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: str | None = '/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: GStreamerCamera, *_, **__) PIL.Image.Image | None[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: GStreamerCamera) 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: 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: 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.