diff --git a/web/src/components/settings/wizard/Step2ProbeOrSnapshot.tsx b/web/src/components/settings/wizard/Step2ProbeOrSnapshot.tsx index 364c97202..728cb6634 100644 --- a/web/src/components/settings/wizard/Step2ProbeOrSnapshot.tsx +++ b/web/src/components/settings/wizard/Step2ProbeOrSnapshot.tsx @@ -111,9 +111,14 @@ export default function Step2ProbeOrSnapshot({ s.codec_name?.includes("pcm_alaw"), ); - const resolution = videoStream - ? `${videoStream.width}x${videoStream.height}` - : undefined; + let resolution: string | undefined = undefined; + if (videoStream) { + const width = Number(videoStream.width || 0); + const height = Number(videoStream.height || 0); + if (width > 0 && height > 0) { + resolution = `${width}x${height}`; + } + } const fps = videoStream?.avg_frame_rate ? parseFloat(videoStream.avg_frame_rate.split("/")[0]) / diff --git a/web/src/components/settings/wizard/Step3StreamConfig.tsx b/web/src/components/settings/wizard/Step3StreamConfig.tsx index b46e1f723..1ade7a037 100644 --- a/web/src/components/settings/wizard/Step3StreamConfig.tsx +++ b/web/src/components/settings/wizard/Step3StreamConfig.tsx @@ -240,9 +240,14 @@ export default function Step3StreamConfig({ s.codec_name?.includes("pcm_alaw"), ); - const resolution = videoStream - ? `${videoStream.width}x${videoStream.height}` - : undefined; + let resolution: string | undefined = undefined; + if (videoStream) { + const width = Number(videoStream.width || 0); + const height = Number(videoStream.height || 0); + if (width > 0 && height > 0) { + resolution = `${width}x${height}`; + } + } const fps = videoStream?.avg_frame_rate ? parseFloat(videoStream.avg_frame_rate.split("/")[0]) /