Open chewbaz1 opened 2 years ago
It is a very good library but I am also having the same problem
Same problem. cant made a HTTP+JS web joystick for RC Car via websockets with embebed stream video
Same here. I can get a v. good frame rate if I'm on StreamMjpeg, but the async example is depressingly slow!
When i use the standard example from espressif I get normal fps.
Do they offer an example with AsyncTCP? If so, can you post a link?
I can confirm that the frame rate on the Async example from this repo is quite poor :(. Even when lowering the resolution.
To capture a static jpeg is actually quite fast. I modified the example to have a download button and the download is almost instant.
I attempted to characterize the performance of the library - I found in esp32cam-asyncweb.h
this line auto frame = Camera.capture().release();
I slapped a println there and disappointingly found that it is only capturing a frame once per second.
Using platformio with the following settings:
[env:esp32cam]
platform = https://github.com/Jason2866/platform-espressif32.git#Arduino/IDF5
board = esp32cam
framework = arduino
upload_speed = 921600
monitor_speed = 115200
monitor_rts = 0
monitor_dtr = 0
lib_deps =
AsyncTCP
ESP Async WebServer
yoursunny/esp32cam
Using this board.
+1 very slow video ~1fps
I added some debug logging in MjpegResponse
and can have some insights in where it's spending the most time.
In my location the 2.4GHz network is very noisy, such that the home router indicates "RX rate 6 Mbit/s" from the ESP32.
I tested with 640x480 resolution for 30 seconds and got 1.393932 fps.
Some spreadsheet calculation reveals the average wait time:
In the current codebase, the MjpegController type can only make use of one Frame
, even if multiple frames are created via Config::setBufferCount
.
If this limitation is resolved, the duration for "camera performing the capture" and "sending the frame to the client" can be overlapped, which would greatly improve the fps.
Separately, it should be possible to refactor MjpegResponse type to reduce or eliminate the "waiting to start capture" duration. While this is a smaller improvement, it is much easier to achieve.
I tried to reduce the SEND-CAPTURE wait in 00d1ddbd2a0c93201364c03320674c62fbbaa1d5. Then I retested 640x480 resolution for 30 seconds, same as above.
According to the spreadsheet, each step takes average time as follows:
The change is effective in eliminating the SEND-CAPTURE delay, but the duration spent within SEND state is much longer. I can't tell whether it's due to WiFi interference or something in the code.
Hello
I tried using the AsyncCam example but I get very poor fps (1-2fps). When i use the standard example from espressif I get normal fps. Changing resolution doesnt help. I have an AI Thinker board and it gets very warm with this example. I am using PlatformIO and have tried upload with both AI thinker setting and Wrover setting but fps is bad on both. When I tried using arduino IDE i got a lot of errors therefore I use platformio instead.
Power: 5V
I would be happy if I recieved help with this issue.
Thanks