My ESP32 Cam is not working as a webcam

Hello everybody! I hope you're all doing well.

I recently set up octoprint on my Raspberry Pi 2 B+ so I can use it on my Creality Ender 3 V2. Everything is working fine, except for the webcam.

I want to use the ESP32 camera module as the web cam however it just doesn't seem to work. The time-lapse works fine, its just the stream.

Note: When I try to open the stream directly from the browser, it works.

I really hope i could get your input to solve the issue. Thank you in advance!

What URL do you test in your browser, and what url do you have configured in the OctoPrint settings as the stream URL?

1 Like

Also see this thread: Octoprint with ESP32 with camera

1 Like

As info, many ESP32CAM firmwares are limited by being able to stream to a single client only. i.e. If you are testing and watching the stream in your browser, then other clients connecting to the camera will possibly be unable to get the stream. Just throwing it out there, in case this limitation might be affecting you.

http://192.168.1.63:81/stream

This is the URL configured and the same one I use in the browser. It works as a browser but not when configured.

Thanks for telling me, but I already knew that and I was testing them separately :slight_smile:

What address are you using to access OctoPrint?

You can also check the browser's error console to find out why it's not loading.

Octopi.local

Try using the IP address to access OctoPrint to see if that works.

Is that a direct link to an mjpeg stream, or is that a link to an HTML page that includes an <img> pointing to an mjpeg stream?

Thank you so much, I accessed Octoprint using its IP and it worked. The webcam is completely functional. Thanks again <3

Then the issue is confirmed - it's a browser security feature that blocks accessing local IP addresses from what it perceives as 'public' sites. It can't tell if octopi.local is private or public. You can only access the camera with a local IP if OctoPrint is accessed from a local IP. Hope that's clear enough...

1 Like

So another solution would be to find out the hostname of the esp32, and use that in the stream url instead of the ip address.

1 Like