Hi
My guess is that it's locking up because you're trying to use Picamera2 from two distinct processes. Neither Picamera2 nor libcamera that it is built on allow this. It would cause the internal state to get messed up and I would expect lock-ups and crashes.
Whilst there are ways of passing image buffers efficiently from one process to another, I think this is probably overkill in your case. Both video encoding and face detection will be spending most of their time inside C libraries during which the Python GIL (Global Interpreter Lock) should be released. This means that regular threads, all within the same process, would probably work for you. So I'd try replacing multiprocessing by threading and see how you get on.
My guess is that it's locking up because you're trying to use Picamera2 from two distinct processes. Neither Picamera2 nor libcamera that it is built on allow this. It would cause the internal state to get messed up and I would expect lock-ups and crashes.
Whilst there are ways of passing image buffers efficiently from one process to another, I think this is probably overkill in your case. Both video encoding and face detection will be spending most of their time inside C libraries during which the Python GIL (Global Interpreter Lock) should be released. This means that regular threads, all within the same process, would probably work for you. So I'd try replacing multiprocessing by threading and see how you get on.
Statistics: Posted by therealdavidp — Mon Jul 08, 2024 8:24 am