hide resolution if both width and height are zero

This commit is contained in:
Josh Hawkins 2025-11-10 14:56:40 -06:00
parent 53b9b00e10
commit 42f11c71e7
2 changed files with 16 additions and 6 deletions

View File

@ -111,9 +111,14 @@ export default function Step2ProbeOrSnapshot({
s.codec_name?.includes("pcm_alaw"), s.codec_name?.includes("pcm_alaw"),
); );
const resolution = videoStream let resolution: string | undefined = undefined;
? `${videoStream.width}x${videoStream.height}` if (videoStream) {
: undefined; 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 const fps = videoStream?.avg_frame_rate
? parseFloat(videoStream.avg_frame_rate.split("/")[0]) / ? parseFloat(videoStream.avg_frame_rate.split("/")[0]) /

View File

@ -240,9 +240,14 @@ export default function Step3StreamConfig({
s.codec_name?.includes("pcm_alaw"), s.codec_name?.includes("pcm_alaw"),
); );
const resolution = videoStream let resolution: string | undefined = undefined;
? `${videoStream.width}x${videoStream.height}` if (videoStream) {
: undefined; 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 const fps = videoStream?.avg_frame_rate
? parseFloat(videoStream.avg_frame_rate.split("/")[0]) / ? parseFloat(videoStream.avg_frame_rate.split("/")[0]) /