{"id":15011920,"url":"https://github.com/rzeldent/esp32cam-rtsp","last_synced_at":"2025-05-15T04:03:30.276Z","repository":{"id":42774998,"uuid":"510936336","full_name":"rzeldent/esp32cam-rtsp","owner":"rzeldent","description":"Simple RTSP (streaming image) server for the ESP32CAM. Easy configuration and monitoring through the web interface.","archived":false,"fork":false,"pushed_at":"2025-03-15T13:40:17.000Z","size":8305,"stargazers_count":805,"open_issues_count":41,"forks_count":138,"subscribers_count":24,"default_branch":"main","last_synced_at":"2025-04-14T04:59:24.147Z","etag":null,"topics":["ai-thinker","camera","cctv","esp32","esp32-arduino","esp32cam","m5stack","ov2640","platformio","rtsp","rtsp-server","rtsp-stream","rtspserver","streaming","ttgo-tcamera","vlc","wifi","wrover-kit"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rzeldent.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-07-06T00:35:26.000Z","updated_at":"2025-04-11T06:27:34.000Z","dependencies_parsed_at":"2023-12-17T02:25:12.314Z","dependency_job_id":"b8f700b3-f08c-4ba9-b30c-9b76cffc425f","html_url":"https://github.com/rzeldent/esp32cam-rtsp","commit_stats":{"total_commits":102,"total_committers":5,"mean_commits":20.4,"dds":0.5490196078431373,"last_synced_commit":"312d916647b22a233b61d232fe2d2a196940a301"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rzeldent%2Fesp32cam-rtsp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rzeldent%2Fesp32cam-rtsp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rzeldent%2Fesp32cam-rtsp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rzeldent%2Fesp32cam-rtsp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rzeldent","download_url":"https://codeload.github.com/rzeldent/esp32cam-rtsp/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254270640,"owners_count":22042858,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai-thinker","camera","cctv","esp32","esp32-arduino","esp32cam","m5stack","ov2640","platformio","rtsp","rtsp-server","rtsp-stream","rtspserver","streaming","ttgo-tcamera","vlc","wifi","wrover-kit"],"created_at":"2024-09-24T19:41:53.666Z","updated_at":"2025-05-15T04:03:30.195Z","avatar_url":"https://github.com/rzeldent.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ESP32CAM-RTSP\n\n[![Platform IO CI](https://github.com/rzeldent/esp32cam-rtsp/actions/workflows/main.yml/badge.svg)](https://github.com/rzeldent/esp32cam-rtsp/actions/workflows/main.yml)\n\nSimple [RTSP](https://en.wikipedia.org/wiki/Real_Time_Streaming_Protocol), [HTTP JPEG Streamer](https://en.wikipedia.org/wiki/Motion_JPEG) and image server with configuration through the web interface.\n\n\u003e [!IMPORTANT]  \n\u003e New branch available! Here [branch: develop](https://github.com/rzeldent/esp32cam-rtsp/tree/develop)\n\u003e This branch supports all the current devices and the Seeed Studio Xiao esp32s3!\n\u003e Please use this and let me know if this works for you!\n\nFlashing this software on a ESP32CAM module will make it a **RTSP streaming camera** server, a **HTTP Motion JPEG streamer** and a **HTTP image server**.\n\nSupported protocols\n\n- RTSP\n  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.\n  It is also possible to stream directly to a server using [ffmpeg](https://ffmpeg.org).\n  This makes the module a camera server allowing recording and the stream can be stored on a disk and replayed later.\n  The URL is rtsp://\u0026lt;ip address\u0026gt;:554/mjpeg/1\n\n- HTTP Motion JPEG\n  The HTTP JPEG streamer makes it possible to watch the camera stream directly in your browser.\n  The URL is http://\u0026lt;ip address\u0026gt;/stream\n\n- HTTP image\n  The HTTP Image returns an HTTP JPEG image of the camera.\n  The URL is http://\u0026lt;ip address\u0026gt;/snapshot\n\nThis software supports the following ESP32-CAM (and alike) modules:\n\n- AI THINKER\n- EspressIf ESP-EYE\n- EspressIf ESP32S2-CAM\n- EspressIf ESP32S3-CAM-LCD\n- EspressIf ESP32S3-EYE\n- Freenove WROVER KIT\n- M5STACK ESP32CAM\n- M5STACK_PSRAM\n- M5STACK_UNITCAM\n- M5STACK_UNITCAMS3\n- M5STACK_V2_PSRAM\n- M5STACK_PSRAM\n- M5STACK_WIDE\n- M5STACK\n- Seeed Studio XIAO ESP32S3 SENSE\n- TTGO T-CAMERA\n- TTGO T-JOURNAL\n\nThe software provides a **configuration web server**, that can be used to:\n\n- Provide information about the state of the device, wifi connection and camera,\n- Set the WiFi parameters,\n- Set the timeout for connecting to the access point,\n- Set an access password,\n- Select the image size,\n- Select the frame rate,\n- Select the JPEG quality\n- Enable the use of the PSRAM\n- Set the number of frame buffers\n- Configure the camera options:\n  - Brightness\n  - Contrast\n  - Saturation\n  - Special effect (Normal, Negative, Gray-scale, Red/Green/Blue tint, Sepia)\n  - White balance\n  - Automatic White Balance gain\n  - Wite Balance mode\n  - Exposure control\n  - Auto Exposure (dsp)\n  - Auto Exposure level\n  - Manual exposure value\n  - Gain control\n  - Manual gain control\n  - Auto gain ceiling\n  - Black pixel correction\n  - White pixel correction\n  - Gamma correction\n  - Lens correction\n  - Horizontal mirror\n  - Vertical flip\n  - Downside enable\n  - Color bar\n\nThe software provides contains also a mDNS server to be easily discoverable on the local network.\nIt advertises HTTP (port 80) and RTSP (port 554)\n\n## Required\n\n- ESP32-CAM module or similar,\n- USB to Serial (TTL level) converter, piggyback board ESP32-CAM-MB or other way to connect to the device,\n- [**PlatformIO**](https://platformio.org/) software (free download)\n\n## Boards\n\nThere are a lot of boards available that are all called ESP32-CAM.\nHowever, there are differences in CPU (type/speed/cores), how the camera is connected, presence of PSRAM or not...\nTo select the right board use the table below and use the configuration that is listed below for your board:\n\n| Board                           | Image                                                                                               | CPU                     | SRAM   | Flash  | PSRAM | Camera          |             | Site                                                                                                                              |\n|---                              |---                                                                                                  |---                      |---     |---     | ---   |---              |---          |---                                                                                                                                |\n| Espressif ESP32-Wrover CAM      | ![img](assets/boards/esp32-wrover-cam.jpg)                                                          | ESP32                   | 520KB  | 4Mb    | 4MB   | OV2640          |             |                                                                                                                                   |\n| AI-Thinker ESP32-CAM            | ![img](assets/boards/ai-thinker-esp32-cam-ipex.jpg) ![img](assets/boards/ai-thinker-esp32-cam.jpg)  | ESP32                   | 520KB  | 4Mb    | 4MB   | OV2640          |             | [https://docs.ai-thinker.com/esp32-cam](https://docs.ai-thinker.com/esp32-cam)                                                    |\n| Espressif ESP-EYE               | ![img](assets/boards/espressif-esp-eye.jpg)                                                         | ESP32                   | 520KB  | 4Mb    | 4MB   | OV2640          |             |                                                                                                                                   |\n| Espressif ESP-S3-EYE            | ![img](assets/boards/espressif-esps3-eye.jpg)                                                       | ESP32-S3                | 520KB  | 4Mb    | 4MB   | OV2640          |             | [https://www.espressif.com/en/products/devkits/esp-eye/overview](https://www.espressif.com/en/products/devkits/esp-eye/overview)  |\n| LilyGo camera module            | ![img](assets/boards/lilygo-camera-module.jpg)                                                      | ESP32 Wrover            | 520KB  | 4Mb    | 4MB   | OV2640 / OV5640 |             |                                                                                                                                   |\n| LilyGo Simcam                   | ![img](assets/boards/lilygo-simcam.jpg)                                                             |                         |        |        |       | OV2640          |             |                                                                                                                                   |\n| LilyGo TTGO-T Camera            | ![img](assets/boards/lilygo-ttgo-t-camera.jpg)                                                      |                         |        |        |       | OV2640          |             |                                                                                                                                   |\n| M5Stack ESP32CAM                | ![img](assets/boards/m5stack_esp32cam_02.webp)                                                      | ESP32                   | 520Kb  | 4Mb    | -     | OV2640          | Microphone  | [https://docs.m5stack.com/en/unit/esp32cam](https://docs.m5stack.com/en/unit/esp32cam)                                            |\n| M5Stack UnitCam                 | ![img](assets/boards/m5stack_unit_cam_02.webp) ![img](assets/boards/m5stack_unit_cam_03.webp)       | ESP32-WROOM-32E         | 520KB  | 4Mb    | -     | OV2640          |             | [https://docs.m5stack.com/en/unit/unit_cam](https://docs.m5stack.com/en/unit/unit_cam)                                            |\n| M5Stack Camera                  | ![img](assets/boards/m5stack-esp32-camera.jpg)                                                      | ESP32                   | 520Kb  | 4Mb    | -     | OV2640          |             | [https://docs.m5stack.com/en/unit/m5camera](https://docs.m5stack.com/en/unit/m5camera)                                            |\n| M5Stack Camera PSRAM            | ![img](assets/boards/m5stack-esp32-camera.jpg)                                                      | ESP32                   | 520Kb  | 4Mb    | 4Mb   | OV2640          |             | [https://docs.m5stack.com/en/unit/m5camera](https://docs.m5stack.com/en/unit/m5camera)                                            |\n| M5Stack UnitCamS3               | ![img](assets/boards//m5stack_Unitcams3.webp) ![img](assets/boards/m5stack_Unitcams32.webp)         | ESP32-S3-WROOM-1-N16R8  | 520Kb  | 16Mb   | 8Mb   | OV2640          |             | [https://docs.m5stack.com/en/unit/Unit-CamS3](https://docs.m5stack.com/en/unit/Unit-CamS3)                                        |\n| Seeed studio Xiao ESP32S3 Sense | ![img](assets/boards/seeed-studio-xiao-esp32s3-sense.jpg)                                           | ESP32-S3R8              | 520KB  | 8Mb    | 8MB   | OV2640          | Microphone  | [https://www.seeedstudio.com/XIAO-ESP32S3-Sense-p-5639.html](https://www.seeedstudio.com/XIAO-ESP32S3-Sense-p-5639.html)          |\n\n## Installing and running PlatformIO\n\nPlatformIO is available for all major operating systems: Windows, Linux and MacOS. It is also provided as a plugin to [Visual Studio Code](https://visualstudio.microsoft.com).\nMore information can be found at: [https://docs.platformio.org/en/latest/installation.html](https://docs.platformio.org/en/latest/installation.html) below the basics.\n\nInstall [Visual Studio Code](https://code.visualstudio.com) and install the PlatformIO plugin.\n\n## Putting the ESP32-CAM in download mode\n\n### ESP32-CAM-MB\n\nWhen using the ESP32-CAM-MB board, press and hold the GP0 button on the ESP32-CAM-MB board.\nThen press short the reset button (on the inside) on the ESP32-CAM board and release the GP0 button.\nThis will put the ESP32-CAM board in download mode.\n\n### FTDI adapter\n\nWhen using an FTDI adapter, make sure the adapter is set to 3.3 volt before connecting. Use the wiring schema below.\n\n![ESP FTDI wiring](assets/ESP32CAM-to-FTDI.png)\n\nAfter programming remove the wire to tge GPIO0 pin to exit the download mode.\n\n## Compiling and deploying the software\n\nOpen a command line or terminal window and clone this repository from GitHub.\n\n```sh\ngit clone https://github.com/rzeldent/esp32cam-rtsp.git\n```\n\ngo into the folder\n\n```sh\ncd esp32cam-rtsp\n```\n\nNext, the firmware has to be build and deployed to the ESP32.\nThere are two flavours to do this; using the command line or the graphical interface of Visual Studio Code.\n\n### Using the command line\n\nMake sure you have the latest version of the Espressif toolchain.\n\n```sh\npio pkg update -g -p espressif32\n```\n\nFirst the source code has to be compiled to build all targets\n\n```sh\npio run\n```\n\nif only a specific target is required, for example the ```esp32cam_ttgo_t_journal``` type:\n\n```sh\npio run -e esp32cam_ttgo_t_journal\n```\n\nWhen finished, firmware has to be uploaded.\nMake sure the ESP32-CAM is in download mode (see previous section) and type:\n\n```sh\n pio run -t upload\n```\n\nor, again, for a specific target, for example ```esp32cam_ai_thinker```\n\n```sh\npio run -t upload -e esp32cam_ai_thinker\n```\n\nWhen done remove the jumper when using a FTDI adapter or press the reset button on the ESP32-CAM.\nTo monitor the output, start a terminal using:\n\n```sh\n pio device monitor\n```\n\n### Using Visual studio\n\nOpen the project in a new window. Run the following tasks using the ```Terminal -\u003e Run Task``` or CTRL+ALT+T command in the menu (or use the icons below on the toolbar). Make sure the ESP32-CAM is in download mode during the uploads.\n\n- PlatformIO: Build (esp32cam)\n- PlatformIO: Upload (esp32cam)\n\nTo monitor the behavior run the task, run: ```PlatformIO: Monitor (esp32cam)```\n\n## Setting up the ESP32CAM-RTSP\n\nAfter the programming of the ESP32, there is no configuration present. This needs to be added.\nTo connect initially to the device open the WiFi connections and select the WiFi network / access point called **ESP32CAM-RTSP**.\nInitially there is no password present.\n\nAfter connecting, the browser should automatically open the status page.\nIn case this does not happens automatically, connect to [http://192.168.4.1](http://192.168.4.1).\nThis page will display the current settings and status. On the bottom, there is a link to the config. Click on this link.\n\nThis link brings up the configuration screen when connecting fot the first time.\n\n![Configuration screen](assets/Configuration.png)\n\nConfigure at least:\n\n- The access point to connect to. No dropdown is present to show available networks!\n- A password for accessing the Access point (AP) when starting. (required)\n- Type of the ESP32-CAM board\n\nWhen finished press ```Apply``` to save the configuration. The screen will redirect to the status screen.\nHere it is possible to reboot the device so the settings take effect.\nIt is also possible to restart manually by pressing the reset button.\n\n## Connecting to the configuration\n\nAfter the initial configuration and the device is connected to an access point, the device can be configured over http.\n\nWhen a connection is made to [http://esp32cam-rtsp](http://esp32cam-rtsp) the status screen is shown.\n\n![Status screen](assets/index.png)\n\nIn case changes have been made to the configuration, this is shown and the possibility to restart is given.\n\nClicking on the ```change configuration``` button will open the configuration. It is possible that a password dialog is shown before entering.\nIf this happens, for the user enter 'admin' and for the password the value that has been configured as the Access Point password.\n\n## Connecting to the RTSP stream\n\nRTSP stream is available at: [rtsp://esp32cam-rtsp.local:554/mjpeg/1](rtsp://esp32cam-rtsp.local:554/mjpeg/1).\nThis link can be opened with for example [VLC](https://www.videolan.org/vlc/).\n\n## Connecting to the JPEG motion server\n\nThe JPEG motion server server is available using a normal web browser at: [http://esp32cam-rtsp.local:/stream](http://esp32cam-rtsp.local/stream).\n\n## Connecting to the image server\n\nThe image server server is available using a normal web browser at: [http://esp32cam-rtsp.local:/snapshot](http://esp32cam-rtsp.local/snapshot).\n\n:bangbang: **Please be aware that there is no password present!**.\nEverybody with network access to the device can see the streams or images! Beware of :trollface:!\n\n## API\n\nThere is a minimum API present to perform some tasks using HTTP requests. For some requests authentication is required.\nThe authentication used is basic authentication. The user is always admin and the password the access point key.\\\nIf using a browser, remember that the authentication is stored in the browser session so needs to be entered only once.\n\nThe URLs are below:\n\n### GET: /restart\n\nCalling this URL will restart the device. Authentication is required.\n\n### GET: /config\n\nCalling this URL will start the form for configuring the device in the browser. Authentication is required.\n\n### GET: /snapshot\n\nCalling this URL will return a JPEG snapshot of the camera in the browser.\nThis request can also be used (for example using cURL) to save the snapshot to a file.\n\n## Issues / Nice to know\n\n- The red LED on the back of the device indicates the device is not connected.\n- Sometimes after configuration a reboot is required.\n  If the error screen is shown that it is unable to make a connection, first try to reboot the device,\n- When booting, the device waits 30 seconds for a connection (configurable).\n  You can make a connection to the SSID and log in using the credentials below,\n- When connected, go to the ip of the device and, when prompted for the credentials, enter 'admin' and the AP password.\n  This is a **required** field before saving the credentials,\n- When the password is lost, a fix is to completely erase the ESP32 using the ```pio run -t erase``` command.\n  This will reset the device including configuration.\n  If using the esptool, you can do this using ```esptool.py --chip esp32 --port /dev/ttyUSB0 erase_flash```.\n  However, after erasing, re-flashing of the firmware is required.\n- When finished configuring for the first time and the access point is entered, disconnect from the wireless network provided by the device.\n  This should reset the device and connect to the access point.\n  Resetting is also a good alternative...\n- There are modules that have no or faulty PSRAM (despite advertised as such).\n  This can be the case if the camera fails to initialize.\n  It might help to disable the use of the PSRAM and reduce the buffers and the screen size.\n\n### Power\n\nMake sure the power is 5 volts and stable, although the ESP32 is a 3.3V module, this voltage is created on the board.\nIf not stable, it has been reported that restarts occur when starting up (probably when power is required for WiFi).\nThe software disables the brown out protection so there is some margin in the voltage.\nSome people suggest to add a capacitor over the 5V input to stabilize the voltage.\n\n### PSRAM / Buffers / JPEG quality\n\nSome esp32cam modules have additional ram on the board. This allows to use this ram as frame buffer.\nThe availability of PSRAM can be seen in the HTML status overview.\n\nNot all the boards are equipped with PSRAM:\n\n|  Board            | PSRAM           |\n|---                |---              |\n| WROVER_KIT        | 8Mb             |\n| ESP_EYE           | 8Mb             |\n| ESP32S3_EYE       | 8Mb             |\n| M5STACK_PSRAM     | 8Mb             |\n| M5STACK_V2_PSRAM  | Version B only  |\n| M5STACK_WIDE      | 8Mb             |\n| M5STACK_ESP32CAM  | No              |\n| M5STACK_UNITCAM   | No              |\n| M5STACK_UNITCAMS3 | 8Mb             |\n| AI_THINKER        | 8Mb             |\n| TTGO_T_JOURNAL    | No              |\n| ESP32_CAM_BOARD   | ?               |\n| ESP32S2_CAM_BOARD | ?               |\n| ESP32S3_CAM_LCD   | ?               |\n\nDepending on the image resolution, framerate and quality, the PSRAM must be enabled and/or the number of frame buffers increased to keep up with the data generated by the sensor.\nThere are (a lot of?) boards around with faulty PSRAM. If the camera fails to initialize, this might be a reason. See on [Reddit](https://www.reddit.com/r/esp32/comments/z2hyns/i_have_a_faulty_psram_on_my_esp32cam_what_should/).\nIn this case disable the use of PSRAM in the configuration and do not use camera modes that require PSRAM,\n\nFor the setting JPEG quality, a lower number means higher quality.\nBe aware that a very high quality (low number) can cause the ESP32 cam to crash or return no image.\n\nThe default settings are:\n\n- No PSRAM\n  - SVGA (800x600)\n  - 1 frame buffer\n  - JPEG quality 12\n\n- With PSRAM\n  - UXGA (1600x1200)\n  - 2 frame buffers\n  - JPEG quality 10\n\n### Camera module\n\nBe careful when connecting the camera module.\nMake sure it is connected the right way around (Camera pointing away from the board) and the ribbon cable inserted to the end before locking it.\n\n## Credits\n\nesp32cam-rtsp depends on PlatformIO, Bootstrap 5 and Micro-RTSP by Kevin Hester.\n\n## Change history\n\n- January 2024\n  - Moved settings to board definitions\n  - Added new boards\n  - Removed OTA to increase performance\n- Oktober 2023\n  - Added support for Seeed Xiao esp32s3\n  - New build system\n  - Updated documentation\n- March 2023\n  - Added options to set PSRAM / Frame buffers\n  - Added JPEG Motion streaming\n- Feb 2023\n  - Added additional settings for camera configuration\n- Nov 2022\n  - Added OTA\n  - Fix for grabbing frame\n  - Fixed bug: Increased WiFi password length\n- Sep 2022\n  - Added GUI with bootstrap\n  - More information in web page\n  - Added camera preview in HTML\n- Jul 2022\n  - Initial version\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frzeldent%2Fesp32cam-rtsp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frzeldent%2Fesp32cam-rtsp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frzeldent%2Fesp32cam-rtsp/lists"}