Simple RTSP (streaming image) server for the ESP32CAM. Easy configuration and monitoring through the web interface.
Simple RTSP (streaming image) server for the ESP32CAM. Easy configuration and monitoring through the web interface.
Simple RTSP, HTTP JPEG Streamer and image server with configuration through the web interface.
[!NOTE] A
developbranch is available with the newest boards (including the Seeed Studio XIAO ESP32S3). It may be ahead ofmain; feedback and testing are welcome.
Flashing this software on a ESP32CAM module will make it a RTSP streaming camera server, a HTTP Motion JPEG streamer and a HTTP image server.
Supported protocols
RTSP The RTSP protocol is an industry standard and allows many CCTV systems and applications (like for example VLC) to connect directly to the ESP32CAM camera stream. It is also possible to stream directly to a server using ffmpeg. This makes the module a camera server allowing recording and the stream can be stored on a disk and replayed later. The video is encoded as Motion-JPEG (RTP payload 26) and streamed over RTP/UDP (default) or RTP/RTSP/TCP. Boards with an onboard microphone (e.g. the Seeed Studio XIAO ESP32S3 SENSE) can additionally stream G.711 a-law audio (RTP payload 8). The URL is rtsp://<ip address>:554/mjpeg/1 Authentication is optional; when enabled, clients must provide credentials (see RTSP authentication).
HTTP Motion JPEG The HTTP JPEG streamer makes it possible to watch the camera stream directly in your browser. The URL is http://<ip address>/stream
HTTP image The HTTP Image returns an HTTP JPEG image of the camera. The URL is http://<ip address>/snapshot
Over-the-air (OTA) firmware update The firmware can be updated over WiFi from PlatformIO or the Arduino IDE (espota). See Updating the firmware (OTA).
This software supports the following ESP32-CAM (and alike) modules:
The software provides a configuration web server that can be used to:
The software also provides a mDNS server to be easily discoverable on the local network. It advertises HTTP (port 80) and RTSP (port 554).
There are a lot of boards available that are all called ESP32-CAM. However, there are differences in CPU (type/speed/cores), how the camera is connected, presence of PSRAM or not... To select the right board use the table below and use the configuration that is listed below for your board:
| Board | Image | CPU | SRAM | Flash | PSRAM | Camera | Extras | Manufacturer site |
|---|---|---|---|---|---|---|---|---|
| Espressif ESP32-Wrover CAM | ESP32 | 520KB | 4MB | 8MB | OV2640 | |||
| AI-Thinker ESP32-CAM | ESP32 | 520KB | 4MB | 4MB | OV2640 | https://docs.ai-thinker.com/esp32-cam | ||
| Espressif ESP-EYE | ESP32 | 520KB | 4MB | 8MB | OV2640 | |||
| Espressif ESP32-S3-EYE | ESP32-S3 | 520KB | 4MB | 8MB | OV2640 | https://www.espressif.com/en/products/devkits/esp-eye/overview | ||
| LilyGo camera module | ESP32 Wrover | 520KB | 4MB | 8MB | OV2640 / OV5640 | |||
| LilyGo Simcam | OV2640 | |||||||
| LilyGo TTGO-T Camera | OV2640 | |||||||
| M5Stack ESP32CAM | ESP32 | 520KB | 4MB | - | OV2640 | Microphone | https://docs.m5stack.com/en/unit/esp32cam | |
| M5Stack UnitCam | ESP32-WROOM-32E | 520KB | 4MB | - | OV2640 | https://docs.m5stack.com/en/unit/unit_cam | ||
| M5Stack Camera | ESP32 | 520KB | 4MB | - | OV2640 | https://docs.m5stack.com/en/unit/m5camera | ||
| M5Stack Camera PSRAM | ESP32 | 520KB | 4MB | 4MB | OV2640 | https://docs.m5stack.com/en/unit/m5camera | ||
| M5Stack UnitCamS3 | ESP32-S3-WROOM-1-N16R8 | 520KB | 16MB | 8MB | OV2640 | https://docs.m5stack.com/en/unit/Unit-CamS3 | ||
| Seeed Studio XIAO ESP32S3 Sense | ESP32-S3R8 | 520KB | 8MB | 8MB | OV2640 | Microphone | https://www.seeedstudio.com/XIAO-ESP32S3-Sense-p-5639.html |
PlatformIO is available for all major operating systems: Windows, Linux and MacOS. It is also provided as a plugin to Visual Studio Code. More information can be found at: https://docs.platformio.org/en/latest/installation.html below the basics.
Install Visual Studio Code and install the PlatformIO plugin.
When using the ESP32-CAM-MB board, press and hold the GPIO0 button on the ESP32-CAM-MB board. Then press short the reset button (on the inside) on the ESP32-CAM board and release the GPIO0 button. This will put the ESP32-CAM board in download mode.
When using an FTDI adapter, make sure the adapter is set to 3.3 volt before connecting. Use the wiring schema below.
After programming remove the wire to the GPIO0 pin to exit the download mode.
Open a command line or terminal window and clone this repository from GitHub.
git clone https://github.com/rzeldent/esp32cam-rtsp.gitGo into the folder
cd esp32cam-rtspNext, the firmware has to be built and deployed to the ESP32. There are two flavours to do this; using the command line or the graphical interface of Visual Studio Code.
Make sure you have the latest version of the Espressif toolchain.
pio pkg update -g -p espressif32First the source code has to be compiled to build all targets
pio runIf only a specific target is required, for example the esp32cam_ttgo_t_journal type:
pio run -e esp32cam_ttgo_t_journalWhen finished, firmware has to be uploaded. Make sure the ESP32-CAM is in download mode (see previous section) and type:
pio run -t uploador, again, for a specific target, for example esp32cam_ai_thinker
pio run -t upload -e esp32cam_ai_thinkerWhen done remove the jumper when using a FTDI adapter or press the reset button on the ESP32-CAM. To monitor the output, start a terminal using:
pio device monitorOpen the project in Visual Studio Code with the PlatformIO extension installed. Run the following tasks using Terminal -> Run Task (or Ctrl+Alt+T). Make sure the ESP32-CAM is in download mode during uploads.
No open issues yet, or sync has not completed.