Check for unsupported pixel format
If an unsupported pixel format is handed to libcamera, then it hits an assertion error in pisp.cpp instead of returning a proper return code. The problem was originally seen here: https://github.com/opencv/opencv/issues/21653#issuecomment-1962788403 I can reproduce the same issue with the latest main branch of libcamera and opencv 4.x
@doug-holtsinger, thank you for this fix. However, I'm a bit surprised this is needed. Do you happen to know exactly what format is originally requested to cause the failure?
Also, can you post the output of dmesg when the error occurs to see if the kernel driver is complaining about anything?
Also, can you post the output of
dmesgwhen the error occurs to see if the kernel driver is complaining about anything?
Here is the dmesg: https://pastebin.com/KwRPPe28
There is a warning at line 384 but I can still use my RPi v3 camera just fine with libcamera using the YUYV format.
The failing requested format was libcamera::formats::MJPEG which is evidently not supported by my camera.
Output from 'cam -c1 -I' that lists supported Pixelformat and resolutions for my camera: https://pastebin.com/jg3KGGSX
This should now be fixed upstream I believe.