jameszah / ESP32-CAM-Video-Recorder-junior

Simple fast version of ESP32-CAM-Video-Recorder
GNU General Public License v3.0
280 stars 53 forks source link

guru meditation error when streaming #25

Open aminty opened 1 year ago

aminty commented 1 year ago

Hi mr James. I hope you’re doing well.

around 3 week , i'm confusing about a problem. in your source code(recorder junior v58) with easy install and with arduino IDE after uploading, when i'm trying to streaming , esp will rebooted. and in serial monitor this line appear: (guru meditation error: core 0 panic'ed (loadprohibited). exception was unhandled.)

But except for this option, all other option work well

Roobyx commented 1 year ago

Getting the exact same error here. I can access the camera's file manager, so it shouldn't be a connection issue, but, when I hit up the /stream, the camera will "panic" and reboot (as mentioned above)

jameszah commented 1 year ago

Could you cut and paste the serial monitor with the series of messages, and the stack of numbers from the "panic" to help me locate the problem. And the version number, and version number of compiler. libraries if you re-compiled the program.

CasperJohansen commented 1 year ago

Getting the same error repeatedly. V58: https://pastebin.com/MjLBhQNv (only happens when trying to stream or snapshot, records fine to sd) v60: https://pastebin.com/ErqZVwCb (happens immidiately)

AI-tinker esp32-cam board.

Both installed from one-click installer, and severeal different sd-cards tried

jameszah commented 1 year ago

Your module only has 2GB of spi-ram. The code is built for 4GB in most esp32-cam modules.

You could squeeze the memory a little here ... to repeatedly malloc and free the memory as needed ... I wish I would have spent an extra 20 minutes on that 2 years ago.

https://github.com/jameszah/ESP32-CAM-Video-Recorder-junior/blob/976b276c28f2d28ec8ba44c9c43fa663b712f1c0/v60/ESP32-CAM-Video-Recorder-junior-60x.4.7/ESP32-CAM-Video-Recorder-junior-60x.4.7.ino#L2482

....

image

Make that MB!

duchengyao commented 11 months ago

what size of framebuffer should be in 2GB memory?

Mostakim52 commented 7 months ago

I seem to be having the same problem. Is there a fix yet?

jameszah commented 7 months ago

The program is built for a standard esp32-cam module with 4mb of psram.

v2e commented 2 months ago

what size of framebuffer should be in 2GB memory?

I tested with (512*192) like this:

framebuffer = (uint8_t*)ps_malloc(512 * 192);
framebuffer2 = (uint8_t*)ps_malloc(512 * 192);
framebuffer3 = (uint8_t*)ps_malloc(512 * 192);

And it seems to work (more or less) fine, and even the streaming and image series work correctly with OV2640 camera. For the 1600x1200 mode (maximum possible for this camera), and the quality level of 12 (set by the software automatically), the statistics shows the average frame size of about 71 kB. Meanwhile (512*192) is almost 100 kB (I guess, this is what the framebuffer is intended for), so there is some extra space just in case.

This may not be reliable, but at least it allows to get some videos from the 2MB ESP32-CAM's. I hope this information will be useful for other people too.

jameszah commented 2 months ago

You are right - some old code there - it is set up for the all frame sizes in bright color.

512kb is overly conservative - 128kb should handle most cases.