NVR with realtime local object detection for IP cameras
TypeScript aicameragoogle-coralhome-assistanthome-automationhomeautomationmqttnvrobject-detectionrealtimertsptensorflow
Fix stream stats display (#19874)
Josh Hawkins198e53bd42ff
diff --git a/web/src/components/player/JSMpegPlayer.tsx b/web/src/components/player/JSMpegPlayer.tsxindex 3753a9e460..f855350137 100644--- a/web/src/components/player/JSMpegPlayer.tsx+++ b/web/src/components/player/JSMpegPlayer.tsx@@ -164,7 +164,7 @@ export default function JSMpegPlayer({statsIntervalRef.current = setInterval(() => {const currentTimestamp = Date.now();const timeDiff = (currentTimestamp - lastTimestampRef.current) / 1000; // in seconds- const bitrate = (bytesReceivedRef.current * 8) / timeDiff / 1000; // in kbps+ const bitrate = bytesReceivedRef.current / timeDiff / 1000; // in kBpssetStats?.({streamType: "jsmpeg",diff --git a/web/src/components/player/LivePlayer.tsx b/web/src/components/player/LivePlayer.tsxindex 3d8df2b345..d6f7514991 100644--- a/web/src/components/player/LivePlayer.tsx+++ b/web/src/components/player/LivePlayer.tsx@@ -80,7 +80,7 @@ export default function LivePlayer({const [stats, setStats] = useState<PlayerStatsType>({streamType: "-",- bandwidth: 0, // in kbps+ bandwidth: 0, // in kBpslatency: undefined, // in secondstotalFrames: 0,droppedFrames: undefined,diff --git a/web/src/components/player/MsePlayer.tsx b/web/src/components/player/MsePlayer.tsxindex f3ef17a240..7c831e5962 100644--- a/web/src/components/player/MsePlayer.tsx+++ b/web/src/components/player/MsePlayer.tsx@@ -338,7 +338,7 @@ function MSEPlayer({// console.debug("VideoRTC.buffer", b.byteLength, bufLen);} else {try {- sb?.appendBuffer(data);+ sb?.appendBuffer(data as ArrayBuffer);} catch (e) {// no-op}@@ -592,7 +592,7 @@ function MSEPlayer({const now = Date.now();const bytesLoaded = totalBytesLoaded.current;const timeElapsed = (now - lastTimestamp) / 1000; // seconds- const bandwidth = (bytesLoaded - lastLoadedBytes) / timeElapsed / 1024; // kbps+ const bandwidth = (bytesLoaded - lastLoadedBytes) / timeElapsed / 1000; // kBpslastLoadedBytes = bytesLoaded;lastTimestamp = now;diff --git a/web/src/components/player/PlayerStats.tsx b/web/src/components/player/PlayerStats.tsxindex baea08b355..6d7e19f5ec 100644--- a/web/src/components/player/PlayerStats.tsx+++ b/web/src/components/player/PlayerStats.tsx@@ -17,7 +17,7 @@ export function PlayerStats({ stats, minimal }: PlayerStatsProps) {</p><p><span className="text-white/70">{t("stats.bandwidth.title")}</span>{" "}- <span className="text-white">{stats.bandwidth.toFixed(2)} kbps</span>+ <span className="text-white">{stats.bandwidth.toFixed(2)} kBps</span></p>{stats.latency != undefined && (<p>@@ -66,7 +66,7 @@ export function PlayerStats({ stats, minimal }: PlayerStatsProps) {</div><div className="flex flex-col items-center gap-1"><span className="text-white/70">{t("stats.bandwidth.short")}</span>{" "}- <span className="text-white">{stats.bandwidth.toFixed(2)} kbps</span>+ <span className="text-white">{stats.bandwidth.toFixed(2)} kBps</span></div>{stats.latency != undefined && (<div className="hidden flex-col items-center gap-1 md:flex">diff --git a/web/src/components/player/WebRTCPlayer.tsx b/web/src/components/player/WebRTCPlayer.tsxindex b4c9ea6b2b..81d6a72dd1 100644--- a/web/src/components/player/WebRTCPlayer.tsx+++ b/web/src/components/player/WebRTCPlayer.tsx@@ -266,7 +266,7 @@ export default function WebRtcPlayer({const bitrate =timeDiff > 0? (bytesReceived - lastBytesReceived) / timeDiff / 1000- : 0; // in kbps+ : 0; // in kBpssetStats?.({streamType: "WebRTC",