Skip to content

Commit 0302b4d

Browse files
authored
fix(logging): incorrect FPS logging (#10921)
* fix(logging): Corrected FPS calculation Previously, last_frame was only updated once at the beginning of stream_handler, leading to incorrect FPS and avg_frame_time computation. This commit ensures last_frame is updated on each iteration after last FPS computation, resulting in accurate FPS logging. Fixes #10920 * Revert "fix(logging): Corrected FPS calculation" This reverts commit 0bb7b95. * fix(loggin): Incorrect FPS computation fixed Corrected and tested change in FPS computation, suggested by @me-no-dev and found working with correct numbers. Previously, last_frame was only updated once at the beginning of stream_handler, leading to incorrect FPS and avg_frame_time computation. This commit ensures last_frame is updated on each iteration after last FPS computation, resulting in accurate FPS logging. Fixes #10920
1 parent f22866f commit 0302b4d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

libraries/ESP32/examples/Camera/CameraWebServer/app_httpd.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,8 @@ static esp_err_t stream_handler(httpd_req_t *req) {
281281
int64_t fr_end = esp_timer_get_time();
282282

283283
int64_t frame_time = fr_end - last_frame;
284+
last_frame = fr_end;
285+
284286
frame_time /= 1000;
285287
#if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_INFO
286288
uint32_t avg_frame_time = ra_filter_run(&ra_filter, frame_time);

0 commit comments

Comments
 (0)