Upgrade camera to support libcamerasrc
Author: michele-comitiniCreated Jun 3, 2026Updated Jun 5, 2026
Software Versions
- Python: 3.13+
- OS: PiOS Debian trixie
6.18.33+rpt-rpi-v8 #1 SMP PREEMPT Debian 1:6.18.33-1+rpt1 (2026-06-01) aarch64 GNU/Linux - Kivy: 2.3.1+
- Kivy installation method: any
Describe the bug
RPi camera is not working anymore. Camera() class with different providers (opencv, gi) is not working.
CameraGi() __init__() has a video_src parameter, but it is impossible to pass any parameters by using the standard kivy.uix Camera() class
Expected behavior Ability to read video frames from camera
rpicam-hello works.
To Reproduce
$ python kivy-examples/camera/main.pyCode and Logs and screenshots workaround by shadowing the kivy.core.camera.Camera definition.
# test_camera.py
from camera_providers.camera_libcamera_gi import CameraLibcameraGi as CoreCamera
# Now import the rest of kivy
from kivy.app import App
import kivy.uix.camera
kivy.uix.camera.CoreCamera = CoreCamera
class CamApp(App):
def build(self):
return kivy.uix.camera.Camera(index=0, resolution=(640, 480), play=True)
CamApp().run()# camera_providers/camera_libcamera_gi.py
from kivy.core.camera.camera_gi import CameraGi
class CameraLibcameraGi(CameraGi):
def __init__(self, **kwargs):
kwargs["video_src"] = "libcamerasrc"
super().__init__(**kwargs)Source: kivy/kivy