libcamera icon indicating copy to clipboard operation
libcamera copied to clipboard

Check for unsupported pixel format

Open doug-holtsinger opened this issue 1 year ago • 3 comments

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 avatar Dec 08 '24 17:12 doug-holtsinger

@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?

naushir avatar Dec 09 '24 09:12 naushir

Also, can you post the output of dmesg when the error occurs to see if the kernel driver is complaining about anything?

naushir avatar Dec 09 '24 09:12 naushir

Also, can you post the output of dmesg when 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

doug-holtsinger avatar Dec 10 '24 02:12 doug-holtsinger

This should now be fixed upstream I believe.

naushir avatar Jun 03 '25 08:06 naushir