Add sub stream recording with adaptive quality playback (#24009)

* add sub stream recording with adaptive quality playback

Optionally record a second, lower bitrate stream alongside the main
recording stream via a `record_sub` input role and `record.sub` config block, with its own retention windows.
Recordings rows now carry the stream type plus the media details needed to serve both streams from one manifest: video codec, audio presence, audio codec and rate, and a record-time keyframe index.

Playback resolves coverage across both streams and merges them into a single VOD sequence, falling back to a discontinuity manifest with per-clip init segments when the media signatures differ. The player exposes a quality selector, and an auto governor picks the stream from stall time, bandwidth, codec support, and the save-data hint.

* fix tests and i18n
This commit is contained in:
Josh Hawkins
2026-08-22 11:40:42 -05:00
parent 8de6216c61
commit d67304a84d
68 changed files with 6813 additions and 602 deletions
+16 -1
View File
@@ -13,6 +13,20 @@
"desc": "No frames have been received on the {{cameraName}} <code>detect</code> stream, check error logs"
},
"cameraOff": "Camera is off",
"quality": {
"auto": "Auto",
"autoLow": "Playing low quality (limited bandwidth)",
"autoLowCodec": "Playing low quality (Original not supported by this browser)",
"autoLowSaveData": "Playing low quality (data saver)",
"main": "Original",
"sub": "Low",
"notSupportedBrowser": "Not supported by this browser",
"label": "Quality",
"noAudio": "No audio",
"audioRate": "{{rate}} kHz audio",
"audioCodecRate": "{{codec}} {{rate}} kHz",
"noRecordings": "No recordings in this time range"
},
"stats": {
"streamType": {
"title": "Stream Type:",
@@ -46,7 +60,8 @@
"submittedFrigatePlus": "Successfully submitted frame to Frigate+"
},
"error": {
"submitFrigatePlusFailed": "Failed to submit frame to Frigate+"
"submitFrigatePlusFailed": "Failed to submit frame to Frigate+",
"playRecordingsFailed": "Failed to play recordings (error {{code}}): {{message}}"
}
}
}
+52
View File
@@ -196,6 +196,10 @@
"record": {
"label": "Record output arguments",
"description": "Default output arguments for record role streams."
},
"record_sub": {
"label": "Sub stream record output arguments",
"description": "Output arguments for record_sub role streams. The record output arguments are used when this is not set."
}
},
"retry_interval": {
@@ -522,6 +526,54 @@
"description": "Preview quality level (very_low, low, medium, high, very_high)."
}
},
"sub": {
"label": "Sub stream recording",
"description": "Settings for recording a second, lower quality stream.",
"enabled": {
"label": "Enable sub stream recording",
"description": "Enable recording of a second, lower quality stream for adaptive quality playback and extended retention."
},
"continuous": {
"label": "Sub stream continuous retention",
"description": "Number of days to retain sub stream recordings regardless of tracked objects or motion.",
"days": {
"label": "Retention days",
"description": "Days to retain recordings."
}
},
"motion": {
"label": "Sub stream motion retention",
"description": "Number of days to retain sub stream recordings triggered by motion.",
"days": {
"label": "Retention days",
"description": "Days to retain recordings."
}
},
"alerts": {
"label": "Sub stream alert retention",
"description": "Retention settings for sub stream recordings of alerts.",
"days": {
"label": "Retention days",
"description": "Number of days to retain recordings of detection events."
},
"mode": {
"label": "Retention mode",
"description": "Mode for retention: all (save all segments), motion (save segments with motion), or active_objects (save segments with active objects)."
}
},
"detections": {
"label": "Sub stream detection retention",
"description": "Retention settings for sub stream recordings of detections.",
"days": {
"label": "Retention days",
"description": "Number of days to retain recordings of detection events."
},
"mode": {
"label": "Retention mode",
"description": "Mode for retention: all (save all segments), motion (save segments with motion), or active_objects (save segments with active objects)."
}
}
},
"enabled_in_config": {
"label": "Original recording state",
"description": "Indicates whether recording was enabled in the original static configuration."
+52
View File
@@ -707,6 +707,10 @@
"record": {
"label": "Record output arguments",
"description": "Default output arguments for record role streams."
},
"record_sub": {
"label": "Sub stream record output arguments",
"description": "Output arguments for record_sub role streams. The record output arguments are used when this is not set."
}
},
"retry_interval": {
@@ -1048,6 +1052,54 @@
"description": "Preview quality level (very_low, low, medium, high, very_high)."
}
},
"sub": {
"label": "Sub stream recording",
"description": "Settings for recording a second, lower quality stream.",
"enabled": {
"label": "Enable sub stream recording",
"description": "Enable recording of a second, lower quality stream for adaptive quality playback and extended retention."
},
"continuous": {
"label": "Sub stream continuous retention",
"description": "Number of days to retain sub stream recordings regardless of tracked objects or motion.",
"days": {
"label": "Retention days",
"description": "Days to retain recordings."
}
},
"motion": {
"label": "Sub stream motion retention",
"description": "Number of days to retain sub stream recordings triggered by motion.",
"days": {
"label": "Retention days",
"description": "Days to retain recordings."
}
},
"alerts": {
"label": "Sub stream alert retention",
"description": "Retention settings for sub stream recordings of alerts.",
"days": {
"label": "Retention days",
"description": "Number of days to retain recordings of detection events."
},
"mode": {
"label": "Retention mode",
"description": "Mode for retention: all (save all segments), motion (save segments with motion), or active_objects (save segments with active objects)."
}
},
"detections": {
"label": "Sub stream detection retention",
"description": "Retention settings for sub stream recordings of detections.",
"days": {
"label": "Retention days",
"description": "Number of days to retain recordings of detection events."
},
"mode": {
"label": "Retention mode",
"description": "Mode for retention: all (save all segments), motion (save segments with motion), or active_objects (save segments with active objects)."
}
}
},
"enabled_in_config": {
"label": "Original recording state",
"description": "Indicates whether recording was enabled in the original static configuration."
+1
View File
@@ -21,6 +21,7 @@
},
"zoomIn": "Zoom In",
"zoomOut": "Zoom Out",
"subOnlyQuality": "Only low quality recordings are available in this time range",
"events": {
"label": "Events",
"aria": "Select events",
+7 -1
View File
@@ -398,6 +398,7 @@
"title": "Stream Roles",
"detect": "Main feed for object detection.",
"record": "Saves segments of the video feed based on configuration settings.",
"record_sub": "Lower quality recordings for adaptive playback and extended retention (typically the camera sub stream).",
"audio": "Feed for audio based detection."
},
"featuresPopover": {
@@ -1528,6 +1529,7 @@
"manual": "Manual arguments",
"inherit": "Inherit from camera setting",
"none": "None",
"sameAsRecord": "Same as record output arguments",
"useGlobalSetting": "Inherit from global setting",
"selectPreset": "Select preset",
"manualPlaceholder": "Enter FFmpeg arguments",
@@ -1648,9 +1650,12 @@
"inputRoles": {
"summary": "{{count}} roles selected",
"empty": "No roles available",
"roleInUse": "Already assigned to another stream",
"recordSubConflict": "A stream cannot have both record and record_sub roles",
"options": {
"detect": "Detect",
"record": "Record",
"record_sub": "Record (Sub Stream)",
"audio": "Audio"
}
},
@@ -1952,7 +1957,8 @@
"modelSizeLarge": "The 'large' model is optimized for multi-line license plates. The 'small' model provides better performance over 'large' and should be used unless your region uses multi-line plate formats."
},
"record": {
"noRecordRole": "No streams have the record role defined. Recording will not function."
"noRecordRole": "No streams have the record role defined. Recording will not function.",
"noRecordSubRole": "No streams have the record_sub role defined. Sub stream recording will not function."
},
"birdseye": {
"objectTrackingDetectDisabled": "Birdseye includes tracked objects, but object detection is disabled for this camera. The camera will not appear in Birdseye."