Webcam: snapshot not working in octoprint (but OK in browser) [SOLVED]

Camera model

IPEVO HD PLUS

What is the problem?

I'm running octoprint on imac sequoia and the jpeg snapshot URL (crucial to the functioning of AI failure detection) won't work.

I'm using the mjpegsw.py to stream my camera. Testing in the browser I can stream from the camera at http://<mac local ip address>:8080/cam.mjpg and I can get a jpg snapshot at http://<mac local ip address>:8080/snap.jpg (also via curl). These are set up to work with both localhost and the local IP address.

So all should be well...

But when I set up the snapshot URL in the Classic Webcam plugin and click "Test", it fails "Could not retrieve snapshot URL, please double check the URL". The stream URL works fine.

At this point I am lost. I feel like it is so close to working.

What did you already try to solve it?

Lots of variations of the URL which all work from the browser but not from octoprint. I changed the image size to quite small in case there was an issue with size of the snapshot.

Have you tried running in safe mode?

No

Did running in safe mode solve the problem?

WRITE HERE

Systeminfo Bundle

octoprint-systeminfo-20250817200926.zip (38.7 KB)

Notice tons of errors from Obico, try disabling that. There's a feature in Obico for "premium" streaming support or something like that and it has caused weirdness for others in the past.

1 Like

I would try setting the snapshot url to http://127.0.0.1:8080/snap.jpg

According to the readme of this streaming tool...

on octoprint you can use http://localhost:5001/cam.mjpg for stream url and http://localhost:5001/snap.jpg for snapshot url.

Thanks for the suggestion of disabling the noisy plugin that was stopping from spotting the crucial error message.

The problem comes from the fact that I am using python 3.13. This version is ahead of octoprint. My bad. The issue is In Python 3.13, the cgi module has been removed from the standard library. I did a quick fix with

source ~/OctoPrint/venv/bin/activate
pip install legacy-cgi

and everything is working. Of course, the right fix would be to install python 3.11 (however you do that) but for now I have something working.

1 Like

Good catch. I think that might be fixed in the next release of OctoPrint 1.11.3 once foosel is back from vacation.