diff --git a/camera_server.py b/camera_server.py index e879476..22e4a03 100644 --- a/camera_server.py +++ b/camera_server.py @@ -32,11 +32,15 @@ def apply_settings(frame): def capture_loop(): global current_frame - # Sur Pi Zero avec OV5647, /dev/video0 - cam = cv2.VideoCapture(0) - cam.set(cv2.CAP_PROP_FRAME_WIDTH, 1280) - cam.set(cv2.CAP_PROP_FRAME_HEIGHT, 720) - cam.set(cv2.CAP_PROP_FPS, 15) + # Pipeline GStreamer pour CSI sur Pi Bookworm + pipeline = ( + "libcamerasrc ! " + "video/x-raw,width=1280,height=720,framerate=15/1 ! " + "videoconvert ! " + "video/x-raw,format=BGR ! " + "appsink drop=1" + ) + cam = cv2.VideoCapture(pipeline, cv2.CAP_GSTREAMER) if not cam.isOpened(): print("ERREUR : impossible d'ouvrir la caméra")