External integration - MJPEG and still image cameras (ESP32-CAM, IP cameras, webcams)

Hi everyone!

Gladys can already display RTSP cameras. This one handles all those that only speak HTTP:

  • ESP32-CAM for a few euros;
  • old IP cameras;
  • webcams served by motion, motionEye, or mjpg-streamer;
  • an old Android phone with the « IP Webcam » app.

All without ffmpeg and without cloud.

What it does

  • One camera device per address: a static image URL (/capture, snapshot.cgi…) or an MJPEG stream. The integration takes the first image from the stream and then closes the connection.
  • One image every 10 seconds in the camera widget (adjustable, or only on demand), plus a fresh image every time Gladys requests it. It is used for the live view and the « send a camera image » action.
  • Passwords: Basic and Digest authentication, the latter being the one used by most IP cameras. The password can be placed in a hidden field.
  • Large images automatically resized to fit within Gladys’s 150 KB limit.
  • Two scene triggers: camera offline (after 3 failed captures), camera back online.
  • A « Test Cameras » button: the type, resolution, size, and time of each capture, or the error.

The cool thing

  • An ESP32-CAM in the garage or chicken coop, and its image on the dashboard, without installing anything else.
  • An old IP camera without RTSP is back in service.
  • Camera offline → a message, before realizing it hasn’t been filming for a week.

Installation

Gladys 5.1 minimum. It will be available in the store at the next indexer update. In a hurry? Integrations → Install from GitHub, with the address GitHub - LM1LC3N7/gladys-mjpeg-camera: Gladys Assistant external integration for MJPEG and snapshot IP cameras (ESP32-CAM, older IP cameras, webcams): camera images in Gladys without RTSP, on the local network. · GitHub

  1. Enter the addresses of your cameras, separated by commas, each followed by a name if you want: http://192.168.1.50/capture Chicken Coop, http://192.168.1.20/cgi-bin/snapshot.cgi|Entrance The documentation provides common addresses: ESP32-CAM, motionEye, Hikvision, Axis…
  2. Click on Test Cameras, then add them in Discovery.

Honest small reservations

  • Written without a camera at hand. The MJPEG format and Digest authentication follow the standards and have been tested against a fake camera (Digest verified on the official examples of the standard). Your feedback, model by model, is welcome.
  • An ESP32-CAM only serves its stream to one client at a time: prefer its /capture address over :81/stream.
  • Resizing a large image requires computation. A camera that needs it is read at most every 30 seconds, and lowering its resolution remains the best choice.
  • For an RTSP camera, keep Gladys’s RTSP integration.

Like the previous ones, developed with Claude Code. Independent project, with no link to any camera manufacturer.

Repository: GitHub - LM1LC3N7/gladys-mjpeg-camera: Gladys Assistant external integration for MJPEG and snapshot IP cameras (ESP32-CAM, older IP cameras, webcams): camera images in Gladys without RTSP, on the local network. · GitHub