mirror of
https://github.com/rzeldent/esp32cam-rtsp.git
synced 2025-11-14 04:04:02 +00:00
Merge branch 'develop' into bugfix_wifi_password_lenght
This commit is contained in:
@@ -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.
|
||||
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 software supports the following ESP32-CAM (and alike) modules:
|
||||
|
||||
15
src/main.cpp
15
src/main.cpp
@@ -149,19 +149,23 @@ void handle_snapshot()
|
||||
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");
|
||||
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.setContentLength(fb_len);
|
||||
web_server.send(200, "image/jpeg", "");
|
||||
web_server.sendContent(fb, fb_len);
|
||||
delete[] fb;
|
||||
}
|
||||
|
||||
void handle_flash()
|
||||
@@ -188,7 +192,6 @@ void on_config_saved()
|
||||
log_v("on_config_saved");
|
||||
// Set flash led intensity
|
||||
analogWrite(LED_FLASH, atoi(flash_led_intensity_val));
|
||||
|
||||
config_changed = true;
|
||||
}
|
||||
|
||||
@@ -219,7 +222,7 @@ void start_rtsp_server()
|
||||
camera_init_result = initialize_camera();
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user