Currently, if the camera fails, it will not recover. It will try to stop the video, but pkill returns status code != 0, so it thinks it did not stop, so it does not try to restart recording / taking pictures.
This is a minor issue (the program continues, and all the other components work perfectly), but we would lose all the video footage since the camera fail. We should try to recover the camera and record the rest of the footage.
Maybe we could have a thread check the recording status each x seconds and if it fails, restart the recording. On the other hand, when trying to take a picture, we could check if the raspivid process is still running, and if not, assume it has failed and try to recover it.
Currently, if the camera fails, it will not recover. It will try to stop the video, but pkill returns status code != 0, so it thinks it did not stop, so it does not try to restart recording / taking pictures.
This is a minor issue (the program continues, and all the other components work perfectly), but we would lose all the video footage since the camera fail. We should try to recover the camera and record the rest of the footage.
Maybe we could have a thread check the recording status each x seconds and if it fails, restart the recording. On the other hand, when trying to take a picture, we could check if the raspivid process is still running, and if not, assume it has failed and try to recover it.