GithubHelp home page GithubHelp logo

Comments (23)

Knedox avatar Knedox commented on June 28, 2024 9

just FYI

i have disabled pixel clock divider for CIF, disabled clock prescaler and enabled clock doubler

REG32_CIF = 0x09
{CLKRC, 0x00 | CLKRC_2X}

then i have set config.xclk_freq_hz to 12mhz

now i get 60 FPS in CIF
and 30 FPS in VGA/SVGA

but SXGA and up is broken.
Setting config.xclk_freq_hz to 10Mhz results in 15FPS for SXGA

might be good if you would include the changes in your code to get more FPS 👍

from esp32-camera.

markjlorenz avatar markjlorenz commented on June 28, 2024 3

Since this thread is the top search result on how to increase the speed of the ov2640 camera, just a note for posterity... I found that the current Arduino sample code (May-2022) doesn't benefit from setting XCLK to 10MHz. What made by far the biggest difference for me was using an IPEX connector and attaching an external antenna. This allowed the board to keep a consistent frame rate without bogging down intermittently.

Screen Shot 2022-05-18 at 9 43 33 PM

Screen Shot 2022-05-18 at 9 48 55 PM

Screen Shot 2022-05-18 at 11 34 03 PM

IMG_7507

Without the antenna the SVGA was probably 0.1 FPS. Frame rate was all over the place even at 96x96.

I'm not an expert at all, first time working with these cameras. Please tell me if I'm doing something wrong!

from esp32-camera.

billy8119 avatar billy8119 commented on June 28, 2024 1

I have JPG frames being encoded, but even at VGA frames, and 10 MHz clock.. the video gets glitchy after about ~ 4 minutes. 20 seconds or so later, the camera finally crashes, and I can't reset it (reset line seems disconnected) it works when I hard reset via killing and restoring power. I have a heat sink on the back of the camera, but it's not helping.
Is this normal? Does someone else have 20+ fps VGA frames, with JPG compression? Is the 5640 more resilient than my ov2640? IE: should I switch? Ultimately, I'm not super interested in lots of frames per second, but I need low latency. Other solutions?

from esp32-camera.

me-no-dev avatar me-no-dev commented on June 28, 2024

the frame rate is limited by the sensor itself. in JPEG we have the bandwidth to read frames at max res at 25fps, but the camera itself is lowering it.

from esp32-camera.

me-no-dev avatar me-no-dev commented on June 28, 2024

i tested different prescalers but they did not result in stable operation. on top of that the network and all got so bogged down that I was not able to do any meaningful processing and the quality had to be lowered as well. will do more testing when necessary, but for now I think this is quite safe :)

from esp32-camera.

me-no-dev avatar me-no-dev commented on June 28, 2024

to note, not equal division from 80MHz is not a good idea on esp32 (and going above 20 is not even possible) because of how the peripheral works.

from esp32-camera.

me-no-dev avatar me-no-dev commented on June 28, 2024

Your suggestions have been added here :) Just set XCLK to 10MHz and double speed will be enabled

from esp32-camera.

Knedox avatar Knedox commented on June 28, 2024

another update:
seems like the HDF3M camera board that is supplied with the M5-Stack camera is very temperature dependent at high FPS. It has to reach temperature to get glitch free. The one supplied with esp32 cam board works at any temperature

from esp32-camera.

rochus-keller avatar rochus-keller commented on June 28, 2024

@me-no-dev

the frame rate is limited by the sensor itself. in JPEG we have the bandwidth to read frames at max res at 25fps, but the camera itself is lowering it.

Interesting. Where do you have this information from? I didn't find any confirmation in the OV2640 data sheet; instead the sensor is supposed to work at 30 fps in SVGA and even 60 fpw in CIF. Could you please provide more information about your assumptions?

from esp32-camera.

rochus-keller avatar rochus-keller commented on June 28, 2024

@Knedox

seems like the HDF3M camera board that is supplied with the M5-Stack camera is very temperature dependent at high FPS. It has to reach temperature to get glitch free. The one supplied with esp32 cam board works at any temperature

