From d32949017b88f62c5ee4bd88a010c763faa0f4bb Mon Sep 17 00:00:00 2001 From: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com> Date: Sat, 22 Mar 2025 07:38:33 -0500 Subject: [PATCH] Bugfixes and docs tweaks (#17307) * ensure config file is updated with booleans instead of strings * catch onvif error * ensure object type is available as a ptz tracker * update live view docs --- docs/docs/configuration/live.md | 6 ++++-- frigate/ptz/onvif.py | 6 +++++- frigate/track/norfair_tracker.py | 1 + web/src/views/settings/ClassificationSettingsView.tsx | 2 +- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/docs/docs/configuration/live.md b/docs/docs/configuration/live.md index 42809739a..494413682 100644 --- a/docs/docs/configuration/live.md +++ b/docs/docs/configuration/live.md @@ -203,9 +203,9 @@ Note that disabling a camera through the config file (`enabled: False`) removes Frigate intelligently selects the live streaming technology based on a number of factors (user-selected modes like two-way talk, camera settings, browser capabilities, available bandwidth) and prioritizes showing an actual up-to-date live view of your camera's stream as quickly as possible. - When you have go2rtc configured, Live view initially attempts to load and play back your stream with a clearer, fluent stream technology (MSE). An initial timeout, a low bandwidth condition that would cause buffering of the stream, or decoding errors in the stream will cause Frigate to switch to the stream defined by the `detect` role, using the jsmpeg format. This is what the UI labels as "low bandwidth mode". On Live dashboards, the mode will automatically reset when smart streaming is configured and activity stops. You can also try using the _Reset_ button to force a reload of your stream. + When you have go2rtc configured, Live view initially attempts to load and play back your stream with a clearer, fluent stream technology (MSE). An initial timeout, a low bandwidth condition that would cause buffering of the stream, or decoding errors in the stream will cause Frigate to switch to the stream defined by the `detect` role, using the jsmpeg format. This is what the UI labels as "low bandwidth mode". On Live dashboards, the mode will automatically reset when smart streaming is configured and activity stops. Continuous streaming mode does not have an automatic reset mechanism, but you can use the _Reset_ option to force a reload of your stream. - If you are still experiencing Frigate falling back to low bandwidth mode, you may need to adjust your camera's settings per the recommendations above or ensure you have enough bandwidth available. + If you are still experiencing Frigate falling back to low bandwidth mode, you may need to adjust your camera's settings per the (recommendations above)[#camera_settings_recommendations]. 3. **It doesn't seem like my cameras are streaming on the Live dashboard. Why?** @@ -221,6 +221,8 @@ Note that disabling a camera through the config file (`enabled: False`) removes This static image is pulled from the stream defined in your config with the `detect` role. When activity is detected, images from the `detect` stream immediately begin updating at ~5 frames per second so you can see the activity until the live player is loaded and begins playing. This usually only takes a second or two. If the live player times out, buffers, or has streaming errors, the jsmpeg player is loaded and plays a video-only stream from the `detect` role. When activity ends, the players are destroyed and a static image is displayed until activity is detected again, and the process repeats. + Smart streaming depends on having your camera's motion `threshold` and `contour_area` config values dialed in. Use the Motion Tuner in Settings in the UI to tune these values in real-time. + This is Frigate's default and recommended setting because it results in a significant bandwidth savings, especially for high resolution cameras. 6. **I have unmuted some cameras on my dashboard, but I do not hear sound. Why?** diff --git a/frigate/ptz/onvif.py b/frigate/ptz/onvif.py index dea7f5b77..eec57dbac 100644 --- a/frigate/ptz/onvif.py +++ b/frigate/ptz/onvif.py @@ -86,7 +86,11 @@ class OnvifController: async def _init_onvif(self, camera_name: str) -> bool: onvif: ONVIFCamera = self.cams[camera_name]["onvif"] - await onvif.update_xaddrs() + try: + await onvif.update_xaddrs() + except Exception as e: + logger.error(f"Onvif connection failed for {camera_name}: {e}") + return False # create init services media: ONVIFService = await onvif.create_media_service() diff --git a/frigate/track/norfair_tracker.py b/frigate/track/norfair_tracker.py index db17f9313..3487aa8c0 100644 --- a/frigate/track/norfair_tracker.py +++ b/frigate/track/norfair_tracker.py @@ -246,6 +246,7 @@ class NorfairTracker(ObjectTracker): "ptz" if self.camera_config.onvif.autotracking.enabled_in_config and object_type in self.camera_config.onvif.autotracking.track + and object_type in self.ptz_object_type_configs.keys() else "static" ) if object_type in self.trackers: diff --git a/web/src/views/settings/ClassificationSettingsView.tsx b/web/src/views/settings/ClassificationSettingsView.tsx index 3ff466f13..dac136e0c 100644 --- a/web/src/views/settings/ClassificationSettingsView.tsx +++ b/web/src/views/settings/ClassificationSettingsView.tsx @@ -136,7 +136,7 @@ export default function ClassificationSettingsView({ axios .put( - `config/set?semantic_search.enabled=${classificationSettings.search.enabled ? "True" : "False"}&semantic_search.reindex=${classificationSettings.search.reindex ? "True" : "False"}&semantic_search.model_size=${classificationSettings.search.model_size}&face_recognition.enabled=${classificationSettings.face.enabled}&lpr.enabled=${classificationSettings.lpr.enabled}`, + `config/set?semantic_search.enabled=${classificationSettings.search.enabled ? "True" : "False"}&semantic_search.reindex=${classificationSettings.search.reindex ? "True" : "False"}&semantic_search.model_size=${classificationSettings.search.model_size}&face_recognition.enabled=${classificationSettings.face.enabled ? "True" : "False"}&lpr.enabled=${classificationSettings.lpr.enabled ? "True" : "False"}`, { requires_restart: 0, },