Closed rossGardiner closed 3 years ago
https://picamera.readthedocs.io/en/release-1.13/api_streams.html#picamera.PiCameraCircularIO.copy_to
copy_to(output, size=None, seconds=None, first_frame=PiVideoFrameType.sps_header)
Warning Note that if a frame of the specified type (e.g. SPS header) cannot be found within the specified number of seconds or bytes then this method will simply copy nothing (but no error will be raised).
An RGB stream will never have any frames of type PiVideoFrameType.sps_header, so it will never copy any data.
stream_image.copy_to('before.dat', seconds=10, first_frame=PiVideoFrameType.frame)
is more likely to work.
Thank you
Hello,
I am trying to write a PiCamera application capable of the following after motion is detected:
I have assigned a
PiCameraCircularIO
buffer for both the rgb and h264 streams. When I copy data from the rgb buffer to file, thebefore.dat
file is always empty, whileafter.dat
,before.h264
andafter.h264
always contain data. My suspicion is this is because the data in the ring buffer is too large to copy to disk quickly, so I added a delay between copying and clearing the buffer. No avail.Can someone help?
Below I show a sketch of my application, based on one of the examples in the docs: