NVR with realtime local object detection for IP cameras
TypeScript aicameragoogle-coralhome-assistanthome-automationhomeautomationmqttnvrobject-detectionrealtimertsptensorflow
Tweaks (#22965)
Josh Hawkinsad9092d0da55
diff --git a/docs/docs/troubleshooting/faqs.md b/docs/docs/troubleshooting/faqs.mdindex 6cd67ba889..e11ae63159 100644--- a/docs/docs/troubleshooting/faqs.md+++ b/docs/docs/troubleshooting/faqs.md@@ -111,26 +111,16 @@ TCP ensures that all data packets arrive in the correct order. This is crucial fYou can still configure Frigate to use UDP by using ffmpeg input args or the preset `preset-rtsp-udp`. See the [ffmpeg presets](/configuration/ffmpeg_presets) documentation.-### Frigate hangs on startup with a "probing detect stream" message in the logs+### Frigate is slow to start up with a "probing detect stream" message in the logs-On startup, Frigate probes each camera's detect stream with OpenCV to auto-detect its resolution. OpenCV's FFmpeg backend may attempt RTSP over UDP during this probe regardless of the `-rtsp_transport tcp` in your `input_args` or preset. For cameras that do not respond to UDP (common on some Reolink models and others behind firewalls that block UDP), the probe can hang indefinitely and block Frigate from finishing startup, or it can return zeroed-out dimensions that show up as width `0` and height `0` in Camera Probe Info under System Metrics.+When `detect.width` and `detect.height` are not set, Frigate probes each camera's detect stream on startup (and when saving the config) to auto-detect its resolution. For RTSP streams Frigate probes with ffprobe and automatically retries over TCP if UDP doesn't respond, with a 5 second timeout per attempt. A camera that cannot be reached over either transport will add up to ~10 seconds to startup before Frigate falls through with default dimensions, which may show up as width `0` and height `0` in Camera Probe Info under System Metrics.-There are two ways to avoid this:+To skip the probe entirely and make startup instant, set `detect.width` and `detect.height` explicitly in your camera config:-1. Set `detect.width` and `detect.height` explicitly in your camera config. When both are set, Frigate skips the auto-detect probe entirely:-- ```yaml- cameras:- my_camera:- detect:- width: 1280- height: 720- ```--2. Force OpenCV's FFmpeg backend to use TCP for RTSP by setting the environment variable on your Frigate container:-- ```- OPENCV_FFMPEG_CAPTURE_OPTIONS=rtsp_transport;tcp- ```-- This is a process-wide setting and applies to all cameras. If you have any cameras that require `preset-rtsp-udp`, use option 1 instead.+```yaml+cameras:+ my_camera:+ detect:+ width: 1280+ height: 720+```diff --git a/frigate/util/services.py b/frigate/util/services.pyindex c20ab27653..15c439d484 100644--- a/frigate/util/services.py+++ b/frigate/util/services.py@@ -877,15 +877,23 @@ async def get_video_properties(cap.release()return valid, width, height, fourcc, duration- # try cv2 first- has_video, width, height, fourcc, duration = probe_with_cv2(url)+ is_rtsp = url.startswith("rtsp://")- # fallback to ffprobe if needed- if not has_video or (get_duration and duration < 0):+ if is_rtsp:+ # skip cv2 for RTSP: its FFmpeg backend has a hardcoded ~30s internal+ # timeout that cannot be shortened per-call, and ffprobe bounded by+ # -rw_timeout handles RTSP probing reliablyhas_video, width, height, fourcc, duration = await probe_with_ffprobe(url)+ else:+ # try cv2 first for local files, HTTP, RTMP+ has_video, width, height, fourcc, duration = probe_with_cv2(url)++ # fallback to ffprobe if needed+ if not has_video or (get_duration and duration < 0):+ has_video, width, height, fourcc, duration = await probe_with_ffprobe(url)# last resort for RTSP: try TCP transport, since default UDP may be blocked- if (not has_video or (get_duration and duration < 0)) and url.startswith("rtsp://"):+ if (not has_video or (get_duration and duration < 0)) and is_rtsp:has_video, width, height, fourcc, duration = await probe_with_ffprobe(url, rtsp_transport="tcp")diff --git a/web/src/components/config-form/sectionExtras/CameraReviewClassification.tsx b/web/src/components/config-form/sectionExtras/CameraReviewClassification.tsxindex ffe9b19b2a..86f363aec7 100644--- a/web/src/components/config-form/sectionExtras/CameraReviewClassification.tsx+++ b/web/src/components/config-form/sectionExtras/CameraReviewClassification.tsx@@ -218,7 +218,7 @@ export default function CameraReviewClassification({<LabelclassName={cn("flex flex-row items-center text-base",- alertsZonesModified && "text-danger",+ alertsZonesModified && "text-unsaved",)}><Trans ns="views/settings">cameraReview.review.alerts</Trans>@@ -286,7 +286,7 @@ export default function CameraReviewClassification({<LabelclassName={cn("flex flex-row items-center text-base",- detectionsZonesModified && "text-danger",+ detectionsZonesModified && "text-unsaved",)}><Trans ns="views/settings">diff --git a/web/src/components/config-form/sections/BaseSection.tsx b/web/src/components/config-form/sections/BaseSection.tsxindex cc1448703d..897b5f262e 100644--- a/web/src/components/config-form/sections/BaseSection.tsx+++ b/web/src/components/config-form/sections/BaseSection.tsx@@ -1012,7 +1012,7 @@ export function ConfigSection({>{hasChanges && (<div className="flex items-center gap-2">- <span className="text-sm text-danger">+ <span className="text-sm text-unsaved">{t("unsavedChanges", {ns: "views/settings",defaultValue: "You have unsaved changes",@@ -1299,7 +1299,7 @@ export function ConfigSection({{hasChanges && (<Badgevariant="secondary"- className="cursor-default bg-danger text-xs text-white hover:bg-danger"+ className="cursor-default bg-unsaved text-xs text-black hover:bg-unsaved">{t("button.modified", {ns: "common",diff --git a/web/src/components/config-form/theme/fields/KnownPlatesField.tsx b/web/src/components/config-form/theme/fields/KnownPlatesField.tsxindex f710dcd11d..e47c298674 100644--- a/web/src/components/config-form/theme/fields/KnownPlatesField.tsx+++ b/web/src/components/config-form/theme/fields/KnownPlatesField.tsx@@ -154,7 +154,7 @@ export function KnownPlatesField(props: FieldProps) {<div className="flex items-center justify-between"><div><CardTitle- className={cn("text-sm", isModified && "text-danger")}+ className={cn("text-sm", isModified && "text-unsaved")}>{title}</CardTitle>diff --git a/web/src/components/config-form/theme/fields/ReplaceRulesField.tsx b/web/src/components/config-form/theme/fields/ReplaceRulesField.tsxindex 6724854c9e..08c5c781fb 100644--- a/web/src/components/config-form/theme/fields/ReplaceRulesField.tsx+++ b/web/src/components/config-form/theme/fields/ReplaceRulesField.tsx@@ -142,7 +142,7 @@ export function ReplaceRulesField(props: FieldProps) {<div className="flex items-center justify-between"><div><CardTitle- className={cn("text-sm", isModified && "text-danger")}+ className={cn("text-sm", isModified && "text-unsaved")}>{title}</CardTitle>diff --git a/web/src/components/config-form/theme/templates/FieldTemplate.tsx b/web/src/components/config-form/theme/templates/FieldTemplate.tsxindex f65348d88e..1c5e801dc3 100644--- a/web/src/components/config-form/theme/templates/FieldTemplate.tsx+++ b/web/src/components/config-form/theme/templates/FieldTemplate.tsx@@ -497,7 +497,7 @@ export function FieldTemplate(props: FieldTemplateProps) {htmlFor={id}className={cn("text-sm font-medium",- isModified && "text-danger",+ isModified && "text-unsaved",hasFieldErrors && "text-destructive",)}>@@ -516,7 +516,7 @@ export function FieldTemplate(props: FieldTemplateProps) {return (<LabelhtmlFor={id}- className={cn("text-sm font-medium", isModified && "text-danger")}+ className={cn("text-sm font-medium", isModified && "text-unsaved")}>{finalLabel}{required && <span className="ml-1 text-destructive">*</span>}@@ -535,7 +535,7 @@ export function FieldTemplate(props: FieldTemplateProps) {htmlFor={id}className={cn("text-sm font-medium",- isModified && "text-danger",+ isModified && "text-unsaved",hasFieldErrors && "text-destructive",)}>diff --git a/web/src/components/config-form/theme/templates/ObjectFieldTemplate.tsx b/web/src/components/config-form/theme/templates/ObjectFieldTemplate.tsxindex 4b588d62b1..f1d8ae14a0 100644--- a/web/src/components/config-form/theme/templates/ObjectFieldTemplate.tsx+++ b/web/src/components/config-form/theme/templates/ObjectFieldTemplate.tsx@@ -467,7 +467,7 @@ export function ObjectFieldTemplate(props: ObjectFieldTemplateProps) {<CardTitleclassName={cn("flex items-center text-sm",- hasModifiedDescendants && "text-danger",+ hasModifiedDescendants && "text-unsaved",)}>{inferredLabel}diff --git a/web/src/pages/Settings.tsx b/web/src/pages/Settings.tsxindex 3c6e4d83fe..fd19da4f97 100644--- a/web/src/pages/Settings.tsx+++ b/web/src/pages/Settings.tsx@@ -1435,7 +1435,7 @@ export default function Settings() {/>)}{showUnsavedDot && (- <span className="inline-block size-2 rounded-full bg-danger" />+ <span className="inline-block size-2 rounded-full bg-unsaved" />)}</div>)}@@ -1516,7 +1516,7 @@ export default function Settings() {<div className="sticky bottom-0 z-50 mt-2 bg-background p-4"><div className="flex flex-col items-center gap-2"><div className="flex items-center gap-2">- <span className="text-sm text-danger">+ <span className="text-sm text-unsaved">{t("unsavedChanges", {ns: "views/settings",defaultValue: "You have unsaved changes",diff --git a/web/src/utils/profileColors.ts b/web/src/utils/profileColors.tsindex 5c2bc552f0..ace86cba40 100644--- a/web/src/utils/profileColors.ts+++ b/web/src/utils/profileColors.ts@@ -79,11 +79,11 @@ const PROFILE_COLORS: ProfileColor[] = [bgMuted: "bg-green-400/20",},{- bg: "bg-amber-400",- text: "text-amber-400",- dot: "bg-amber-400",- border: "border-amber-400",- bgMuted: "bg-amber-400/20",+ bg: "bg-fuchsia-500",+ text: "text-fuchsia-500",+ dot: "bg-fuchsia-500",+ border: "border-fuchsia-500",+ bgMuted: "bg-fuchsia-500/20",},{bg: "bg-slate-400",@@ -93,11 +93,11 @@ const PROFILE_COLORS: ProfileColor[] = [bgMuted: "bg-slate-400/20",},{- bg: "bg-orange-300",- text: "text-orange-300",- dot: "bg-orange-300",- border: "border-orange-300",- bgMuted: "bg-orange-300/20",+ bg: "bg-stone-500",+ text: "text-stone-500",+ dot: "bg-stone-500",+ border: "border-stone-500",+ bgMuted: "bg-stone-500/20",},{bg: "bg-blue-300",diff --git a/web/src/views/settings/Go2RtcStreamsSettingsView.tsx b/web/src/views/settings/Go2RtcStreamsSettingsView.tsxindex dc6f1533c9..fbc55a24b5 100644--- a/web/src/views/settings/Go2RtcStreamsSettingsView.tsx+++ b/web/src/views/settings/Go2RtcStreamsSettingsView.tsx@@ -380,7 +380,9 @@ export default function Go2RtcStreamsSettingsView({>{hasChanges && (<div className="flex items-center gap-2">- <span className="text-sm text-danger">{t("unsavedChanges")}</span>+ <span className="text-sm text-unsaved">+ {t("unsavedChanges")}+ </span></div>)}<div className="flex w-full items-center gap-2 md:w-auto">diff --git a/web/src/views/settings/SingleSectionPage.tsx b/web/src/views/settings/SingleSectionPage.tsxindex 1c0316db47..c054ba7f18 100644--- a/web/src/views/settings/SingleSectionPage.tsx+++ b/web/src/views/settings/SingleSectionPage.tsx@@ -212,7 +212,7 @@ export function SingleSectionPage({{sectionStatus.hasChanges && (<Badgevariant="secondary"- className="cursor-default bg-danger text-xs text-white hover:bg-danger"+ className="cursor-default bg-unsaved text-xs text-black hover:bg-unsaved">{t("button.modified", {ns: "common",@@ -250,7 +250,7 @@ export function SingleSectionPage({{sectionStatus.hasChanges && (<Badgevariant="secondary"- className="cursor-default bg-danger text-xs text-white hover:bg-danger"+ className="cursor-default bg-unsaved text-xs text-black hover:bg-unsaved">{t("button.modified", { ns: "common", defaultValue: "Modified" })}</Badge>diff --git a/web/tailwind.config.cjs b/web/tailwind.config.cjsindex 435b6cb1a9..83a61a248c 100644--- a/web/tailwind.config.cjs+++ b/web/tailwind.config.cjs@@ -65,6 +65,7 @@ module.exports = {ring: "hsl(var(--ring))",danger: "#ef4444",success: "#22c55e",+ unsaved: "#f59e0b",background: "hsl(var(--background))",background_alt: "hsl(var(--background-alt))",foreground: "hsl(var(--foreground))",