Version

Quick search

Table Of Contents

Camera

Core class for acquiring the camera and converting its input into a Texture.

Changed in version 1.10.0: The pygst and videocapture providers have been removed.

Changed in version 1.8.0: There is now 2 distinct Gstreamer implementation: one using Gi/Gst working for both Python 2+3 with Gstreamer 1.0, and one using PyGST working only for Python 2 + Gstreamer 0.10.

class kivy.core.camera.CameraBase(**kwargs)[source]

Bases: kivy.event.EventDispatcher

Abstract Camera Widget class.

Concrete camera classes must implement initialization and frame capturing to a buffer that can be uploaded to the gpu.

Parameters
index: int

Source index of the camera.

size: tuple (int, int)

Size at which the image is drawn. If no size is specified, it defaults to the resolution of the camera image.

resolution: tuple (int, int)

Resolution to try to request from the camera. Used in the gstreamer pipeline by forcing the appsink caps to this resolution. If the camera doesnt support the resolution, a negotiation error might be thrown.

Events
on_load

Fired when the camera is loaded and the texture has become available.

on_texture

Fired each time the camera texture is updated.

index

Source index of the camera

init_camera()[source]

Initialise the camera (internal)

resolution

Resolution of camera capture (width, height)

start()[source]

Start the camera acquire

stop()[source]

Release the camera

texture

Return the camera texture with the latest capture