Add Auto live view option with transcoding options (#24519)
CI / AMD64 Build (push) Canceled after 0s
CI / AMD64 Smoke Test (push) Canceled after 0s
CI / ARM Build (push) Canceled after 0s
CI / Jetson Jetpack 6 (push) Canceled after 0s
CI / AMD64 Extra Build (push) Canceled after 0s
CI / ARM Extra Build (push) Canceled after 0s
CI / Synaptics Build (push) Canceled after 0s
CI / Assemble and push default build (push) Canceled after 0s

* implement auto mode for single camera live view

* add transcoded live streams and stream ordering for auto mode

Cameras can now add lower quality live streams that go2rtc transcodes to H.264 on demand. `live.transcode` takes a source stream and a list of heights and bitrates, and each quality becomes a `{camera}_transcode_{height}p` stream. The config validator adds them to `live.streams` without moving any the user already placed, and drops them when transcoding is disabled or a height changes. `create_config.py` writes them into go2rtc's generated config at startup, and saving the config or deleting a camera syncs them through go2rtc's API, so no restart is needed. They use `#hardware`, so go2rtc picks a hardware encoder and falls back to the CPU when there isn't one.

The Live playback settings stream list can be reordered by drag, since its order is the auto ladder. Auto order sorts it by bitrate, measuring native streams through a new admin-only `/go2rtc/streams/{name}/bitrate` endpoint and using the configured bitrate for transcoded ones. A pure reorder wasn't saved before because RJSF, the settings form, and `update_yaml` all ignore map key order. Sections can now mark a map with `orderedMaps`, which sends the whole map with `replace_paths` so `config_set` rewrites it in order.

Transcoded streams aren't in `go2rtc.streams`, which only lists yaml streams, so the frontend treated them as not restreamed and fell back to jsmpeg. Every restream check now goes through `isRestreamedStream`.

Auto treated any stall with no bytes in the last 2 seconds as a dead camera and handed it to the error fallback, which went straight to jsmpeg. Heavy congestion can stop delivery completely, so congested viewers skipped every lower stream. Auto now declines only when stats show the camera offline, and a stall on a live camera steps down. The stream picker also has a Try highest quality button that sends auto back to the top stream.

* fixes
This commit is contained in:
Josh Hawkins
2026-09-30 15:10:49 -06:00
committed by GitHub
parent 1bb61eb808
commit 2754f788cc
46 changed files with 3659 additions and 286 deletions
+3 -1
View File
@@ -45,7 +45,9 @@
}
},
"decodedFrames": "Decoded Frames:",
"droppedFrameRate": "Dropped Frame Rate:"
"droppedFrameRate": "Dropped Frame Rate:",
"stream": "Stream:",
"streamAuto": "{{stream}} (auto)"
},
"toast": {
"success": {
+24
View File
@@ -238,6 +238,30 @@
"label": "Live stream names",
"description": "Mapping of configured stream names to restream/go2rtc names used for live playback."
},
"transcode": {
"label": "Transcoded streams",
"description": "Lower-quality live streams transcoded on demand by go2rtc.",
"enabled": {
"label": "Enable transcoded streams",
"description": "Add lower-quality live streams that go2rtc transcodes in real time while someone is watching."
},
"source": {
"label": "Source stream",
"description": "go2rtc stream to transcode. Defaults to the first live stream."
},
"qualities": {
"label": "Qualities",
"description": "One transcoded stream is added per quality.",
"height": {
"label": "Height",
"description": "Output height in pixels; width follows the source aspect ratio."
},
"bitrate": {
"label": "Bitrate",
"description": "Target and maximum video bitrate in kbps."
}
}
},
"height": {
"label": "Live height",
"description": "Height (pixels) to render the jsmpeg live stream in the Web UI; must be <= detect stream height."
+24
View File
@@ -594,6 +594,30 @@
"label": "Live stream names",
"description": "Mapping of configured stream names to restream/go2rtc names used for live playback."
},
"transcode": {
"label": "Transcoded streams",
"description": "Lower-quality live streams transcoded on demand by go2rtc.",
"enabled": {
"label": "Enable transcoded streams",
"description": "Add lower-quality live streams that go2rtc transcodes in real time while someone is watching."
},
"source": {
"label": "Source stream",
"description": "go2rtc stream to transcode. Defaults to the first live stream."
},
"qualities": {
"label": "Qualities",
"description": "One transcoded stream is added per quality.",
"height": {
"label": "Height",
"description": "Output height in pixels; width follows the source aspect ratio."
},
"bitrate": {
"label": "Bitrate",
"description": "Target and maximum video bitrate in kbps."
}
}
},
"height": {
"label": "Live height",
"description": "Height (pixels) to render the jsmpeg live stream in the Web UI; must be <= detect stream height."
+13
View File
@@ -132,6 +132,19 @@
},
"stream": {
"title": "Stream",
"auto": {
"label": "Auto",
"tips": "Switches streams to match your connection",
"selected": "Auto · {{stream}}",
"floorLabel": "Low bandwidth",
"retry": "Try highest quality",
"reason": {
"bandwidth": "Playing {{stream}} because the connection couldn't keep up with a higher-quality stream",
"codec": "Playing {{stream}} because this browser can't play a higher-quality stream",
"saveData": "Playing {{stream}} because Data Saver is on",
"floor": "Playing the low-bandwidth feed because no stream could keep up"
}
},
"audio": {
"tips": {
"title": "Audio must be output from your camera and configured in go2rtc for this stream."
+22 -1
View File
@@ -1553,7 +1553,27 @@
"noGo2rtcStreams": "No go2rtc streams configured",
"availableStreams": "Available streams",
"useCustom": "Use \"{{value}}\"",
"addStream": "Add stream"
"addStream": "Add stream",
"reorderHandle": "Drag to reorder",
"transcodedBadge": "Transcoded",
"autoOrder": "Auto order",
"autoOrderTips": "Measure each stream's bitrate and sort highest first",
"measuring": "Measuring…",
"rate": "{{kbps}} kbps",
"rateSet": "{{kbps}} kbps (set)",
"rateFailed": "Couldn't measure"
},
"liveTranscode": {
"title": "Transcoded streams",
"description": "Adds lower-quality streams that go2rtc transcodes in real time while someone is watching.",
"unavailable": "Transcoded streams need a go2rtc stream to read from. Add one under go2rtc streams first.",
"enable": "Enable transcoded streams",
"source": "Source stream",
"height": "Height",
"heightOption": "{{height}}p",
"bitrate": "Bitrate (kbps)",
"addQuality": "Add quality",
"removeQuality": "Remove quality"
},
"timezone": {
"defaultOption": "Use browser timezone"
@@ -1788,6 +1808,7 @@
"toast": {
"success": "Settings saved successfully",
"applied": "Settings applied successfully",
"go2rtcSyncFailed": "Saved, but go2rtc couldn't be updated. Restart Frigate to apply.",
"successRestartRequired": "Settings saved successfully. Restart Frigate to apply your changes.",
"error": "Failed to save settings",
"validationError": "Validation failed: {{message}}",