I'm working on a project with Raspberry Pi 3 and camera module v2.

I'm using OpenCV and raspicam.

I want to know the maximum resolution I can use. The datasheet says 3280*2464, but I get errors when using that resolution:

mmal: mmal_vc_port_enable: failed to enable port vc.ril.camera:out:1(BGR3): ENOSPC
mmal: mmal_port_enable: failed to enable port vc.ril.camera:out:1(BGR3)(0x2022b60) (ENOSPC)
camera video callback2 erroropen Failed to create camera component/home/pi/repo/raspicam/src/private/private_impl.cpp 103

1920*1920 works fine, but I would like to know exactly how high my resolution can be before I get the error.

How can I debug the error message provided? And how can I know the the maximum resolution of the camera before I get the error message? (Please don't suggest trial-and-error)


From raspicam , Release notes:

Note: when using the full resolution video callbacks with the full resolution of the Raspberry Pi Camera v2, you will likely get an error such as mmal: mmal_vc_port_enable: failed to enable port vc.ril.camera:out:1(BGR3): ENOSPC. In order to fix this increase your GPU memory to at least 256MB.

  • My question is regarding image in general, not necessarily video. Datasheet claims 3280*2464. I will try the trick with setting a too high resolution (your latest link) to make opencv automatically set the highest one, but I'm not entirely convinced it will work (since I get the error when it's too high).
    – birgersp
    Mar 9 '20 at 8:10
  • @gromit190, please see my new edited answer.
    – Ephemeral
    Mar 9 '20 at 8:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.