diff --git a/README.md b/README.md index b9ba344..db6d181 100644 --- a/README.md +++ b/README.md @@ -25,12 +25,14 @@ RTSP feeds can be toggled on/off at runtime from the web UI without restarting t The **raw HTTP stream and snapshot** (`/stream/raw`, `/snapshot/raw`, and the mjpg_streamer-compatible `/webcam/?action=stream` and `/webcam/?action=snapshot`) are always available, regardless of any runtime toggle. They never carry the overlay. Point OctoPrint's Classic Webcam plugin at these URLs for reliable live feeds and snapshot capture. -The **overlay feed** is a separate master toggle (rendering, MJPEG, RTSP). It defaults to **off** so a fresh install serves only the raw feed and consumes no CPU for the overlay. The RTSP overlay sub-toggle is preserved across master toggles but the ffmpeg process only runs when both are on. +The **overlay feed** is a separate master toggle (rendering, MJPEG, RTSP). It defaults to **on** in **HTML** mode, so a fresh install shows the stats over the live picture in the web UI without doing any server-side JPEG decode/draw/encode. The RTSP overlay sub-toggle is preserved across master toggles but the ffmpeg process only runs when the master is on **and** the overlay type is baked. **Overlay type** can be switched at runtime between two modes: -- **Baked**: the overlay is rendered server-side and burned into the JPEG frames. Works with OctoPrint, VLC, and any RTSP consumer. Higher CPU cost. -- **HTML**: the overlay is drawn client-side over the raw stream. No JPEG decode/draw/encode on the server. Web-only — `/stream/overlay` and `/snapshot/overlay` return 503 and the RTSP overlay process is stopped. +- **HTML** (default): the overlay is drawn client-side over the raw stream. No JPEG decode/draw/encode on the server. Web-only — `/stream/overlay` and `/snapshot/overlay` return 503 and the RTSP overlay process is stopped. +- **Baked**: the overlay is rendered server-side and burned into the JPEG frames. Required for OctoPrint, VLC, or any consumer that expects the stats inside the video stream. Higher CPU cost. + +All toggles — master overlay, overlay type, and both RTSP feed states — persist in the state file (`/var/lib/octocam/feeds.json` by default) and survive reboots. ## Architecture diff --git a/internal/pipeline/pipeline.go b/internal/pipeline/pipeline.go index b5b65a9..a06e023 100644 --- a/internal/pipeline/pipeline.go +++ b/internal/pipeline/pipeline.go @@ -126,8 +126,10 @@ type pipelineState struct { } func (p *Pipeline) loadState() pipelineState { - // Default: overlay off, baked overlay if enabled, both RTSP feeds off. - state := pipelineState{OverlayBaked: true} + // Defaults on first run: overlay enabled in HTML mode (no server-side + // JPEG decode/draw/encode), both RTSP feeds off. The state file overrides + // any field it specifies, so toggles set by the user persist across reboots. + state := pipelineState{OverlayEnabled: true} data, err := os.ReadFile(p.cfg.StateFile) if err != nil { return state // file absent = first run, use defaults