How to increase FPS in H7?

Hi!
Currently, I’m constantly taping 100 frames video in 640x480 resolution and saving it to microSD card and I got 11s of video, for those 100 frames - that’s <10FPS (!).
When i decrease resolution to 320x280, I get ~20FPS, that’s still not that much.
My camera is supposed to be working in low lighting enviroment (pipeline, to be clear), where there will be only lighting from external LEDs.
I’ve seen this reply,

It’s the lighting in the room. The camera will lower the FPS to improve exposure when there’s little lighting.

and I did testing in good lighting and it doubled my FPS, so I got around 20FPS (resolution 640x480), still it’s not 75FPS decleared my producent.
In my project I need high FPS, how can i increase it?

I’ve been working with OpenMV for a little time, so sorry if my questions are stupid :slight_smile:.
Here is also my code in case you need it:

import sensor, image, time, mjpeg, pyb, machine
from pyb import RTC

sensor.reset()                      # Reset and initialize the sensor.
sensor.set_pixformat(sensor.RGB565) # Set pixel format to RGB565 (or GRAYSCALE)
sensor.set_framesize(sensor.VGA)   # Set frame size to VGA (640x480) / QVGA (320x240)
sensor.skip_frames(time = 2000)     # Wait for settings take effect.
clock = time.clock()                # Create a clock object to track the FPS.
i = 0
red_led = pyb.LED(1)
green_led = pyb.LED(2)
blue_led = pyb.LED(3)

rtc = RTC()
rtc.datetime((2021, 7, 21, 3, 12, 0, 0, 0))

while(True):
    year = rtc.datetime()[0]
    month = rtc.datetime()[1]
    day = rtc.datetime()[2]
    # [3] - weekday
    hour = rtc.datetime()[4]
    minute = rtc.datetime()[5]
    second = rtc.datetime()[6]
    subsecond = rtc.datetime()[7]

    name = "%s_%s_%s_%s_%s_%s_%s.mp4" %(year, month, day, hour, minute, second, subsecond)
    vid = mjpeg.Mjpeg(name)
    for j in range(100):
       clock.tick()
       vid.add_frame(sensor.snapshot())
    vid.close(clock.fps())

I also tried loading firmware from this post: Higher FPS, but
image
it never starts blinking blue.

It will only do that if you didn’t overwrite main.py as mentioned in the dialog.

Hi, saving to the SDcard is not something we have a performance benchmark on yet. With the latest firmware we’ve removed most bottlenecks. However, I have yet to optimize all the code paths.

Anyway, with the H7 and VGA you’re not going to get anywhere near 75FPS, you need to have triple buffering enabled which requires 3x the resolution in RAM. This is trivial on the H7 Plus but not happening on the regular. You should be able to record video at a high fps with QQVGA.

Hi, thanks for your reply.
So, there is nothing I can do to increase FPS? I’m not saying that I need 75FPS, but 30/40 would be great :slight_smile:.

Or maybe is there any way to cut out the part of the frame? I mean, like center part. Maybe it would increase FPS?

Yes, use sensor.set_windowing()

This will crop the image. If you crop by enough we will enable double/triple buffering which completely unloads the cpu from capturing frames. At that point it can focus on writing to the as card only and jpeg compression and you should see a big jump in performance.

Thanks, I will try that!