esp32-cam-demo icon indicating copy to clipboard operation
esp32-cam-demo copied to clipboard

Pictures are scrambled

Open ModMike opened this issue 5 years ago • 4 comments

I am using the M5stack esp32cam with your code because their fork has a compilation error and I had to comment out a line.

My use is case is fairly light. I am using the camera to monitor a 3D printer. I don't need high res or super fast frame rate, although 15 fps would be best.

I am running into 2 issues:

  1. When the module is first plugged in, I get video but it has a bit of a strobe effect. Is there any way to mitigate this?

  2. Fairly rapidly, within a minute or 2, the camera starts sending de-synched images. Not sure if that is the right term but it looks like the picture was cut into horizontal strips and was not re-assembled properly.

I have 3 of these modules. The first 1 burned up and the other 2 have the same issues. Any advice?

I also found a lot of forks but am not sure who has most active one. Which one do you recommend?

Thank you.

ModMike avatar Sep 06 '18 15:09 ModMike

I have played with such module. I was able to get stable pictures with decreasing xclk below 10 MHz. I believe that the ESP32 clock stability is an issue for these modules.

For the best throughput at lower xclk one needs also to modify some camera registers that control the internal camera pclk. Take a look at tmrt branch at https://github.com/tmrttmrt/esp32-cam-demo/tree/tmrt that works with 8 MHz xclk.

tmrttmrt avatar Sep 10 '18 16:09 tmrttmrt

@tmrttmrt I found this in your code. #define CAMERA_FRAME_SIZE CAMERA_FS_UXGA What is FPS at this resolution? And can I improve FPS if I lower the resolution?

ilovehotmilk avatar Sep 13 '18 07:09 ilovehotmilk

It is low, 2-3 fps. By just changing the resolution it does not improve a lot. Concurrently with the resolution one needs to play also with the internal camera pclk that is some multiple of xclk set by CLKRC register. It might depend also on the hardware. I have only tested a cheap Chinese M5Stack ESP32 Camera Module that seems to have some problems with the clock stability at higher pclk settings.

tmrttmrt avatar Sep 13 '18 11:09 tmrttmrt

Thank you.

ilovehotmilk avatar Sep 15 '18 05:09 ilovehotmilk