NVR with realtime local object detection for IP cameras
TypeScript aicameragoogle-coralhome-assistanthome-automationhomeautomationmqttnvrobject-detectionrealtimertsptensorflow
Miscellaneous fixes (#20875)
Nicolas Mowenf1a05d0f9baa
diff --git a/frigate/detectors/detection_runners.py b/frigate/detectors/detection_runners.pyindex 80d4e04871..eb3a0ecb95 100644--- a/frigate/detectors/detection_runners.py+++ b/frigate/detectors/detection_runners.py@@ -255,6 +255,7 @@ class OpenVINOModelRunner(BaseModelRunner):def __init__(self, model_path: str, device: str, model_type: str, **kwargs):self.model_path = model_pathself.device = device+ self.model_type = model_typeif device == "NPU" and not OpenVINOModelRunner.is_model_npu_supported(model_type@@ -341,6 +342,13 @@ class OpenVINOModelRunner(BaseModelRunner):# Lock prevents concurrent access to infer_request# Needed for JinaV2: genai thread (text) + embeddings thread (vision)with self._inference_lock:+ from frigate.embeddings.types import EnrichmentModelTypeEnum++ if self.model_type in [EnrichmentModelTypeEnum.arcface.value]:+ # For face recognition models, create a fresh infer_request+ # for each inference to avoid state pollution that causes incorrect results.+ self.infer_request = self.compiled_model.create_infer_request()+# Handle single input case for backward compatibilityif (len(inputs) == 1diff --git a/web/public/locales/en/views/settings.json b/web/public/locales/en/views/settings.jsonindex 6a44b11169..b08aa10c09 100644--- a/web/public/locales/en/views/settings.json+++ b/web/public/locales/en/views/settings.json@@ -8,7 +8,7 @@"masksAndZones": "Mask and Zone Editor - Frigate","motionTuner": "Motion Tuner - Frigate","object": "Debug - Frigate",- "general": "General Settings - Frigate",+ "general": "UI Settings - Frigate","frigatePlus": "Frigate+ Settings - Frigate","notifications": "Notification Settings - Frigate"},@@ -37,7 +37,7 @@"noCamera": "No Camera"},"general": {- "title": "General Settings",+ "title": "UI Settings","liveDashboard": {"title": "Live Dashboard","automaticLiveView": {@@ -51,6 +51,10 @@"displayCameraNames": {"label": "Always Show Camera Names","desc": "Always show the camera names in a chip in the multi-camera live view dashboard."+ },+ "liveFallbackTimeout": {+ "label": "Live Player Fallback Timeout",+ "desc": "When a camera's high quality live stream is unavailable, fall back to low bandwidth mode after this many seconds. Default: 3."}},"storedLayouts": {diff --git a/web/src/components/overlay/detail/TrackingDetails.tsx b/web/src/components/overlay/detail/TrackingDetails.tsxindex 279b85e4ca..33ddd0f009 100644--- a/web/src/components/overlay/detail/TrackingDetails.tsx+++ b/web/src/components/overlay/detail/TrackingDetails.tsx@@ -343,6 +343,10 @@ export function TrackingDetails({// eslint-disable-next-line react-hooks/exhaustive-deps}, [displayedRecordTime]);+ const onUploadFrameToPlus = useCallback(() => {+ return axios.post(`/${event.camera}/plus/${currentTime}`);+ }, [event.camera, currentTime]);+if (!config) {return <ActivityIndicator />;}@@ -388,6 +392,7 @@ export function TrackingDetails({frigateControls={true}onTimeUpdate={handleTimeUpdate}onSeekToTime={handleSeekToTime}+ onUploadFrame={onUploadFrameToPlus}isDetailMode={true}camera={event.camera}currentTimeOverride={currentTime}diff --git a/web/src/components/player/MsePlayer.tsx b/web/src/components/player/MsePlayer.tsxindex c4a30c7e64..4d2b8b3650 100644--- a/web/src/components/player/MsePlayer.tsx+++ b/web/src/components/player/MsePlayer.tsx@@ -1,4 +1,5 @@import { baseUrl } from "@/api/baseUrl";+import { usePersistence } from "@/hooks/use-persistence";import {LivePlayerError,PlayerStatsType,@@ -71,6 +72,8 @@ function MSEPlayer({const [errorCount, setErrorCount] = useState<number>(0);const totalBytesLoaded = useRef(0);+ const [fallbackTimeout] = usePersistence<number>("liveFallbackTimeout", 3);+const videoRef = useRef<HTMLVideoElement>(null);const wsRef = useRef<WebSocket | null>(null);const reconnectTIDRef = useRef<number | null>(null);@@ -475,7 +478,10 @@ function MSEPlayer({setBufferTimeout(undefined);}- const timeoutDuration = bufferTime == 0 ? 5000 : 3000;+ const timeoutDuration =+ bufferTime == 0+ ? (fallbackTimeout ?? 3) * 2 * 1000+ : (fallbackTimeout ?? 3) * 1000;setBufferTimeout(setTimeout(() => {if (@@ -500,6 +506,7 @@ function MSEPlayer({onError,onPlaying,playbackEnabled,+ fallbackTimeout,]);useEffect(() => {diff --git a/web/src/hooks/use-camera-live-mode.ts b/web/src/hooks/use-camera-live-mode.tsindex 17dfaee91b..2bdb1f866b 100644--- a/web/src/hooks/use-camera-live-mode.ts+++ b/web/src/hooks/use-camera-live-mode.ts@@ -6,6 +6,7 @@ import { LivePlayerMode, LiveStreamMetadata } from "@/types/live";export default function useCameraLiveMode(cameras: CameraConfig[],windowVisible: boolean,+ activeStreams?: { [cameraName: string]: string },) {const { data: config } = useSWR<FrigateConfig>("config");@@ -20,16 +21,20 @@ export default function useCameraLiveMode();if (isRestreamed) {- Object.values(camera.live.streams).forEach((streamName) => {- streamNames.add(streamName);- });+ if (activeStreams && activeStreams[camera.name]) {+ streamNames.add(activeStreams[camera.name]);+ } else {+ Object.values(camera.live.streams).forEach((streamName) => {+ streamNames.add(streamName);+ });+ }}});return streamNames.size > 0? Array.from(streamNames).sort().join(","): null;- }, [cameras, config]);+ }, [cameras, config, activeStreams]);const streamsFetcher = useCallback(async (key: string) => {const streamNames = key.split(",");@@ -68,7 +73,9 @@ export default function useCameraLiveMode([key: string]: LiveStreamMetadata;}>(restreamedStreamsKey, streamsFetcher, {revalidateOnFocus: false,- dedupingInterval: 10000,+ revalidateOnReconnect: false,+ revalidateIfStale: false,+ dedupingInterval: 60000,});const [preferredLiveModes, setPreferredLiveModes] = useState<{diff --git a/web/src/views/live/DraggableGridLayout.tsx b/web/src/views/live/DraggableGridLayout.tsxindex 5239fe3881..259e4093f4 100644--- a/web/src/views/live/DraggableGridLayout.tsx+++ b/web/src/views/live/DraggableGridLayout.tsx@@ -86,14 +86,6 @@ export default function DraggableGridLayout({// preferred live modes per camera- const {- preferredLiveModes,- setPreferredLiveModes,- resetPreferredLiveMode,- isRestreamedStates,- supportsAudioOutputStates,- } = useCameraLiveMode(cameras, windowVisible);-const [globalAutoLive] = usePersistence("autoLiveView", true);const [displayCameraNames] = usePersistence("displayCameraNames", false);@@ -106,6 +98,33 @@ export default function DraggableGridLayout({}}, [allGroupsStreamingSettings, cameraGroup]);+ const activeStreams = useMemo(() => {+ const streams: { [cameraName: string]: string } = {};+ cameras.forEach((camera) => {+ const availableStreams = camera.live.streams || {};+ const streamNameFromSettings =+ currentGroupStreamingSettings?.[camera.name]?.streamName || "";+ const streamExists =+ streamNameFromSettings &&+ Object.values(availableStreams).includes(streamNameFromSettings);++ const streamName = streamExists+ ? streamNameFromSettings+ : Object.values(availableStreams)[0] || "";++ streams[camera.name] = streamName;+ });+ return streams;+ }, [cameras, currentGroupStreamingSettings]);++ const {+ preferredLiveModes,+ setPreferredLiveModes,+ resetPreferredLiveMode,+ isRestreamedStates,+ supportsAudioOutputStates,+ } = useCameraLiveMode(cameras, windowVisible, activeStreams);+// grid layoutconst ResponsiveGridLayout = useMemo(() => WidthProvider(Responsive), []);diff --git a/web/src/views/live/LiveCameraView.tsx b/web/src/views/live/LiveCameraView.tsxindex 2d61d40f56..9e639ab7bc 100644--- a/web/src/views/live/LiveCameraView.tsx+++ b/web/src/views/live/LiveCameraView.tsx@@ -162,6 +162,9 @@ export default function LiveCameraView({isRestreamed ? `go2rtc/streams/${streamName}` : null,{revalidateOnFocus: false,+ revalidateOnReconnect: false,+ revalidateIfStale: false,+ dedupingInterval: 60000,},);@@ -1027,294 +1030,298 @@ function FrigateCameraFeatures({disabled={!cameraEnabled || debug || isSnapshotLoading}loading={isSnapshotLoading}/>- <DropdownMenu modal={false}>- <DropdownMenuTrigger>- <div- className={cn(- "flex flex-col items-center justify-center rounded-lg bg-secondary p-2 text-secondary-foreground md:p-0",- )}- >- <FaCog- className={`text-secondary-foreground" size-5 md:m-[6px]`}- />- </div>- </DropdownMenuTrigger>- <DropdownMenuContent className="max-w-96">- <div className="flex flex-col gap-5 p-4">- {!isRestreamed && (- <div className="flex flex-col gap-2">- <Label>- {t("streaming.label", { ns: "components/dialog" })}- </Label>- <div className="flex flex-row items-center gap-1 text-sm text-muted-foreground">- <LuX className="size-4 text-danger" />- <div>- {t("streaming.restreaming.disabled", {- ns: "components/dialog",- })}- </div>- <Popover>- <PopoverTrigger asChild>- <div className="cursor-pointer p-0">- <LuInfo className="size-4" />- <span className="sr-only">- {t("button.info", { ns: "common" })}- </span>- </div>- </PopoverTrigger>- <PopoverContent className="w-80 text-xs">- {t("streaming.restreaming.desc.title", {+ {!fullscreen && (+ <DropdownMenu modal={false}>+ <DropdownMenuTrigger>+ <div+ className={cn(+ "flex flex-col items-center justify-center rounded-lg bg-secondary p-2 text-secondary-foreground md:p-0",+ )}+ >+ <FaCog+ className={`text-secondary-foreground" size-5 md:m-[6px]`}+ />+ </div>+ </DropdownMenuTrigger>+ <DropdownMenuContent className="max-w-96">+ <div className="flex flex-col gap-5 p-4">+ {!isRestreamed && (+ <div className="flex flex-col gap-2">+ <Label>+ {t("streaming.label", { ns: "components/dialog" })}+ </Label>+ <div className="flex flex-row items-center gap-1 text-sm text-muted-foreground">+ <LuX className="size-4 text-danger" />+ <div>+ {t("streaming.restreaming.disabled", {ns: "components/dialog",})}- <div className="mt-2 flex items-center text-primary">- <Link- to={getLocaleDocUrl("configuration/live")}- target="_blank"- rel="noopener noreferrer"- className="inline"- >- {t("readTheDocumentation", { ns: "common" })}- <LuExternalLink className="ml-2 inline-flex size-3" />- </Link>- </div>- </PopoverContent>- </Popover>- </div>- </div>- )}- {isRestreamed &&- Object.values(camera.live.streams).length > 0 && (- <div className="flex flex-col gap-1">- <Label htmlFor="streaming-method">- {t("stream.title")}- </Label>- <Select- value={streamName}- disabled={debug}- onValueChange={(value) => {- setStreamName?.(value);- }}- >- <SelectTrigger className="w-full">- <SelectValue>- {Object.keys(camera.live.streams).find(- (key) => camera.live.streams[key] === streamName,- )}- </SelectValue>- </SelectTrigger>-- <SelectContent>- <SelectGroup>- {Object.entries(camera.live.streams).map(- ([stream, name]) => (- <SelectItem- key={stream}- className="cursor-pointer"- value={name}- >- {stream}- </SelectItem>- ),- )}- </SelectGroup>- </SelectContent>- </Select>-- {debug && (- <div className="flex flex-row items-center gap-1 text-sm text-muted-foreground">- <>- <LuX className="size-8 text-danger" />- <div>{t("stream.debug.picker")}</div>- </></div>- )}-- {preferredLiveMode != "jsmpeg" &&- !debug &&- isRestreamed && (- <div className="flex flex-row items-center gap-1 text-sm text-muted-foreground">- {supportsAudioOutput ? (- <>- <LuCheck className="size-4 text-success" />- <div>{t("stream.audio.available")}</div>- </>- ) : (- <>- <LuX className="size-4 text-danger" />- <div>{t("stream.audio.unavailable")}</div>- <Popover>- <PopoverTrigger asChild>- <div className="cursor-pointer p-0">- <LuInfo className="size-4" />- <span className="sr-only">- {t("button.info", { ns: "common" })}- </span>- </div>- </PopoverTrigger>- <PopoverContent className="w-80 text-xs">- {t("stream.audio.tips.title")}- <div className="mt-2 flex items-center text-primary">- <Link- to={getLocaleDocUrl("configuration/live")}- target="_blank"- rel="noopener noreferrer"- className="inline"- >- {t("readTheDocumentation", {- ns: "common",- })}- <LuExternalLink className="ml-2 inline-flex size-3" />- </Link>- </div>- </PopoverContent>- </Popover>- </>- )}- </div>- )}- {preferredLiveMode != "jsmpeg" &&- !debug &&- isRestreamed &&- supportsAudioOutput && (+ <Popover>+ <PopoverTrigger asChild>+ <div className="cursor-pointer p-0">+ <LuInfo className="size-4" />+ <span className="sr-only">+ {t("button.info", { ns: "common" })}+ </span>+ </div>+ </PopoverTrigger>+ <PopoverContent className="w-80 text-xs">+ {t("streaming.restreaming.desc.title", {+ ns: "components/dialog",+ })}+ <div className="mt-2 flex items-center text-primary">+ <Link+ to={getLocaleDocUrl("configuration/live")}+ target="_blank"+ rel="noopener noreferrer"+ className="inline"+ >+ {t("readTheDocumentation", { ns: "common" })}+ <LuExternalLink className="ml-2 inline-flex size-3" />+ </Link>+ </div>+ </PopoverContent>+ </Popover>+ </div>+ </div>+ )}+ {isRestreamed &&+ Object.values(camera.live.streams).length > 0 && (+ <div className="flex flex-col gap-1">+ <Label htmlFor="streaming-method">+ {t("stream.title")}+ </Label>+ <Select+ value={streamName}+ disabled={debug}+ onValueChange={(value) => {+ setStreamName?.(value);+ }}+ >+ <SelectTrigger className="w-full">+ <SelectValue>+ {Object.keys(camera.live.streams).find(+ (key) => camera.live.streams[key] === streamName,+ )}+ </SelectValue>+ </SelectTrigger>++ <SelectContent>+ <SelectGroup>+ {Object.entries(camera.live.streams).map(+ ([stream, name]) => (+ <SelectItem+ key={stream}+ className="cursor-pointer"+ value={name}+ >+ {stream}+ </SelectItem>+ ),+ )}+ </SelectGroup>+ </SelectContent>+ </Select>++ {debug && (<div className="flex flex-row items-center gap-1 text-sm text-muted-foreground">- {supports2WayTalk ? (- <>- <LuCheck className="size-4 text-success" />- <div>{t("stream.twoWayTalk.available")}</div>- </>- ) : (- <>- <LuX className="size-4 text-danger" />- <div>{t("stream.twoWayTalk.unavailable")}</div>- <Popover>- <PopoverTrigger asChild>- <div className="cursor-pointer p-0">- <LuInfo className="size-4" />- <span className="sr-only">- {t("button.info", { ns: "common" })}- </span>- </div>- </PopoverTrigger>- <PopoverContent className="w-80 text-xs">- {t("stream.twoWayTalk.tips")}- <div className="mt-2 flex items-center text-primary">- <Link- to={getLocaleDocUrl(- "configuration/live/#webrtc-extra-configuration",- )}- target="_blank"- rel="noopener noreferrer"- className="inline"- >- {t("readTheDocumentation", {- ns: "common",- })}- <LuExternalLink className="ml-2 inline-flex size-3" />- </Link>- </div>- </PopoverContent>- </Popover>- </>- )}+ <>+ <LuX className="size-8 text-danger" />+ <div>{t("stream.debug.picker")}</div>+ </></div>)}- {preferredLiveMode == "jsmpeg" &&- !debug &&- isRestreamed && (- <div className="flex flex-col items-center gap-3">- <div className="flex flex-row items-center gap-2">- <IoIosWarning className="mr-1 size-8 text-danger" />-- <p className="text-sm">- {t("stream.lowBandwidth.tips")}- </p>+ {preferredLiveMode != "jsmpeg" &&+ !debug &&+ isRestreamed && (+ <div className="flex flex-row items-center gap-1 text-sm text-muted-foreground">+ {supportsAudioOutput ? (+ <>+ <LuCheck className="size-4 text-success" />+ <div>{t("stream.audio.available")}</div>+ </>+ ) : (+ <>+ <LuX className="size-4 text-danger" />+ <div>{t("stream.audio.unavailable")}</div>+ <Popover>+ <PopoverTrigger asChild>+ <div className="cursor-pointer p-0">+ <LuInfo className="size-4" />+ <span className="sr-only">+ {t("button.info", { ns: "common" })}+ </span>+ </div>+ </PopoverTrigger>+ <PopoverContent className="w-80 text-xs">+ {t("stream.audio.tips.title")}+ <div className="mt-2 flex items-center text-primary">+ <Link+ to={getLocaleDocUrl(+ "configuration/live",+ )}+ target="_blank"+ rel="noopener noreferrer"+ className="inline"+ >+ {t("readTheDocumentation", {+ ns: "common",+ })}+ <LuExternalLink className="ml-2 inline-flex size-3" />+ </Link>+ </div>+ </PopoverContent>+ </Popover>+ </>+ )}</div>- <Button- className={`flex items-center gap-2.5 rounded-lg`}- aria-label={t("stream.lowBandwidth.resetStream")}- variant="outline"- size="sm"- onClick={() => setLowBandwidth(false)}- >- <MdOutlineRestartAlt className="size-5 text-primary-variant" />- <div className="text-primary-variant">- {t("stream.lowBandwidth.resetStream")}+ )}+ {preferredLiveMode != "jsmpeg" &&+ !debug &&+ isRestreamed &&+ supportsAudioOutput && (+ <div className="flex flex-row items-center gap-1 text-sm text-muted-foreground">+ {supports2WayTalk ? (+ <>+ <LuCheck className="size-4 text-success" />+ <div>{t("stream.twoWayTalk.available")}</div>+ </>+ ) : (+ <>+ <LuX className="size-4 text-danger" />+ <div>{t("stream.twoWayTalk.unavailable")}</div>+ <Popover>+ <PopoverTrigger asChild>+ <div className="cursor-pointer p-0">+ <LuInfo className="size-4" />+ <span className="sr-only">+ {t("button.info", { ns: "common" })}+ </span>+ </div>+ </PopoverTrigger>+ <PopoverContent className="w-80 text-xs">+ {t("stream.twoWayTalk.tips")}+ <div className="mt-2 flex items-center text-primary">+ <Link+ to={getLocaleDocUrl(+ "configuration/live/#webrtc-extra-configuration",+ )}+ target="_blank"+ rel="noopener noreferrer"+ className="inline"+ >+ {t("readTheDocumentation", {+ ns: "common",+ })}+ <LuExternalLink className="ml-2 inline-flex size-3" />+ </Link>+ </div>+ </PopoverContent>+ </Popover>+ </>+ )}+ </div>+ )}++ {preferredLiveMode == "jsmpeg" &&+ !debug &&+ isRestreamed && (+ <div className="flex flex-col items-center gap-3">+ <div className="flex flex-row items-center gap-2">+ <IoIosWarning className="mr-1 size-8 text-danger" />++ <p className="text-sm">+ {t("stream.lowBandwidth.tips")}+ </p></div>- </Button>- </div>- )}+ <Button+ className={`flex items-center gap-2.5 rounded-lg`}+ aria-label={t("stream.lowBandwidth.resetStream")}+ variant="outline"+ size="sm"+ onClick={() => setLowBandwidth(false)}+ >+ <MdOutlineRestartAlt className="size-5 text-primary-variant" />+ <div className="text-primary-variant">+ {t("stream.lowBandwidth.resetStream")}+ </div>+ </Button>+ </div>+ )}+ </div>+ )}+ {isRestreamed && (+ <div className="flex flex-col gap-1">+ <div className="flex items-center justify-between">+ <Label+ className="mx-0 cursor-pointer text-primary"+ htmlFor="backgroundplay"+ >+ {t("stream.playInBackground.label")}+ </Label>+ <Switch+ className="ml-1"+ id="backgroundplay"+ disabled={debug}+ checked={playInBackground}+ onCheckedChange={(checked) =>+ setPlayInBackground(checked)+ }+ />+ </div>+ <p className="text-sm text-muted-foreground">+ {t("stream.playInBackground.tips")}+ </p></div>)}- {isRestreamed && (<div className="flex flex-col gap-1"><div className="flex items-center justify-between"><LabelclassName="mx-0 cursor-pointer text-primary"- htmlFor="backgroundplay"+ htmlFor="showstats">- {t("stream.playInBackground.label")}+ {t("streaming.showStats.label", {+ ns: "components/dialog",+ })}</Label><SwitchclassName="ml-1"- id="backgroundplay"+ id="showstats"disabled={debug}- checked={playInBackground}- onCheckedChange={(checked) =>- setPlayInBackground(checked)- }+ checked={showStats}+ onCheckedChange={(checked) => setShowStats(checked)}/></div><p className="text-sm text-muted-foreground">- {t("stream.playInBackground.tips")}- </p>- </div>- )}- <div className="flex flex-col gap-1">- <div className="flex items-center justify-between">- <Label- className="mx-0 cursor-pointer text-primary"- htmlFor="showstats"- >- {t("streaming.showStats.label", {+ {t("streaming.showStats.desc", {ns: "components/dialog",})}- </Label>- <Switch- className="ml-1"- id="showstats"- disabled={debug}- checked={showStats}- onCheckedChange={(checked) => setShowStats(checked)}- />+ </p></div>- <p className="text-sm text-muted-foreground">- {t("streaming.showStats.desc", {- ns: "components/dialog",- })}- </p>- </div>- <div className="flex flex-col gap-1">- <div className="flex items-center justify-between">- <Label- className="mx-0 cursor-pointer text-primary"- htmlFor="debug"- >- {t("streaming.debugView", {- ns: "components/dialog",- })}- </Label>- <Switch- className="ml-1"- id="debug"- checked={debug}- onCheckedChange={(checked) => setDebug(checked)}- />+ <div className="flex flex-col gap-1">+ <div className="flex items-center justify-between">+ <Label+ className="mx-0 cursor-pointer text-primary"+ htmlFor="debug"+ >+ {t("streaming.debugView", {+ ns: "components/dialog",+ })}+ </Label>+ <Switch+ className="ml-1"+ id="debug"+ checked={debug}+ onCheckedChange={(checked) => setDebug(checked)}+ />+ </div></div></div>- </div>- </DropdownMenuContent>- </DropdownMenu>+ </DropdownMenuContent>+ </DropdownMenu>+ )}</>);}diff --git a/web/src/views/live/LiveDashboardView.tsx b/web/src/views/live/LiveDashboardView.tsxindex 8b7dd13360..c4104576cd 100644--- a/web/src/views/live/LiveDashboardView.tsx+++ b/web/src/views/live/LiveDashboardView.tsx@@ -202,14 +202,6 @@ export default function LiveDashboardView({};}, []);- const {- preferredLiveModes,- setPreferredLiveModes,- resetPreferredLiveMode,- isRestreamedStates,- supportsAudioOutputStates,- } = useCameraLiveMode(cameras, windowVisible);-const [globalAutoLive] = usePersistence("autoLiveView", true);const [displayCameraNames] = usePersistence("displayCameraNames", false);@@ -239,6 +231,33 @@ export default function LiveDashboardView({[visibleCameraObserver.current],);+ const activeStreams = useMemo(() => {+ const streams: { [cameraName: string]: string } = {};+ cameras.forEach((camera) => {+ const availableStreams = camera.live.streams || {};+ const streamNameFromSettings =+ currentGroupStreamingSettings?.[camera.name]?.streamName || "";+ const streamExists =+ streamNameFromSettings &&+ Object.values(availableStreams).includes(streamNameFromSettings);++ const streamName = streamExists+ ? streamNameFromSettings+ : Object.values(availableStreams)[0] || "";++ streams[camera.name] = streamName;+ });+ return streams;+ }, [cameras, currentGroupStreamingSettings]);++ const {+ preferredLiveModes,+ setPreferredLiveModes,+ resetPreferredLiveMode,+ isRestreamedStates,+ supportsAudioOutputStates,+ } = useCameraLiveMode(cameras, windowVisible, activeStreams);+const birdseyeConfig = useMemo(() => config?.birdseye, [config]);const handleError = useCallback(diff --git a/web/src/views/settings/UiSettingsView.tsx b/web/src/views/settings/UiSettingsView.tsxindex 092e3713dd..d09ab7c758 100644--- a/web/src/views/settings/UiSettingsView.tsx+++ b/web/src/views/settings/UiSettingsView.tsx@@ -99,6 +99,10 @@ export default function UiSettingsView() {const [playbackRate, setPlaybackRate] = usePersistence("playbackRate", 1);const [weekStartsOn, setWeekStartsOn] = usePersistence("weekStartsOn", 0);const [alertVideos, setAlertVideos] = usePersistence("alertVideos", true);+ const [fallbackTimeout, setFallbackTimeout] = usePersistence(+ "liveFallbackTimeout",+ 3,+ );return (<>@@ -161,6 +165,48 @@ export default function UiSettingsView() {<p>{t("general.liveDashboard.displayCameraNames.desc")}</p></div></div>+ <div className="space-y-3">+ <div className="flex flex-row items-center justify-start gap-2">+ <Label+ className="cursor-pointer"+ htmlFor="live-fallback-timeout"+ >+ {t("general.liveDashboard.liveFallbackTimeout.label")}+ </Label>+ </div>+ <div className="my-2 max-w-5xl text-sm text-muted-foreground">+ <p>{t("general.liveDashboard.liveFallbackTimeout.desc")}</p>+ </div>+ <Select+ value={fallbackTimeout?.toString()}+ onValueChange={(value) => setFallbackTimeout(parseInt(value))}+ >+ <SelectTrigger className="w-36">+ {t("time.second", {+ ns: "common",+ time: fallbackTimeout,+ count: fallbackTimeout,+ })}+ </SelectTrigger>+ <SelectContent>+ <SelectGroup>+ {[1, 2, 3, 4, 5, 6, 7, 8, 9, 10].map((timeout) => (+ <SelectItem+ key={timeout}+ className="cursor-pointer"+ value={timeout.toString()}+ >+ {t("time.second", {+ ns: "common",+ time: timeout,+ count: timeout,+ })}+ </SelectItem>+ ))}+ </SelectGroup>+ </SelectContent>+ </Select>+ </div></div><div className="my-3 flex w-full flex-col space-y-6">