4

I was wondering if there was a way to increase the speed at which images are written to memory using raspistill? This is for an opencv project where i would like to test various filters against recorded footage one frame at a time. So instead of making a video then extracting the frames, I was wondering if I just simply have 20 images written per second.

However I notice that it is skipping frames quite frequently and is taking images at roughly 1 frame per second instead of 2.

time raspistill -o test.jpg --timeout 1 results in

real 0m0.784s
user 0m0.000s
sys 0m0.040s

Is there any way around this? :/

1
  • Have a look at my answer to a similar question - raspistill's use of the still port makes it necessarily slow. If you want to get it over 1fps you'll need to modify it (or preferably modify raspividyuv as it's probably closer to what you need)
    – Dave Jones
    Commented Jul 6, 2016 at 14:10

1 Answer 1

1

From the Raspberry Pi camera module docs:

--timelapse, -tl time-lapse mode.

The specific value is the time between shots in milliseconds. Note you should specify %04d at the point in the filename where you want a frame count number to appear. e.g:

-t 30000 -tl 2000 -o image%04d.jpg

will produce a capture every 2 seconds, over a total period of 30s, named image0001.jpg, image0002.jpg..image0015.jpg. Note that the %04d indicates a 4 digit number with leading zero's added to pad to the required number of digits. So, for example, %08d would result in an 8 digit number.

If a time-lapse value of 0 is entered, the application will take pictures as fast as possible. Note there is an minimum enforced pause of 30ms between captures to ensure that exposure calculations can be made.

It looks like the camera is just about capable of capturing at the rate you're looking for (50ms per image), although your actual rate may be impacted by other factors (SD card speed, image resolution, etc.).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.