This post is related to Raspberry Pi camera randomly freezes / crashes SoC
I have exactly the same problem but my java app is continuously executing raspistill as a separate process. It reads the output stream and after that it executes again, but after 4 days it freezes. It always takes 4 days. To make sure that it is not problem with my app, I stop it and run the raspistill command manually (from the terminal). The LED goes red but the process never ends The problem appears on both my RPI 2Bs with different cameras (one is normal, second night) both version 1.3 and different ribbon cables. Only reboot of the RPi solves this problem.
One more point, when my app runs raspistill less often, then it fails after 7 days.
Just note, that I have performed update, upgrade...
Update:
my app runs command raspistill -o -v -w 1920 -h 1080 -n -drc off -ex sports -mm matrix -e jpg -ifx denoise -awb auto -t 1 -q 100
. I am using only the terminal to access the RPi, and my app is running as a service (systemd). Loginng in and logging out does not help in this case as I connected more then once to an RPi which was in failed state (means that raspistill could not capture a picture). Then I rebooted it. To reproduce it again I have to wait 4 days.
What I want to try this weeked is to run raspistill
command with timelapse (means raspistill will be executed only once by my app and will produce stream of .jpg pictures on its output). During reading of the output stream, I will have to distinguish between pictures but it should not be problem (.jpg pictures has some bytes at start and at the end).
Part of my java code is:
byte[] pictureData = null;
try (InputStream stream = p.getInputStream()) {
pictureData = IOUtils.toByteArray(stream);
}
return pictureData;