-
-
+
+
+
+
+
diff --git a/web/src/components/settings/MotionTuner.tsx b/web/src/components/settings/MotionTuner.tsx
index aa082092f..243a82992 100644
--- a/web/src/components/settings/MotionTuner.tsx
+++ b/web/src/components/settings/MotionTuner.tsx
@@ -27,6 +27,9 @@ import { Button } from "../ui/button";
import { Switch } from "../ui/switch";
import { Toaster } from "@/components/ui/sonner";
import { toast } from "sonner";
+import { Separator } from "../ui/separator";
+import { Link } from "react-router-dom";
+import { LuExternalLink } from "react-icons/lu";
type MotionTunerProps = {
selectedCamera: string;
@@ -45,9 +48,6 @@ export default function MotionTuner({ selectedCamera }: MotionTunerProps) {
const [isLoading, setIsLoading] = useState(false);
const [confirmationDialogOpen, setConfirmationDialogOpen] = useState(false);
- // const [selectedCamera, setSelectedCamera] = useState(cameras[0]?.name);
- const [nextSelectedCamera, setNextSelectedCamera] = useState("");
-
const { send: sendMotionThreshold } = useMotionThreshold(selectedCamera);
const { send: sendMotionContourArea } = useMotionContourArea(selectedCamera);
const { send: sendImproveContrast } = useImproveContrast(selectedCamera);
@@ -58,6 +58,12 @@ export default function MotionTuner({ selectedCamera }: MotionTunerProps) {
improve_contrast: undefined,
});
+ const [origMotionSettings, setOrigMotionSettings] = useState
({
+ threshold: undefined,
+ contour_area: undefined,
+ improve_contrast: undefined,
+ });
+
const cameraConfig = useMemo(() => {
if (config && selectedCamera) {
return config.cameras[selectedCamera];
@@ -71,6 +77,11 @@ export default function MotionTuner({ selectedCamera }: MotionTunerProps) {
contour_area: cameraConfig.motion.contour_area,
improve_contrast: cameraConfig.motion.improve_contrast,
});
+ setOrigMotionSettings({
+ threshold: cameraConfig.motion.threshold,
+ contour_area: cameraConfig.motion.contour_area,
+ improve_contrast: cameraConfig.motion.improve_contrast,
+ });
}
}, [cameraConfig]);
@@ -150,15 +161,16 @@ export default function MotionTuner({ selectedCamera }: MotionTunerProps) {
selectedCamera,
]);
- const onCancel = useCallback(() => {}, []);
+ const onCancel = useCallback(() => {
+ setMotionSettings(origMotionSettings);
+ setChangedValue(false);
+ }, [origMotionSettings]);
const handleDialog = useCallback(
(save: boolean) => {
if (save) {
saveToConfig();
}
- // setSelectedCamera(nextSelectedCamera);
- setNextSelectedCamera("");
setConfirmationDialogOpen(false);
setChangedValue(false);
},
@@ -176,72 +188,117 @@ export default function MotionTuner({ selectedCamera }: MotionTunerProps) {
Motion Detection Tuner
+
+
+ Frigate uses motion detection as a first line check to see if there
+ is anything happening in the frame worth checking with object
+ detection.
+
-
-
-
{
- handleMotionConfigChange({ threshold: value[0] });
- }}
- />
-
+
+
+ Read the Motion Tuning Guide{" "}
+
+
-
- {
- handleMotionConfigChange({ contour_area: value[0] });
- }}
- />
-
+
+
+
+
+
+
+
+
+ The threshold value dictates how much of a change in a pixel's
+ luminance is required to be considered motion.{" "}
+ Default: 30
+
+
+
+
+
{
+ handleMotionConfigChange({ threshold: value[0] });
+ }}
+ />
+
+ {motionSettings.threshold}
+
+
-
+
+
+
+
+
+ The contour area value is used to decide which groups of
+ changed pixels qualify as motion. Default: 10
+
+
+
+
+
{
+ handleMotionConfigChange({ contour_area: value[0] });
+ }}
+ />
+
+ {motionSettings.contour_area}
+
+
+
+
+
+
+
+
+ Improve contrast for darker scenes. Default: ON
+
+
{
handleMotionConfigChange({ improve_contrast: isChecked });
}}
/>
-
-
-
-
Improve Contrast
-
Improve contrast for darker scenes.
-
-
-
-
+
+