There is a raspberry pi to which the genius WideCam 1050 is connected.

It is required to process video from the camera, however, it does not pull 30 fps and the frames are far behind.

I tried to change fps in opencv itself ( , cv2 ) using set , but it gives an error that the CV_CAP_PROP_FPS flag CV_CAP_PROP_FPS not found.

I tried to directly specify 5 , but fps remains the same.

I found information in Google that fps changes in v4l2 command "v4l2-ctl -p %fps%" , but for me, whatever fps I specify, it gives a message that fps is 30.000 installed. At least 10, at least 60 - still puts 30.

Could there be a reason in the camera? Or is it possible to somehow clear the frame buffer in opencv so that when reading a frame, the current one is read, and not the one that was received a couple of seconds ago?

    1 answer 1

    The available settings of the connected camera (including fps) can be viewed and tried to change through the guvcview program. Depending on the specific camera model and drivers installed in the system, various options will be available. At the very least, this will allow us to understand whether the case is in the cell.

    This is not the best option, but getting a snapshot that is current in time can be reduced to getting the first snapshot after creating a VideoCapture instance with a subsequent call to the release () method in a loop.

     from time import sleep import numpy as np import cv2 while(True): cap = cv2.VideoCapture(0) ret, frame = cap.read() gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY) cv2.imshow('frame',gray) cap.release() sleep(0.1) # Time in seconds. cv2.destroyAllWindows()