Comments (23)
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.
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.
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.
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.
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.
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.
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.
Your suggestions have been added here :) Just set XCLK to 10MHz and double speed will be enabled
from esp32-camera.
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.
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.
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.
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.
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.
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.
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:
from esp32-camera.
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.
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:
Why 20MHz less framerate than 10MHz ?
from esp32-camera.
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.
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.
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:
Is there anyway to improve the framerate by changing the clock settings on the ESP itself?
from esp32-camera.
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.
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.
from esp32-camera.
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)
- Support Ultra-Low Power Himax HM0360 HOT 1
- `cam_hal: NO-EOI` when trying to capture JPEG bigger than ~300KB HOT 6
- `cam_hal: EV_VSYNC_OVF` when trying to capture in RGB565 or YUV422, in 1024x768 or 1600x1200, while capturing in 1280x1024 is okay HOT 5
- cam_hal: Failed to get the frame on time HOT 1
- ESP32S3-OV5640 can't update sensor settings HOT 5
- 摄像头,电压正常,出图失真了。这个问题是什么原因造成的? HOT 1
- Support new I2C API in IDF 5.2 HOT 2
- Use the example code, error in the following, how to solve, thank you HOT 8
- Decrease Camera Capturing Time HOT 4
- uint is not defined in ESP-IDF V5.2 HOT 1
- ESP-32 CAM webserver error: E (483) camera: Camera probe failed with error 0x105(ESP_ERR_NOT_FOUND) Camera init failed with error 0x105 HOT 1
- cam_hal: insufficient queue_size in corner case. HOT 1
- HELP ME TO WHERE TO PUT ALL FILES
- Enable psram mode on ESP32S3 causes NO-SOI and then panic
- how to handle multiple comonents calling install_gpio_isr_service/uninstall_gpio_isr_service/gpio_isr_handler_add HOT 9
- Reset button is hard to reach
- The example code cannot run properly (LoadProhibited) HOT 12
- PowerFeather - pin configuration?
- Enable camera has big impact on networking HOT 15
- Hardcoded buffer size for JPEG is too small for low resolution settings (e.g., QQVGA) HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from esp32-camera.