-
Notifications
You must be signed in to change notification settings - Fork 355
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use both cores? #141
Comments
I'm going to take a stab at this. The discrete cosine transform stage of JPEG compression is easily parallelized because the discrete cosine transform portion is done at the macroblock granularity (which is a square pixel region of 16×16 luma (Y) samples and 8×8 chroma samples). |
Thankyou for this; it's appreciated, and certainly something that is in my roadmap. My plan (such as it is) is to combine multi-core use with multi-client streaming, If working on this; a couple of caveats: 😉 I'm heavily involved in other work at present and poor at task switching, so It will be winter time before I can work on this project with any urgency again. I'm going to close this issue as a duplicate of #51 for now; if you want to get started on RTOS (or maybe even multiclient streaming) please work against that issue 😃 and have fun, learn cool stuff, etc.. |
turns out the OV2640 already has a built-in comporession engine with hardware for discrete cosine transform (https://www.uctronics.com/download/OV2640_DS.pdf): And it has JPEG output capability: And that built-in encoder is apparently already being used when set PIXFORMAT to JPEG here https://github.com/easytarget/esp32-cam-webserver/blob/master/esp32-cam-webserver.ino#L493 And according to some microsecond-accurate timing measurements breakdown of the stream_handler main loop (excluding the Serial.printf debug calls ericfont@a504027 So at this point I am almost certain that network communication is the bottleneck, particularly if want to do multi-client streaming. It might even be necessary to go for hardware wired Ethernet to do multi-client reliably. |
I concur. If you are using lower resolution modes then multiple streams will be more possible. But I've learned not to expect too much from ESP32 series 1 Wifi, it works well enough for it's price-point, but has distinct limits. Note that the esp's internal transcoder mechanism was (I believe, I's some time since I actually look at this code) used when in Face Recognition mode to provide the bitmaps used by the detector code, and the surface drawn on for the feedback boxes and text. Since I have stripped the FR stuff out for V4 ]we now only stream the mjpeg as created by the camera module itself. |
A quick skim of the code suggests it only uses one core, though many ESP32 modules have two cores. Frame rate could be improved if used two cores for encoding, such as by breaking each frame into two halves and letting the extra core if available encode one half.
The text was updated successfully, but these errors were encountered: