camera.ffmpeg
Platypush documentation
camera.ffmpeg
- class platypush.plugins.camera.ffmpeg.CameraFfmpegPlugin(device: Optional[str] = '/dev/video0', input_format: str = 'v4l2', ffmpeg_args: Tuple[str] = (), **opts)[source]
Bases:
CameraPlugin
Plugin to interact with a camera over FFmpeg.
Requires:
ffmpeg package installed on the system.
- __init__(device: Optional[str] = '/dev/video0', input_format: str = 'v4l2', ffmpeg_args: Tuple[str] = (), **opts)[source]
- Parameters:
device – Path to the camera device (default:
/dev/video0
).input_format – FFmpeg input format for the the camera device (default:
v4l2
).ffmpeg_args – Extra options to be passed to the FFmpeg executable.
opts – Camera options - see constructor of
platypush.plugins.camera.CameraPlugin
.
- capture_frame(camera: FFmpegCamera, *args, **kwargs) Optional[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: FFmpegCamera) Popen [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: FFmpegCamera)[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.