mirror of
https://github.com/arkhipenko/esp32-mjpeg-multiclient-espcam-drivers.git
synced 2025-01-08 17:11:22 +01:00
Performance tuning
This commit is contained in:
parent
013b232d3d
commit
87f7216b97
5 changed files with 15 additions and 9 deletions
|
@ -75,7 +75,7 @@
|
|||
build_flags =
|
||||
${env.build_flags}
|
||||
-D CAMERA_MODEL_AI_THINKER
|
||||
-D FRAME_SIZE=FRAMESIZE_HVGA
|
||||
-D FRAME_SIZE=FRAMESIZE_VGA
|
||||
-D FPS=10
|
||||
-D WSINTERVAL=100
|
||||
-D MAX_CLIENTS=10
|
||||
|
@ -107,7 +107,7 @@
|
|||
build_flags =
|
||||
${env.build_flags}
|
||||
-D CAMERA_MODEL_AI_THINKER
|
||||
-D FRAME_SIZE=FRAMESIZE_HVGA
|
||||
-D FRAME_SIZE=FRAMESIZE_VGA
|
||||
-D FPS=10
|
||||
-D WSINTERVAL=100
|
||||
-D MAX_CLIENTS=10
|
||||
|
|
|
@ -111,7 +111,7 @@ void setup()
|
|||
.pixel_format = PIXFORMAT_JPEG,
|
||||
.frame_size = FRAME_SIZE,
|
||||
.jpeg_quality = JPEG_QUALITY,
|
||||
.fb_count = 1, //2,
|
||||
.fb_count = 2,
|
||||
.fb_location = CAMERA_FB_IN_DRAM,
|
||||
.grab_mode = CAMERA_GRAB_LATEST,
|
||||
// .sccb_i2c_port = -1
|
||||
|
|
|
@ -212,8 +212,6 @@ void streamCB(void * pvParameters) {
|
|||
|
||||
#if defined (BENCHMARK)
|
||||
streamAvg.value(micros()-streamStart);
|
||||
fpsAvg.value(1000.0 / (float) (millis()-lastFrame) );
|
||||
lastFrame = millis();
|
||||
streamStart = micros();
|
||||
#endif
|
||||
|
||||
|
@ -260,7 +258,11 @@ void streamCB(void * pvParameters) {
|
|||
// Let other tasks run after serving every client
|
||||
if ( xTaskDelayUntil(&xLastWakeTime, xFrequency) != pdTRUE ) taskYIELD();
|
||||
|
||||
|
||||
#if defined (BENCHMARK)
|
||||
fpsAvg.value(1000.0 / (float) (millis()-lastFrame) );
|
||||
lastFrame = millis();
|
||||
|
||||
if ( millis() - lastPrint > BENCHMARK_PRINT_INT ) {
|
||||
lastPrint = millis();
|
||||
Log.verbose("streamCB: wait avg=%d, stream avg=%d us, frame avg size=%d bytes, fps=%S\n", waitAvg.currentValue(), streamAvg.currentValue(), frameAvg.currentValue(), String(fpsAvg.currentValue()));
|
||||
|
|
|
@ -223,8 +223,6 @@ void streamCB(void * pvParameters) {
|
|||
|
||||
#if defined (BENCHMARK)
|
||||
streamAvg.value(micros()-streamStart);
|
||||
fpsAvg.value(1000.0 / (float) (millis()-lastFrame) );
|
||||
lastFrame = millis();
|
||||
#endif
|
||||
|
||||
// The frame has been served. Release the semaphore and let other tasks run.
|
||||
|
@ -245,6 +243,11 @@ void streamCB(void * pvParameters) {
|
|||
// Let other tasks run after serving every client
|
||||
if ( xTaskDelayUntil(&xLastWakeTime, xFrequency) != pdTRUE ) taskYIELD();
|
||||
|
||||
#if defined (BENCHMARK)
|
||||
fpsAvg.value(1000.0 / (float) (millis()-lastFrame) );
|
||||
lastFrame = millis();
|
||||
#endif
|
||||
|
||||
#if defined (BENCHMARK)
|
||||
if ( millis() - lastPrint > BENCHMARK_PRINT_INT ) {
|
||||
lastPrint = millis();
|
||||
|
|
|
@ -253,8 +253,6 @@ void streamCB(void * pvParameters) {
|
|||
info->frame = frameNumber;
|
||||
#if defined (BENCHMARK)
|
||||
streamAvg.value(micros()-streamStart);
|
||||
fpsAvg.value(1000.0 / (float) (millis()-lastFrame) );
|
||||
lastFrame = millis();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
@ -278,6 +276,9 @@ void streamCB(void * pvParameters) {
|
|||
if ( xTaskDelayUntil(&xLastWakeTime, xFrequency) != pdTRUE ) taskYIELD();
|
||||
|
||||
#if defined (BENCHMARK)
|
||||
fpsAvg.value(1000.0 / (float) (millis()-lastFrame) );
|
||||
lastFrame = millis();
|
||||
|
||||
if ( millis() - lastPrint > BENCHMARK_PRINT_INT ) {
|
||||
lastPrint = millis();
|
||||
Log.verbose("streamCB: wait avg=%d, stream avg=%d us, frame avg size=%d bytes, fps=%S\n", waitAvg.currentValue(), streamAvg.currentValue(), frameAvg.currentValue(), String(fpsAvg.currentValue()));
|
||||
|
|
Loading…
Reference in a new issue