Learn/rusty_esp_videocamerawebserveresp32mjpegrust

rusty_esp_video Is a Pure Rust Alternative to CameraWebServer

rusty_esp_video is a pure Rust alternative to CameraWebServer: MJPEG a browser opens on your LAN, plus RTP, with loss counted instead of hidden.

Signed by M·
Dusk brick porch with a camera brick on a post, its orb threaded to the homes on the same street and not to the sky
Is rusty_esp_video a pure Rust alternative to CameraWebServer?

For a page on your LAN, yes. rusty_esp_video is a pure Rust alternative to CameraWebServer: MJPEG a browser opens, plus RTP for JPEG and H.264. On a XIAO ESP32-S3 Sense it held 13.8 fps at QVGA under a 15 fps cap. H.264 on the chip is host-verified only, and WebRTC is out of scope.

Related reading

Builder field note

ESP32 Video Streaming in Rust: A Porch Camera That Stays Home

APIs, composition, and home deployment for ESP32 Video Streaming in Rust: A Porch Camera That Stays Home live on the field note.

rusty_esp_video is a pure Rust alternative to CameraWebServer for a porch camera that stays in the house. Espressif's CameraWebServer example is the market standard: multipart/x-mixed-replace over HTTP, one JPEG per part, opened in a browser. Janus keeps that page and adds payloaders you can check with ffmpeg. This page is the comparison. The builder field note on rusty_esp_video is the format record. It belongs to the See vision.

What CameraWebServer taught everyone

The example is famous because it is small. The sensor emits JPEG. The socket sends the parts. A phone on the same Wi-Fi opens the page. That is the right first demo, and it is also where most copied sketches stop.

The page, without the copy

The camera already produces JPEG, so a passthrough encoder hands the sensor's bytes to the network without a second encode. The frame is borrowed, not duplicated, which matters when fast RAM is a few hundred kilobytes. Capture itself is rusty_esp_image. A pure Rust alternative to CameraWebServer still serves that multipart page. It does not make you install a viewer.

What the example does not count

A live stream gains nothing from a frame that arrives after the next one. This crate drops a frame whole and counts it. Congestion shows up as a lower frame rate and a counter, never as delay that grows until the picture is seconds behind the porch. That counter is the difference a pure Rust alternative to CameraWebServer is for.

Formats, and the row that ran

MJPEG over HTTP is the browser page. RTP payloaders cover JPEG (RFC 2435) and H.264 (RFC 6184). An MPEG-TS muxer carries H.264, and a raw UDP framer exists. H.264 encoding uses the house encoder in Constrained Baseline. ffmpeg and rff read the MJPEG, RTP/JPEG, and RTP/H.264 streams.

The XIAO soak

On a Seeed XIAO ESP32-S3 Sense the MJPEG path held 13.8 fps at QVGA under a 15 fps cap. Ten minutes of unicast RTP lost one packet in 20,120. The firmware can join your Wi-Fi or host janus-cam, a WPA2 network of its own, so a camera past the router still has a receiver on a laptop. No vendor server sits in the path. A smart home without the cloud is the reason that constraint exists.

H.264 is not a frame-rate claim yet

On-chip H.264 is host-verified only. The encoder compiles for the S3 bare-metal target, and ffprobe reads the QVGA stream as Constrained Baseline. Frames per second and PSRAM use on the S3 are open rows. The ESP32-P4 hardware encoder is planned behind the same trait and has not been measured. Full WebRTC is out of scope for v1. A pure Rust alternative to CameraWebServer that advertised a WebRTC stack would be describing a different project.

Where the example still wins

Keep CameraWebServer when you want Espressif's C example, unmodified, as the first afternoon with a new board. It is shorter than a Janus firmware, and it does not pretend to be a mesh camera.

Honest limits

  • H.264 frame rate on the S3 is not measured. Do not quote one.
  • The generated porch sketch paces audio from the camera, so a combined camera and microphone drops audio blocks. The video soak above is the video path. The gap is recorded on the audio comparison.
  • Track A runs on ESP-IDF. There is no C in this crate's payloaders. The camera driver underneath on Track A is still Espressif's, as rusty_esp_image says in its own comparison.

CameraWebServer's gift is that the URL is obvious. Keep that. A pure Rust alternative to CameraWebServer still wants a browser pointed at the device, on the same LAN, with no store install. What it adds is a second consumer, ffmpeg, so a recording or a check does not depend on one web page staying open. If your only requirement is the page, the example remains shorter. If you also need the loss counter, the RTP payloader, and a laptop run of the same code path, the example stops being the whole product. A pure Rust alternative to CameraWebServer is that second requirement, written down with the rows that are still open. A pure Rust alternative to CameraWebServer does not get faster by wishing the H.264 row closed. A pure Rust alternative to CameraWebServer ships the MJPEG page that was actually timed. A pure Rust alternative to CameraWebServer can wait on the P4.

Where to start

Choose a camera board in choosing an ESP32 board, flash with espino, and open /stream on the LAN. The Learn index and the field note have the ledger.

The source is part of Remade With Rust, the household identity is MATA, and the language is Rust. When a camera datasheet needs to become a retrieval corpus, the same house runs RAG Converter.

FAQ

Quick answers for builders evaluating this technology.

Can I open the stream without installing CameraWebServer?

Yes. The MJPEG page is the device's /stream address in any browser. ffmpeg and the house reader rff also read MJPEG, RTP/JPEG, and RTP/H.264, which is how every format was checked.

What did ten minutes of RTP lose?

On a XIAO ESP32-S3 Sense, ten minutes of unicast RTP lost one packet in 20,120. The stream drops a late frame whole and counts it, so congestion shows up as a lower frame rate, not as growing delay.

Is on-chip H.264 part of this pure Rust alternative to CameraWebServer?

Not as a measured row. The encoder compiles for the ESP32-S3 bare-metal target and ffprobe reads a QVGA stream as Constrained Baseline. Frames per second on the S3 are still open. The P4 hardware encoder is planned and not built.

Does the camera need a vendor server?

No. The firmware can join your Wi-Fi or host its own WPA2 network called janus-cam, so a camera out of router range still has a place to send the picture. Nothing in the path is a vendor cloud.

When should I keep the Espressif CameraWebServer example?

When you want the example as shipped, in C, on the Arduino or IDF template, and you do not need RTP, a counted loss, or the same code on a laptop. The example is a fine first page.