Segmentation error / Valuerror when using camera.capture

1.Which seller did you purchase the product(s) from?
2.The Model number of the product(s) you have purchased?
Arducam IMX298 MIPI 16MP Color Camera Module for Raspberry Pi 4/3B+/3
3.Which Platform are you using the product(s) on?
Raspberry Pi 3B+
4.Which instruction are you following?
Github sdk library examples
5.Has your product ever worked properly?
Yes it works.
6.What problems are you experiencing?
I´m writting an application on python that needs to run 24/7 reading some aruco markers with openCV and writting those id´s on an mysql server.

I based my code on the example, i´m using mode 2 and the image runs at about 2fps but that is not the main problem.

my 2 main problems are the following:

1.- Watching the code run for a long period of time i randomly get a Valuerror at the moment i try to use the method camera.capture(), i implemented a try-except block catching that error re-asigning the camera object and re-setting the controls (exposure, awb, etc). Sometimes it works but most of the time just keeps failing and crashes the program.

2.- When the camera doesn´t return this ValueError after about a day i get a segmentation fault crashing again the program

I attach an image of the problems i get.

7.What attempts at troubleshooting have you already made?
Implementing some try-except and reconfiguring the camera object.
8.How would you like us to help you?
Some possible solutions to my 2 problems so that i can get the code running indifinetly

Sorry to reply to you so late, there is a problem with our forum service system, it has been fixed now, has your problem been solved? Please feel free to let me know if you need more help.

We have updated our lib and you can download our latest lib to test.


Hi ,


I have exactly the same problem as OP. When I am taking pictures in a loop, I got random a Segmentation fault, which crashes whole script.


How can I prevent that?
I dowloaded 2 days ago your libs, so I presume they are the latest. I have Rpi 4 and using IMX298 camera






Can we get any update on that problem?



Did anybody find an answer to this problem? I get the same thing using AR1820HS on Rpi4 32bit Buster OS.


The Raspberry Pi has been completely upgraded. We follow the latest trend, also from the original MIPIcamera upgrade to the current libcamera. We recommend you use the Bullseye system.