Merge branch 'develop' into bugfix_wifi_password_lenght

This commit is contained in:
Rene Zeldenthuis
2022-11-24 23:41:20 +01:00
2 changed files with 10 additions and 7 deletions

View File

@@ -7,7 +7,7 @@ Easy configuration through the web interface.
Flashing this software on a ESP32CAM module will make it a **RTSP streaming camera** server. Flashing this software on a ESP32CAM module will make it a **RTSP streaming camera** server.
The RTSP protocol is an industry standard and allows many CCTV systems and applications (like for example [VLC](https://www.videolan.org/vlc/)) to connect directly to the ESP32CAM camera stream. The RTSP protocol is an industry standard and allows many CCTV systems and applications (like for example [VLC](https://www.videolan.org/vlc/)) to connect directly to the ESP32CAM camera stream.
It is also possible to to stream directly to a server using [ffmpeg](https://ffmpeg.org). It is also possible to stream directly to a server using [ffmpeg](https://ffmpeg.org).
This makes the module a camera server allowing recording and the stream can be stored on a disk and replayed later. This makes the module a camera server allowing recording and the stream can be stored on a disk and replayed later.
This software supports the following ESP32-CAM (and alike) modules: This software supports the following ESP32-CAM (and alike) modules:

View File

@@ -149,19 +149,23 @@ void handle_snapshot()
return; return;
} }
if (cam.getfb() == nullptr) // Remove old images stored in the framebuffer
auto frame_buffers = atoi(frame_buffers_val);
while (frame_buffers--)
cam.run();
auto fb_len = cam.getSize();
auto fb = (const char*)cam.getfb();
if (fb == nullptr)
{ {
web_server.send(404, "text/plain", "Unable to obtain frame buffer from the camera"); web_server.send(404, "text/plain", "Unable to obtain frame buffer from the camera");
return; return;
} }
auto fb_len = cam.getSize();
auto fb = (const char *)memcpy(new uint8_t[fb_len], cam.getfb(), fb_len);
web_server.sendHeader("Cache-Control", "no-cache, no-store, must-revalidate"); web_server.sendHeader("Cache-Control", "no-cache, no-store, must-revalidate");
web_server.setContentLength(fb_len); web_server.setContentLength(fb_len);
web_server.send(200, "image/jpeg", ""); web_server.send(200, "image/jpeg", "");
web_server.sendContent(fb, fb_len); web_server.sendContent(fb, fb_len);
delete[] fb;
} }
void handle_flash() void handle_flash()
@@ -188,7 +192,6 @@ void on_config_saved()
log_v("on_config_saved"); log_v("on_config_saved");
// Set flash led intensity // Set flash led intensity
analogWrite(LED_FLASH, atoi(flash_led_intensity_val)); analogWrite(LED_FLASH, atoi(flash_led_intensity_val));
config_changed = true; config_changed = true;
} }
@@ -219,7 +222,7 @@ void start_rtsp_server()
camera_init_result = initialize_camera(); camera_init_result = initialize_camera();
if (camera_init_result != ESP_OK) if (camera_init_result != ESP_OK)
{ {
log_e("Failed to initialize camera: 0x%0xd. Type: %s, frame size: %s, frame buffers: %s, frame rate: %s ms, jpeg quality: %s", camera_init_result, camera_config_val, frame_size_val, frame_buffers_val, frame_duration_val, jpeg_quality_val); log_e("Failed to initialize camera: 0x%0x. Type: %s, frame size: %s, frame buffers: %s, frame rate: %s ms, jpeg quality: %s", camera_init_result, camera_config_val, frame_size_val, frame_buffers_val, frame_duration_val, jpeg_quality_val);
return; return;
} }