Camera api

class, name, **kwargs)
property fps

Frames to capture per second


abstract method

property height

Height of images to capture


Abstract method that is called by when one of the controller inputs change.

You can implement this method if your controller logic needs to respond changes in multiple inputs.


changed_input (KerviValue) – Input that has changed. You can read the value of the changed input via the inputs value property.

Links this camera to a dashboard section or to the background of a dashboard.

  • dashboard_id – id of the dashboard to link to.

  • section_id (str) – id of the section.

  • **kwargs – Use the kwargs below to override default values set in ui_parameters

Keyword Arguments
  • ui_size (int) – Size of the component in dashboard unit size.

    In order to make the sections and components align correct a dashboard unit is defined. Default the dashboard unit is a square that is 150 x 150 pixels. The width of the camera picture is ui_size * dashboard unit size.

  • show_buttons (bool) – Add this component to header of section.

  • show_pan_tilt (bool) – Add this component to header of section.


abstract method

property source

How to connect to this camera


abstract method

property width

Width of images to capture

class, name, camera_source=None, **kwargs)

Camera controller that streams video to the ui.

  • camera_id (str) – Id of the camera. The id is used to reference the camera in other parts of the kervi application.

  • name (str) – Name of the camera used in ui.

  • camera_source (The name of the camera source to use.) – A frame driver that is used to capture frames from a camera.

  • **kwargs – See below

Keyword Arguments
  • height (int) –

    Height of video frame. Default value is 480.

  • width (int) –

    Width of video frame. Default value is 640.

  • fps (int) –

    Frames per second.


Abstract method that is called when a new frame is ready from the camera. You can use this method to post process images before they are streamed.

get_font(name='Fanwood', size=16)

Returns a font that can be used by pil image functions. This default font is “Fanwood” that is available on all platforms.


Base class for camera drivers that grap frames from a camera and streams them via the FrameCamera class. Could be used with the Raspberry PI camera. Fill in the abstract method capture_frames with functionality that graps frames from the camera and feeds them to the streamer. Frames must be pil images.


Abstract method use it like the run method in a thread. capture frames from camera until the flag self.terminate is True. captured frames should be passed to the method frame_ready.


Call this method when a frame is ready


Abstract method that should initiate a recording and save it to file_name


Abstract method that should stop active recording


Waits for next frame.

class, name, dashboards, source)
class, name, dashboards, source)