ESP32-CAM rtsp not working

Hey,

I’m new in Home Assistant environment and I’m having issues to add an ESP32-CAM to my environement.
I’m on it for almost 6h and I really don’t understand what’s going on (neither Chat GPT nor Mistral AI)…

I have installed Add-ons ESPHome Device Builder and Frigate
My ESP32-CAM is recognized in ESPHome, when I clic Visit I have something:

Here is my yaml file:

Summary
esphome:
  name: esp32_cam
  platformio_options:
    board_build.f_cpu: 240000000L

esp32:
  board: esp32cam
  framework:
    type: arduino

# Enable logging
logger:

# Enable Home Assistant API
api:

# OTA configuration
ota:
  platform: esphome

wifi:
  ssid: "XXXXXXXXXXX"
  password: "YYYYYYYYY"

# Camera configuration
esp32_camera:
  name: "ESP32 Camera"
  external_clock:
    pin: GPIO0
    frequency: 20MHz
  i2c_pins:
    sda: GPIO26
    scl: GPIO27
  data_pins: [GPIO5, GPIO18, GPIO19, GPIO21, GPIO36, GPIO39, GPIO34, GPIO35]
  vsync_pin: GPIO25
  href_pin: GPIO23
  pixel_clock_pin: GPIO22
  power_down_pin: GPIO32
  resolution: 640x480
  jpeg_quality: 10

# Enable the web server to view the camera feed
web_server:
  port: 80

# Enable the RTSP server
esp32_camera_web_server:
  port: 8080
  mode: stream

The RTSP is not viewable with VLC nor ffplay

I tried this in frigate.yaml

Summary
mqtt:
  enabled: false

cameras:
  esp32_cam: # <------ Name the camera
    enabled: true
    ffmpeg:
      inputs:
        - path: rtsp://192.168.1.15:554/stream # <----- The stream you want to use for detection
          roles:
            - detect
    detect:
      enabled: false # <---- disable detection until you have a working camera feed
      width: 1280
      height: 720
      fps: 5
    objects:
      track:
        - person
        - car
    zones:
      front_door:
        coordinates: 0,0,1,0,1,1,0,1
        objects:
          - person

But it refused to start, here are the logs

Summary
2025-04-16 16:38:58.630258916  [2025-04-16 18:38:58] frigate.video                  ERROR   : esp32_cam: Unable to read frames from ffmpeg process.
2025-04-16 16:38:58.630575619  [2025-04-16 18:38:58] frigate.video                  ERROR   : esp32_cam: Unable to read frames from ffmpeg process.
2025-04-16 16:38:58.630842249  [2025-04-16 18:38:58] frigate.video                  ERROR   : esp32_cam: ffmpeg process is not running. exiting capture thread...
2025-04-16 16:39:04.198009095  [INFO] Starting go2rtc healthcheck service...
2025-04-16 16:39:18.397200324  [2025-04-16 18:39:18] watchdog.esp32_cam             ERROR   : Ffmpeg process crashed unexpectedly for esp32_cam.
2025-04-16 16:39:18.406328932  [2025-04-16 18:39:18] watchdog.esp32_cam             ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
2025-04-16 16:39:18.406335358  [2025-04-16 18:39:18] ffmpeg.esp32_cam.detect        ERROR   : [tcp @ 0x559db7be60] Connection to tcp://192.168.1.15:554?timeout=5000000 failed: Connection refused
2025-04-16 16:39:18.406339432  [2025-04-16 18:39:18] ffmpeg.esp32_cam.detect        ERROR   : rtsp://192.168.1.15:554/stream: Connection refused

Do you have some ideas please?

The camera web server does not provide a rtsp service afaik. See the docs (and not some AI delusion).

The key is the term http

1 Like

You are right, I’ve read more to try to understand it more, nevertheless I keep having issue and I don’t understand why.

I find that I have a AI Thinker ESP32-CAM using docs.platformio.org/en/latest/boards/espressif32/esp32cam.html

I also find the pins definition here https://randomnerdtutorials.com/esp32-cam-ai-thinker-pinout/