Thanks, great work! Can I conclude from your findings that with an ordinary ESP32-CAM board available for ~6$ (e.g. like this one https://www.aliexpress.com/item/ESP32-Cam-ESP32-Cam-WiFi-Bluetooth-ESP32-Camera-Module-Development-Board-with-OV2640-Camera-Module/33025675750.html) you are able to stream VGA (640x480) at 30 fps over Wifi without any crashes with your fix? So you cannot confirm the findings by @me-no-dev that the operation is unstable?

from esp32-camera.

Celppu avatar Celppu commented on June 28, 2024

kuva
I'm trying to achieve better frame rates but library provided in arduino ide is strange. In picture left and red is size in bytes and blue and right is time in ms.

Is library in arduino ide unoptimized or am I doing something wrong? I set 10mhz setting and 12 jpeg compression.

from esp32-camera.

me-no-dev avatar me-no-dev commented on June 28, 2024

there is nothing strange... how do you get those numbers? do you measure time between a frame is available or time between you getting and transfering it somewhere? You are trowing words but I do not get what you want to achieve? what is your target FPS at what resolution?

from esp32-camera.

Celppu avatar Celppu commented on June 28, 2024

I measured only the time taken by esp_camera_fb_get(). I didn't understand those examples and my code might be quite wrong...
`
long startters = millis();
fb = esp_camera_fb_get();
if(!fb) {
Serial.println("Camera capture failed");
return;
}
Serial.println(millis() - startters);
Serial.println(fb->len);

esp_camera_fb_return(fb);
`
Is there any example code how to achieve 30-60 frames second for vga and svga?

from esp32-camera.

me-no-dev avatar me-no-dev commented on June 28, 2024

you can't. you can do 25 :)
frame rates depend on many things but in essence the pixel clock needs to be compatible with what the ESP can handle. On top of that you have to get all the bytes from DMA and put them into PSRAM fast enough. That also needs time :) Here is a sheet of what is currently possible:
Screenshot 2019-09-18 at 14 30 55

from esp32-camera.

fdoljack avatar fdoljack commented on June 28, 2024

I would like to SLOW down the frame rate. How can one do this in the code for the esp-who example for webcamserver??

from esp32-camera.

imShara avatar imShara commented on June 28, 2024

you can't. you can do 25 :)
frame rates depend on many things but in essence the pixel clock needs to be compatible with what the ESP can handle. On top of that you have to get all the bytes from DMA and put them into PSRAM fast enough. That also needs time :) Here is a sheet of what is currently possible:
Screenshot 2019-09-18 at 14 30 55

Why 20MHz less framerate than 10MHz ?

from esp32-camera.

me-no-dev avatar me-no-dev commented on June 28, 2024

Because allows for another internal multiplier to be turned on. I am hunting clock settings on the supported sensors even now. I am setting up OV5640 for example to work at "full" FPS at 20MHz XCLK and lower the FPS (and increase exposure time as result) with lower frequencies (tried 5-20 and it's awesome). OV2640 is quite different sensor and clock structure, so not sure how good I can do there.

from esp32-camera.

xenpac avatar xenpac commented on June 28, 2024

I am setting up OV5640 for example to work at "full" FPS at 20MHz XCLK <
did you insert the ov5640 in the same socket on the esp32-cam board?

from esp32-camera.

tennisparty avatar tennisparty commented on June 28, 2024

you can't. you can do 25 :)
frame rates depend on many things but in essence the pixel clock needs to be compatible with what the ESP can handle. On top of that you have to get all the bytes from DMA and put them into PSRAM fast enough. That also needs time :) Here is a sheet of what is currently possible:
Screenshot 2019-09-18 at 14 30 55

Is there anyway to improve the framerate by changing the clock settings on the ESP itself?

from esp32-camera.

me-no-dev avatar me-no-dev commented on June 28, 2024

this table is old. XCLK is driven by the ESP so in reality we are already changing the settings on the ESP

from esp32-camera.

tennisparty avatar tennisparty commented on June 28, 2024

Great thanks, do you have an updated table to hand? Im looking to maximise the frame rate on an ov7725 sensor and wondering what the limit is

from esp32-camera.

sohtamei avatar sohtamei commented on June 28, 2024

Just FYI
While outputting 5/10/20MHz master clock from LEDC or I2S to peripheral device, the Wifi throughput gets worse.

from esp32-camera.

thet0ast3r avatar thet0ast3r commented on June 28, 2024

HI, this is mainly targeted at the author @Knedox . Struggle to change the clock prescaler settings in the esp32-camera driver. I am using the arduino ide, is there any way to do this in a somewhat simple way?

from esp32-camera.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.