The ESP32-CAM is a cheap way to build a WiFi camera, but the sketch most beginners start with does not speak RTSP. The stock Espressif CameraWebServer example streams MJPEG over HTTP, and that is all it does. If you want VLC, Frigate, Blue Iris, or an NVR to pick the camera up as a standard network camera, you need RTSP, which needs different firmware or a different library.
This guide covers the working routes, the board each one fits, the exact RTSP URL each serves, VLC viewing, Frigate and Home Assistant setup, and expected frame rate. Nothing here needs a paid app or a cloud account.
What is RTSP, and when does it beat MJPEG?
RTSP, Real Time Streaming Protocol, is the standard way network cameras hand video to players and recorders. A client asks for a stream, the two agree on transport settings, and video flows over RTP. VLC, ffmpeg, Frigate, Blue Iris, ZoneMinder, and most NVR software all speak RTSP.
MJPEG over HTTP, the /stream endpoint in the stock CameraWebServer sketch, is simpler: the camera sends one JPEG image after another in a single HTTP response, and any browser can show it. NVR software generally cannot record it, and detection tools cannot consume it directly.
Use RTSP to record footage, run motion or person detection, watch several cameras in one app, or feed the camera into Home Assistant through Frigate or go2rtc. Stick with MJPEG over HTTP for a quick live view in a browser. If you have not set up the board yet, start with our ESP32-CAM getting started guide first.
Which board works for RTSP?
Any ESP32 camera board with PSRAM can run an RTSP server. The classic AI-Thinker style ESP32-CAM has an ESP32 chip with 4 MB PSRAM and an OV2640 camera. The ESP32-S3-N16R8 CAM board runs an ESP32-S3 chip with 8 MB PSRAM and an OV5640 camera, and its two USB-C ports mean no serial adapter is needed. Both boards stream MJPEG video over RTSP, not H.264, which matters for bandwidth and Home Assistant (see the frame rate section).
Pin tables conflict across sources. A wrong camera pin map is the most common reason a build compiles cleanly and shows no video, so verify the pins against your exact board variant before flashing, using that variant’s own documentation.
What are the RTSP setup options?
There is no single official RTSP example from Espressif for the classic ESP32-CAM. The working routes are community firmware and libraries. Pick one row and follow its section.
| Approach | Best for | Boards | RTSP URL pattern | Code or config needed |
|---|---|---|---|---|
| esp32cam-rtsp firmware by rzeldent | Fastest setup, no code changes | ESP32, ESP32-S2, ESP32-S3 camera modules | rtsp://IP:554/mjpeg/1 | Flash with PlatformIO, configure in a browser |
| Micro-RTSP library by geeksville | Arduino or PlatformIO sketch you control | Classic ESP32-CAM (OV2640) | rtsp://IP:8554/mjpeg/1 | Arduino sketch plus the Micro-RTSP library |
| Tasmota32 webcam firmware | Users who already run Tasmota and want MQTT control | Classic ESP32-CAM (AI-Thinker template) | rtsp://IP:8554/mjpeg/1 | Flash the webcam binary, run one command |
| ESPHome rtsp_server component | ESP32-S3 boards already in ESPHome | ESP32 camera boards running ESPHome | rtsp://IP:554/ | Add two lines to your ESPHome YAML |
Sources: esp32cam-rtsp at https://www.esp32.diy/esp32cam-rtsp/ ; Micro-RTSP at https://github.com/geeksville/Micro-RTSP ; circuit.rocks tutorial at https://learn.circuit.rocks/esp32-cam-with-rtsp-video-streaming ; Tasmota guide at https://cgomesu.com/blog/Esp32cam-tasmota-webcam-server/ ; ESPHome docs at https://beta.esphome.io/components/rtsp_server/ .
How do I set up esp32cam-rtsp, the no-code route?
Recommended route for most buyers. The firmware turns the board into an RTSP server, an HTTP MJPEG streamer, and a snapshot endpoint at once, all configured through a web page, with no code changes. Latest release at the time of writing: 1.0.8 (2026-09-29).
- Install PlatformIO (VS Code extension or CLI) and clone the project:
git clone https://github.com/rzeldent/esp32cam-rtsp.git. - Enter download mode. USB-C boards do this on their own; if an upload fails, hold BOOT, press and release RESET, then release BOOT. On a classic ESP32-CAM, use a 3.3 V USB-to-serial adapter or an ESP32-CAM-MB carrier, and hold GPIO0 low while resetting. 5 V logic damages the board.
- Flash your board target, for example
pio run -t upload -e esp32cam_ai_thinkerfor the AI-Thinker board. - On first boot the firmware starts its own WiFi access point. Join it, open the config page shown in the serial monitor, enter your WiFi credentials and camera settings, then save. The board reboots onto your network.
- Open VLC and play
rtsp://<ip address>:554/mjpeg/1.
The same firmware also serves MJPEG at http://<ip address>/stream and a still at http://<ip address>/snapshot. Turn on RTSP authentication in the web interface if anyone outside your household can reach your network, and never forward port 554 through your router.
How do I set up Micro-RTSP in an Arduino sketch?
Use this route when you want the RTSP server inside your own sketch, for example a camera that also reads sensors or drives outputs. Micro-RTSP is a small RTSP server library implementing RTSP and JPEG-over-RTP, with a reference streamer built for the OV2640 on the classic ESP32-CAM.
- Install Micro-RTSP from the ZIP in the circuit.rocks ESP32-RTSP repo, or as a PlatformIO dependency; it is not in the Arduino Library Manager. Full example: https://github.com/circuitrocks/ESP32-RTSP .
- Put your WiFi credentials in the sketch’s credentials header before compiling.
- Wire the classic ESP32-CAM: 5 V and ground to the header pins, adapter TX to board U0R and RX to U0T, and a button between IO0 and ground. Use a 5 V, 2 A supply; a computer USB port is often not enough.
- Hold the download button while powering up or resetting, then upload. The serial monitor at 115200 baud shows the boot message and board IP.
- In VLC play
rtsp://<ip address>:8554/mjpeg/1. Note the port: 8554, not 554.
The example loop sends a frame about every 100 ms, roughly 10 fps at 800 by 600, per the Micro-RTSP docs for that example. Run only one streaming server at a time; enabling both web and RTSP makes streaming very slow.
How do I enable RTSP on Tasmota?
Use this route only if you already run Tasmota or want its MQTT control and web interface. Flash the tasmota32-webcam firmware, apply the AI-Thinker template, then enable the RTSP server from the Tasmota console:
WcRtsp 1
The stream is then live at rtsp://<device IP>:8554/mjpeg/1. Enable it once; the RTSP server runs independently of the HTTP stream. The Tasmota guide reports VLC is the most reliable viewer. Full steps: https://cgomesu.com/blog/Esp32cam-tasmota-webcam-server/ .
How do I add RTSP to an ESPHome camera?
If your camera already runs ESPHome, add the RTSP server component next to your configured esp32_camera block:
rtsp_server:
That is the whole configuration. The stream is served at rtsp://<device IP>:554/ with no path after the port. Optional settings: port (default 554), max_connections (1 to 4, default 2), and allowed_ips (addresses or networks allowed to connect).
Two facts catch people out. First, the stream is MJPEG over RTSP, and the camera only streams while at least one client is playing. Second, there is no encryption or authentication; allowed_ips filters by address but authenticates nobody, so use it only on a trusted local network. Source: ESPHome RTSP docs.
How do I watch the stream in VLC?
VLC is the best first test for any of the four routes, because its RTSP support is solid and its error messages point at the real problem.
- Open VLC, go to Media, then Open Network Stream, or press Ctrl+N.
- Paste the RTSP URL for your firmware: port 554 for esp32cam-rtsp and ESPHome, port 8554 for Micro-RTSP and Tasmota. The path is
/mjpeg/1for esp32cam-rtsp, Micro-RTSP, and Tasmota, and the root path/for ESPHome. - Click Play. If the picture appears, the camera, firmware, and network path all work, and any later failure is in the next app, not the camera.
If the video lags by a second or more, the cause is usually VLC network caching, not the camera. VLC buffers network streams at 1000 ms by default. In the stream dialog, click Show more options and lower caching to 300 ms, or to 0 ms for the lowest delay. Zero caching makes the picture more sensitive to WiFi jitter, so on a weak signal keep some caching and fix the signal instead.
How do I add the camera to Home Assistant and Frigate?
Two warnings first, because most tutorials get this part wrong.
Warning one: Home Assistant Generic Camera cannot play this stream. Its pipeline plays only H.264 and HEVC, and every RTSP route in this guide serves MJPEG. The ESPHome docs state this directly. Source: ESPHome RTSP docs.
Warning two: if the camera runs ESPHome, Home Assistant does not need RTSP at all. The ESPHome native API already exposes the camera entity. RTSP is for other software.
The route that works is Frigate, with go2rtc if your Frigate version uses it. Frigate reads the MJPEG RTSP stream with ffmpeg and handles detection and recording. A working Frigate camera entry from the Home Assistant community, using the Tasmota or Micro-RTSP URL:
cameras:
esp32_cam:
ffmpeg:
inputs:
- path: rtsp://192.168.1.72:8554/mjpeg/1
roles:
- detect
- record
detect:
width: 640
height: 360
fps: 5
Replace the IP address with your camera IP, and use port 554 with the matching path for esp32cam-rtsp or ESPHome. Keep detection resolution low; community users run 640 by 360 at 5 frames per second. Source: Home Assistant community Frigate thread.
If you only want a live dashboard view, skip RTSP and use the ESPHome native camera entity or the HTTP MJPEG stream. RTSP earns its place when Frigate or an NVR must record or analyze the feed.
What latency and frame rate should I expect?
No source gives one tested frame rate for every board and firmware, so this guide gives no universal number. The numbers below are what named sources measured on their own setups. Your result moves with resolution, JPEG quality, WiFi signal, and client count.
- ESPHome measured about 5 fps over WiFi and 10 over Ethernet at 640 by 480 on an ESP32-S3 with an OV5640, using its high performance network settings; without them the same test ran at about 1 fps over WiFi. Source: ESPHome RTSP docs.
- The Micro-RTSP example sends a frame about every 100 ms, roughly 10 fps at 800 by 600 in its own documentation. Source: Micro-RTSP docs.
- The esp32cam-rtsp project states that resolution and frame rate are bounded by the ESP32 processor and available PSRAM. Source: esp32cam-rtsp project page.
Start at 640 by 480 and raise resolution only after the stream is stable. MJPEG uses more bandwidth than H.264 at the same picture quality, since every frame is a full JPEG. Assume one viewer at a time on a classic ESP32-CAM; ESPHome defaults to two RTSP clients.
What are the common mistakes?
- Flashing the stock CameraWebServer sketch and expecting RTSP. It serves MJPEG over HTTP only.
- Using the wrong port. Port 554 belongs to esp32cam-rtsp and ESPHome; port 8554 belongs to Micro-RTSP and Tasmota. The wrong port gives a connection refused error even when the camera runs fine.
- Using the wrong path. The path is
/mjpeg/1for esp32cam-rtsp, Micro-RTSP, and Tasmota, and the root path/for ESPHome. - Powering the classic ESP32-CAM from a weak USB port. The board needs a stable 5 V, 2 A supply. Brownouts during WiFi connection look like firmware bugs and are usually power.
- Running two streaming servers at once in the Micro-RTSP sketch. The tutorial warns this makes streaming very slow. Pick one.
- Pointing Home Assistant Generic Camera at an MJPEG RTSP URL. It cannot play it. Use Frigate or go2rtc, or the ESPHome native camera entity.
- Opening RTSP to the internet. None of these routes is built for that, and ESPHome RTSP has no authentication at all. Keep the camera on your local network.
- Trusting a pin table from a different board variant. Pin maps conflict across sources. Verify the camera pins against your exact board variant before blaming the firmware.
How do I troubleshoot a stream that will not play?
Work through this list in order; each step rules out one layer.
VLC says “Your input can’t be opened” or times out. Check the board IP in the serial monitor or your router, confirm the camera and computer share a network, and confirm the port and path match your firmware in the table above. Check the router is not isolating WiFi clients (AP isolation) and that no firewall blocks the RTSP port.
VLC connects but shows a black or frozen frame. Drop to 640 by 480 and move closer to the router. The ESP32-CAM is 2.4 GHz only, so a 5 GHz network name will never work.
The stream stutters or drops frames. Lower the resolution and frame rate, disconnect other viewers, and check the power supply, since a marginal 5 V supply causes this under load. In VLC, force RTP over RTSP (TCP) when UDP packets drop.
The camera boots but never joins WiFi. Re-enter the network name and password, watching case and trailing spaces. Check the serial monitor at 115200 baud for connection messages and the assigned IP. A reboot loop usually means power first, then a loose camera ribbon cable.
The camera works in VLC but Frigate reports “Unable to read frames”. Confirm the URL in VLC first, then copy it exactly into Frigate. The common cause is port 554 when the firmware serves on 8554, or an ESPHome web server port, which is HTTP, not RTSP. Source: Home Assistant community thread.
Wrong colors or artifacts. Reseat the camera ribbon cable and lower the resolution.
Parts used in this guide
Prices and stock were verified live on qualityrcparts.com on 2026-11-21 through the public Store API. All three items are in stock and purchasable; the live product page is the current price.
- ESP32-CAM Development Board with OV2640 Camera Module, 4MB PSRAM (ID 13473) – $25.99. The classic ESP32-CAM for the Micro-RTSP and Tasmota routes. No USB port; program it over UART or with an ESP32-CAM-MB carrier.
- ESP32-S3-N16R8 CAM Development Board with OV5640 Camera, Dual USB-C, WiFi + Bluetooth 5 (ID 19636) – $22.99. The S3 board for the esp32cam-rtsp and ESPHome routes. Two USB-C ports split OTG and serial duties; 16 MB flash plus 8 MB PSRAM.
- ESP32-CAM WiFi Board with ESP32-CAM-MB Micro USB Carrier, OV2640 Camera Module, Single (ID 23417) – $19.99. The classic ESP32-CAM bundled with the MB carrier board, which adds a micro USB port and USB-to-serial chip.
Shipped fast and securely from our secure facility in Queensbury, NY. QRC ships within the USA only.
Related guides
- ESP32-CAM vs ESP32-S3-CAM: Which Camera Board to Pick – compare the two camera boards.
- How to Use the ESP32-S3-CAM Board for Camera Projects – the S3 board setup guide, including its MJPEG streaming walkthrough.
- How to Start with ESP32-CAM for WiFi Camera Projects – first-time setup for the classic ESP32-CAM.
- Convert Analog FPV Video to USB – a different approach for analog FPV cameras.
FAQ
Does the ESP32-CAM support RTSP out of the box? No. The stock CameraWebServer example serves MJPEG over HTTP only, with no RTSP server. Add RTSP with esp32cam-rtsp firmware, the Micro-RTSP library, Tasmota webcam firmware, or the ESPHome rtsp_server component. Source: Home Assistant community, Tasmota guide.
What is the RTSP URL for an ESP32-CAM? It depends on the firmware: rtsp://IP:554/mjpeg/1 for esp32cam-rtsp, rtsp://IP:8554/mjpeg/1 for Micro-RTSP and Tasmota, rtsp://IP:554/ for ESPHome. Replace IP with the camera IP from your router or serial monitor. Source: esp32cam-rtsp, Micro-RTSP, Tasmota, and ESPHome docs.
Can I add an ESP32-CAM RTSP stream to Home Assistant? Not through Generic Camera: its pipeline plays only H.264 and HEVC, and ESP32-CAM RTSP serves MJPEG. Feed the stream to Frigate or go2rtc instead, or use the ESPHome native camera entity. Source: ESPHome RTSP docs.
Why does VLC say it cannot open my ESP32-CAM stream? The usual causes are a wrong IP address, the wrong port (554 vs 8554), the wrong path (/mjpeg/1 vs the ESPHome root path), AP isolation, or a firewall blocking the RTSP port. Check the stream in VLC first, then copy that working URL into any other app. Source: Micro-RTSP and circuit.rocks docs.
What frame rate will I get from an ESP32-CAM over RTSP? There is no single tested number. ESPHome measured about 5 fps over WiFi and 10 over Ethernet at 640 by 480 on an ESP32-S3 with an OV5640, and the Micro-RTSP example runs about 10 fps at 800 by 600. Start at 640 by 480. Source: ESPHome and Micro-RTSP docs.
Is RTSP better than MJPEG for an ESP32-CAM? RTSP is better when a recorder, NVR, or detection tool needs the feed, because those tools speak RTSP and generally cannot consume an MJPEG HTTP stream. MJPEG over HTTP is better for a quick live view in a browser. Both carry the same MJPEG video, so RTSP does not improve the picture, it makes the feed usable by more software. Source: ESPHome docs, esp32cam-rtsp page.
Can I view an RTSP stream in a web browser? No, not directly. Browsers do not play RTSP. Use VLC or an NVR app for RTSP, the HTTP MJPEG stream at http://IP/stream for a browser view, or Frigate or go2rtc between the camera and the browser. Source: circuit.rocks docs, esp32cam-rtsp page.
Sources
- esp32cam-rtsp overview: https://www.esp32.diy/esp32cam-rtsp/
- esp32cam-rtsp repository: https://github.com/rzeldent/esp32cam-rtsp
- Micro-RTSP library: https://github.com/geeksville/Micro-RTSP
- Micro-RTSP getting started: https://deepwiki.com/geeksville/Micro-RTSP/2-getting-started
- ESP32-RTSP tutorial: https://learn.circuit.rocks/esp32-cam-with-rtsp-video-streaming
- ESP32-RTSP source code: https://github.com/circuitrocks/ESP32-RTSP
- Tasmota webcam guide: https://cgomesu.com/blog/Esp32cam-tasmota-webcam-server/
- ESPHome RTSP server: https://beta.esphome.io/components/rtsp_server/
- Home Assistant community, ESP32-CAM into Frigate: https://community.home-assistant.io/t/adding-rtsp-stream-from-esp32-cam-into-frigate/300919/10
- Home Assistant community, ESP32-CAM RTSP not working: https://community.home-assistant.io/t/esp32-cam-rtsp-not-working/878614
- Espressif esp32-camera repo: https://github.com/espressif/esp32-camera
Last updated: 2026-11-21