I pick the YAML exemple here: https://esphome.io/components/esp32_camera.html#configuration-examples

And as I read / view and internet, it hsould works, more or less, just with that (as I understand), e.g.: https://www.youtube.com/watch?v=gT9EfT69a2o

And I think my web server is correctly defined:

# Enable the RTSP server
esp32_camera_web_server:
  - port: 8080
    mode: stream
  - port: 8081
    mode: snapshot

I am ready to understrand by myself, could you give me some leads please?

Oh, my bad, you mean that the URL should me http:// and not rtsp:// maybe? :confounded:

That’s what the docs say. Dunno why you thought esphome creates a rtsp stream.

I tried to apply without understanding…

But it is still not working and I don’t get why.

  • ESP32 is flashed,visible and online in ESPHome
esp32cam-1.yaml
esphome:
  name: esp32_cam_1
  platformio_options:
    board_build.f_cpu: 240000000L

esp32:
  board: esp32cam
  framework:
    type: arduino

# Enable logging
logger:

# Enable Home Assistant API
api:

# OTA configuration
ota:
  platform: esphome

wifi:
  ssid: "xxxxxxxxx"
  password: "yyyyyyyyyy"

# Camera configuration
esp32_camera:
  name: "ESP32 Camera"
  external_clock:
    pin: GPIO0
    frequency: 20MHz
  i2c_pins:
    sda: GPIO26
    scl: GPIO27
  data_pins: [GPIO5, GPIO18, GPIO19, GPIO21, GPIO36, GPIO39, GPIO34, GPIO35]
  vsync_pin: GPIO25
  href_pin: GPIO23
  pixel_clock_pin: GPIO22
  power_down_pin: GPIO32
  resolution: 640x480
  jpeg_quality: 10

# Enable the web server to view the camera feed
web_server:
  port: 80

# Enable the RTSP server
esp32_camera_web_server:
  - port: 8080
    mode: stream
  - port: 8081
    mode: snapshot
  • ESP32 is pingable on 192.168.1.15
  • http://192.168.1.15:8080/stream and http://192.168.1.15:8081/snapshot are unreacheable
  • VLC can’t read http://192.168.1.15:8080/stream
  • And by the way Frigate is not able to start using
frigate.yaml
mqtt:
  enabled: false

cameras:
  esp32cam_1: # <------ Name the camera
    enabled: true
    ffmpeg:
      inputs:
        - path: http://192.168.1.15:8080/stream # <----- The stream you want to use for detection
          roles:
            - detect
    detect:
      enabled: false # <---- disable detection until you have a working camera feed
      width: 640
      height: 480
      fps: 5
    objects:
      track:
        - person
        - car
    zones:
      front_door:
        coordinates: 0,0,1,0,1,1,0,1
        objects:
          - person
Frigate logs
2025-04-18 07:09:21.384681504  [2025-04-18 09:09:21] frigate.video                  ERROR   : esp32cam_1: Unable to read frames from ffmpeg process.
2025-04-18 07:09:21.385233189  [2025-04-18 09:09:21] frigate.video                  ERROR   : esp32cam_1: ffmpeg process is not running. exiting capture thread...
2025-04-18 07:09:25.592211872  [INFO] Starting go2rtc healthcheck service...
2025-04-18 07:09:41.041784349  [2025-04-18 09:09:41] watchdog.esp32cam_1            ERROR   : Ffmpeg process crashed unexpectedly for esp32cam_1.
2025-04-18 07:09:41.041790831  [2025-04-18 09:09:41] watchdog.esp32cam_1            ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
2025-04-18 07:09:41.041798053  [2025-04-18 09:09:41] ffmpeg.esp32cam_1.detect       ERROR   : [tcp @ 0x558f45c660] Connection to tcp://192.168.1.15:8080 failed: Connection refused
2025-04-18 07:09:41.041829182  [2025-04-18 09:09:41] ffmpeg.esp32cam_1.detect       ERROR   : http://192.168.1.15:8080/stream: Connection refused

