Ask Your Question

Revision history [back]

I'm also using ELP bw camera and setting the fourcc "MJPG" was the key for me, before that I could not set the fps. An addition to achieve high fps at higher resolutions, one may use: camera.set(cv2.CAP_PROP_CONVERT_RGB, 0) which will cause the v4l2 backend (be sure to compile opencv with v4l2 support enable and libv4l disabled) to skip the conversion from mjpeg to RGB. This will leave you with an unnusable buffer but now you can do: frame = cv2.imdecode(frame, cv2.IMREAD_GRAYSCALE); opposite to imdecode(frame, cv2.IMREAD_COLOR); that happens inside v4l2 and cv2.IMREAD_GRAYSCALE is twice as fast.