mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-11-30 01:07:07 +03:00
track where each camera's detect resolution came from
The health tab's stream check told users to set the detect resolution whenever a probe returned no size, even when they had already set it, and a camera running on the 1280x720 fallback after a failed startup probe was never flagged unless the stream check was run by hand. The config now records whether the resolution came from the config, a startup probe, or the fallback, and /api/config exposes it per camera. The stream check skips the probe warning when the resolution is set, a camera on the fallback gets a detect settings warning that also shows on the health tab, and cloning detect from a fallback camera no longer copies the fallback size.
This commit is contained in:
@@ -18,6 +18,17 @@ const detect: SectionConfigOverrides = {
|
||||
condition: (ctx) =>
|
||||
ctx.level === "camera" && ctx.formData?.enabled === false,
|
||||
},
|
||||
{
|
||||
key: "detect-resolution-not-probed",
|
||||
health: true,
|
||||
messageKey: "configMessages.detect.resolutionNotProbed",
|
||||
severity: "warning",
|
||||
// profiles hide width and height
|
||||
condition: (ctx) =>
|
||||
ctx.level === "camera" &&
|
||||
!ctx.profileName &&
|
||||
ctx.fullCameraConfig?.detect_resolution_source === "default",
|
||||
},
|
||||
],
|
||||
fieldMessages: [
|
||||
{
|
||||
|
||||
@@ -36,6 +36,8 @@ export interface FaceRecognitionConfig {
|
||||
export type SearchModel = "jinav1" | "jinav2" | (string & NonNullable<unknown>);
|
||||
export type SearchModelSize = "small" | "large";
|
||||
|
||||
export type DetectResolutionSource = "config" | "probed" | "default";
|
||||
|
||||
export type LiveTranscodeQuality = {
|
||||
height: number;
|
||||
bitrate: number;
|
||||
@@ -116,6 +118,7 @@ export interface CameraConfig {
|
||||
cmd: string;
|
||||
roles: string[];
|
||||
}[];
|
||||
detect_resolution_source?: DetectResolutionSource;
|
||||
live: {
|
||||
height: number;
|
||||
quality: number;
|
||||
|
||||
@@ -672,9 +672,14 @@ export function buildClonedCameraPayloads({
|
||||
formData: sourceSectionValue as ConfigSectionData,
|
||||
},
|
||||
);
|
||||
// a fallback detect size would become an explicit value on the target
|
||||
const fallbackDetect =
|
||||
section === "detect" && sourceCfg.detect_resolution_source === "default"
|
||||
? ["width", "height"]
|
||||
: [];
|
||||
let pendingSectionValue: unknown = sanitizeSectionData(
|
||||
cloneDeep(sourceSectionValue) as ConfigSectionData,
|
||||
resolvedHiddenFields,
|
||||
[...resolvedHiddenFields, ...fallbackDetect],
|
||||
);
|
||||
|
||||
if (FILTER_SECTION_DEFS[section]) {
|
||||
|
||||
@@ -58,6 +58,10 @@ export function streamHealth(
|
||||
checked += 1;
|
||||
const link = `/settings?page=cameraFfmpeg&camera=${encodeURIComponent(name)}`;
|
||||
const copiesAudio = recordCopiesAudio(camera);
|
||||
// a set resolution needs no probe, and a failed startup probe has its own row
|
||||
const resolutionCovered =
|
||||
camera.detect_resolution_source === "config" ||
|
||||
camera.detect_resolution_source === "default";
|
||||
let flagged = false;
|
||||
|
||||
if (check.error) {
|
||||
@@ -125,7 +129,8 @@ export function streamHealth(
|
||||
(issue): issue is StreamIssue & { type: "warning" | "error" } =>
|
||||
issue.type !== "good" &&
|
||||
!WIZARD_ONLY_RULES.has(issue.rule) &&
|
||||
(issue.rule !== "audio-codec-record" || copiesAudio),
|
||||
(issue.rule !== "audio-codec-record" || copiesAudio) &&
|
||||
(issue.rule !== "resolution-unknown" || !resolutionCovered),
|
||||
)
|
||||
.forEach((issue) => {
|
||||
flagged = true;
|
||||
|
||||
Reference in New Issue
Block a user