Remove the “normal” webserver component.
Enter to the stream from your browser: https://ip-address:8080

http://192.168.1.15 works

http://192.168.1.15:8080 is unreachable

http://192.168.1.15:8080/stream is unreachable

I updated the firmware wirelessly and I saw this in the upload logs:

[10:41:56][C][esp32_camera:080]:   Resolution: 640x480 (VGA)
[10:41:56][E][esp32_camera:123]:   Setup Failed: ESP_ERR_NOT_SUPPORTED
[10:41:56][E][component:082]:   Component esp32_camera is marked FAILED: 
[09:37:11][C][esp32_camera_web_server:088]: ESP32 Camera Web Server:
[09:37:11][C][esp32_camera_web_server:089]:   Port: 8080
[09:37:11][C][esp32_camera_web_server:091]:   Mode: stream
[09:37:11][E][esp32_camera_web_server:097]:   Setup Failed
[09:37:11][E][component:082]:   Component esp32_camera_web_server is marked FAILED: 
[09:37:11][C][esp32_camera_web_server:088]: ESP32 Camera Web Server:
[09:37:11][C][esp32_camera_web_server:089]:   Port: 8081
[09:37:11][C][esp32_camera_web_server:093]:   Mode: snapshot
[09:37:11][E][esp32_camera_web_server:097]:   Setup Failed
[09:37:11][E][component:082]:   Component esp32_camera_web_server is marked FAILED: 

did you remove web server component?

When I remove it, http://192.168.1.15 is not reacheable anymore, and the rest is still not working

The problem might come from the errors in the logs I think, but I don’t know how to resolve it

Setup Failed: ESP_ERR_NOT_SUPPORTED

The error message seems clear to me. It is saying your camera is not supported.

What has you convinced your camera should be supported/work?

I found this blog post about someone making it work:

I am going to try that, since I think I have one of the cameras on my desk still waiting.

Helpful of you to finally post your log showing that your setup of esp camera is failing. Fix that first.

Thanky you @neel-m! Unfortunately I returned them thinking they have an issue…

I read that OV2640 was a better quality, what are your thoughts on this?

OV2640: Specs, Camera, Datasheet & Alternative (2022 Report) has a decent description of the sensor

It all depends on what you are trying to do. Some people are lured by the promise of more mega pixels. In some cases more is better, but in a lot of cases (fewer, but much) better pixels are a lot better. In particular, challenging lighting conditions (pretty much everything indoors and many things outdoors) demand better pixels. The more mega pixels sensors only work better under ideal lighting conditions, which are rare (unless you can control it exceptionally well).

Either before or after attempting to get two AI services to figure it out for you, did you or either AI think to go look at the Esphome documentation for the esp32-cam throughout any of that 6 hours of pleading with the Chatbots?

It would have taken you 5min to look at the documentation and find out that it doesnt support RTSP and it even explains how to stream it of http so you can use the feed somewhere else. It actually answers your question in the very first few sentences at the top of the page and wouldn’t have taken 5min even.

I would strongly suggest that next time you have an issue, start looking for the answer in the documentation so that you actually get an answer to begin with and it will be the correct answer. I would also suggest you not make it a habit of relying on a chatbot to do your research or let it do the critical thinking that you should be doing yourself.

1 Like

Hi Jaggana, the ESPHome builder version does not provide a RTSP stream. You need to setup the go2rtc module of frigate to accept the https stream or you need to flash the esp with an rtsp software set. I howve done both. The front door is running the ESPhome module as it can take a picture very fast. The downside is that frigate needs to transcode the stream what is very processor demanding. The other cameras around my house produce a rtsp stream and do not need recoding by the grigate server. Downturn is that the can not take instand pictures ond demand by heome asssitanrt. If you find ESPhome builder software that does make an rtsp stream than please keep me posted.

Probably better to just use a better camera instead of a novelty one thats more for educational uses.

For 15-25$ they could get an actual camera with far better quality and features that dont have reputations for overheating and self-destructing.

It works perfectly with a proper OV2640
Sorry for the inconvenience :pray: