From 4a23cfe6f6a05c62de8bddf43933365f13d4f3a7 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Sat, 21 Dec 2024 18:13:30 -0500 Subject: [PATCH] If ffmpeg can't figure out the sie of the stream, default to what we entered in monitor. --- src/zm_ffmpeg_camera.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/zm_ffmpeg_camera.cpp b/src/zm_ffmpeg_camera.cpp index 9905a26bed..f6e77b538b 100644 --- a/src/zm_ffmpeg_camera.cpp +++ b/src/zm_ffmpeg_camera.cpp @@ -432,6 +432,10 @@ int FfmpegCamera::OpenFfmpeg() { #endif zm_dump_stream_format(mFormatContext, mVideoStreamId, 0, 0); + if (!mVideoCodecContext->width) { + mVideoCodecContext->width = width; + mVideoCodecContext->height = height; + } if ( use_hwaccel && (hwaccel_name != "") ) { #if HAVE_LIBAVUTIL_HWCONTEXT_H