Low-latency MJPEG live-view relay: authenticates to each camera server-side and re-serves its native MJPEG (browsers block credentials in <img> subresource URLs). Pure page/model in the lib; the streaming proxy is the camera-liveview binary. Harvested from frigate-box/crates/liveview.
| Tier | operations |
| Role | capability |
| Path | crates/operations/camera-liveview |
| Edition | 2021 |
| Targets | camera-liveview, operations_camera_liveview |
| Public items | 9 across 0 modules |
| Tests | 7 |
What it is for
Low-latency MJPEG live-view relay (Sprint 10, US-10.1).
Frigate's go2rtc live view transcodes and is choppy on the CPU-only box. This serves the Axis cameras' native MJPEG directly in <img> tags — near-zero latency. Because browsers block credentials in subresource URLs, a relay authenticates to each camera server-side and re-serves the stream. This module is the pure part: the camera model + the generated HTML page (grid + click-to-fullscreen toggle). The streaming proxy lives in the frigate-box-liveview binary.
Capabilities
crate root
Low-latency MJPEG live-view relay (Sprint 10, US-10.1).
| Item |
|---|
fn basic_auth(user : & str, pass : & str) -> String |
fn snapshot_url(mjpeg_url : & str) -> String |
fn normalize_multipart_boundary(content_type : & str) -> String |
Feed
Low-latency MJPEG live-view relay (Sprint 10, US-10.1).
| Item |
|---|
pub struct Feed |
fn index_html(feeds : & Feed) -> String |
LiveConfig
Low-latency MJPEG live-view relay (Sprint 10, US-10.1).
| Item |
|---|
pub struct LiveConfig |
ViewerAuth
Low-latency MJPEG live-view relay (Sprint 10, US-10.1).
| Item |
|---|
pub struct ViewerAuth |
ViewerAuth :: fn expected_header(& self) -> String |
fn viewer_authorized(viewer : Option <& ViewerAuth>, remote_is_loopback : bool, auth_header : Option <& str>,) -> bool |
How to use it
No examples/ target and no doctest in this crate's rustdoc. The tests listed under Verification are the closest executable usage.
Module structure
No public modules: the crate root is its whole surface.
Public surface
`crate root`
| Item | What it is |
|---|---|
pub struct Feed | One camera feed in the live view |
pub struct LiveConfig | Relay config (from /config/live/liveview.toml). |
pub struct ViewerAuth | Viewer login for the live-view page (viewer in liveview.toml) |
ViewerAuth :: fn expected_header(& self) -> String | The exact Authorization header value an authenticated browser must send. |
fn viewer_authorized(viewer : Option <& ViewerAuth>, remote_is_loopback : bool, auth_header : Option <& str>,) -> bool | Whether a request is allowed to view |
fn basic_auth(user : & str, pass : & str) -> String | The Basic <base64> credential for a feed (server-side auth injection). |
fn snapshot_url(mjpeg_url : & str) -> String | Derive a single-JPEG snapshot URL from an Axis MJPEG stream URL |
fn normalize_multipart_boundary(content_type : & str) -> String | Normalize a proxied multipart/x-mixed-replace Content-Type so the declared boundary= token exactly matches the --<boundary> separator the camera writes between JPEG frames |
fn index_html(feeds : & Feed) -> String | Render the live-view page: a responsive grid of MJPEG tiles, each click-to-fullscreen (click a tile → it fills the window and the rest hide; click again → back to the grid). |
No pub use re-exports: every item above is declared in this crate.
Boundary
Depends on no other workspace tier.
Shares tier operations with 40 other crates: operations-approval-workflow, operations-assessments, operations-block-imaging, operations-boot-media, operations-browser-agent-worker, operations-camera-discovery, operations-camera-registry, operations-compliance, … (40 total).
_What this crate deliberately does NOT own is a judgment. No committed registry records one for it, so none is stated here._
Where it sits
| Tier (ontology) | operations |
| Architectural role (taxonomy) | capability |
| Location | crates/operations/camera-liveview |
| Vocabulary in force (lexicon) | current |
Dependencies
Runtime, from outside the workspace.
| Crate | Requirement | Features | Optional | Only on |
|---|---|---|---|---|
base64 | ^0.22 | — | no | always |
constant_time_eq | ^0.4 | — | no | always |
serde | ^1 | derive | no | always |
tiny_http | ^0.12 | — | no | always |
toml | ^0.8 | — | no | always |
ureq | ^2.12 | — | no | always |
Development. None.
Build. None.
Depended on by. Nothing in this workspace.
Feature flags
No Cargo features are defined: every capability is unconditional, so no consumer can receive a half-wired crate.
Targets
| Kind | Name | Source |
|---|---|---|
| bin | camera-liveview | `src/bin/camera-liveview.rs` |
| lib | operations_camera_liveview | `src/lib.rs` |
Error model
No public error type was detected: no public item declares a type named *Error, and no public signature returns one.
Operational characteristics
| Property | Evidence |
|---|---|
| async public surface | none detected |
| async runtime | none detected |
| database access | none detected |
| network I/O | none detected |
| unsafe code | none detected |
| environment variables | none detected |
No unsafe block, unsafe fn, unsafe impl or unsafe trait was found by the parser anywhere in this crate's source.
Configuration
No environment variable is read with a literal name anywhere in this crate. A variable whose key is computed at run time cannot be listed here, and is not claimed to be absent.
Related capabilities
No workspace crate depends on this one.
Verification
| Kind | Count |
|---|---|
| Unit tests | 7 |
| Integration tests | 0 |
| Examples | 0 |
| Doctests | 0 |
Evidence by module. How often each public module is named by something executable.
| Module | Tests | Examples | Consumers |
|---|---|---|---|
crate root | 8 | 0 | 0 |
What the tests establish, by name:
basic_auth_is_base64_of_user_colon_pass—src/lib.rsboundary_is_normalized_to_dash_prefixed_for_webkit—src/lib.rsgrid_columns_fill_the_screen_as_a_wall—src/lib.rshtml_has_a_snapshot_tile_per_camera—src/lib.rshtml_has_the_fullscreen_toggle—src/lib.rslabels_are_html_escaped—src/lib.rssnapshot_url_derives_axis_jpg_endpoint—src/lib.rs
Documentation coverage
| Measure | Documented | Total |
|---|---|---|
| Public items with rustdoc | 9 | 9 |
Public modules with a //! block | 0 | 0 |
pie showData
title Public items with rustdoc
"Documented" : 9
"No rustdoc detected" : 0
Metrics
| Metric | Value |
|---|---|
| Rust source files | 2 |
| Source lines | 522 |
| Code lines | 407 |
| Public API items | 9 |
| Public modules | 0 |
| Tests | 7 |
| Examples | 0 |
| Cargo features | 0 |
| Direct runtime dependencies | 6 |
| Workspace reverse dependencies | 0 |
pie showData
title Public API by kind
"function" : 5
"method" : 1
"struct" : 3
pie showData
title Rust source composition
"Code" : 407
"Blank or comment" : 115
Generation
Rendered by tools-corpus corpus readme from repository evidence alone, renderer schema 2, lexicon current. No model, network service or database was consulted. Regenerate with tools-corpus corpus readme --write; verify with --check.