Look at the Picamera2 datasheet Section 7.2.3 Circular Output will probably point you in the right direction:
7.2.3. CircularOutput
The CircularOutput class is derived from the FileOutput and adds the ability to start a recording with video frames that
were from several seconds earlier. This is ideal for motion detection and security applications.
Statistics: Posted by rpdom — Sun Aug 03, 2025 10:51 pm