From 5ecb5fdb1cfc3a38fd6c181bcb3ca02143f646e5 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Mon, 26 Jan 2026 15:11:05 -0500 Subject: [PATCH] Need to call trasnfer_hwframe in case we are using hwaccel. --- src/zm_monitor.cpp | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/zm_monitor.cpp b/src/zm_monitor.cpp index dde3e3640..874854d33 100644 --- a/src/zm_monitor.cpp +++ b/src/zm_monitor.cpp @@ -2904,19 +2904,23 @@ bool Monitor::Decode() { Debug(1, "No packet.size(%d) or packet->in_frame(%p). Not decoding", packet->packet->size, packet->in_frame.get()); } // end if need_decoding - if (packet->in_frame and !packet->image) { - packet->image = new Image(camera_width, camera_height, camera->Colours(), camera->SubpixelOrder()); + if (packet->in_frame) { + packet->transfer_hwframe(mVideoCodecContext); - if (convert_context || this->setupConvertContext(packet->in_frame.get(), packet->image)) { - if (!packet->image->Assign(packet->in_frame.get(), convert_context)) { + if (!packet->image) { + packet->image = new Image(camera_width, camera_height, camera->Colours(), camera->SubpixelOrder()); + + if (convert_context || this->setupConvertContext(packet->in_frame.get(), packet->image)) { + if (!packet->image->Assign(packet->in_frame.get(), convert_context)) { + delete packet->image; + packet->image = nullptr; + } + } else { delete packet->image; packet->image = nullptr; - } - } else { - delete packet->image; - packet->image = nullptr; - } // end if have convert_context - } // end if need transfer to image + } // end if have convert_context + } // end if need transfer to image + } // end if in_frame if (analysis_image == ANALYSISIMAGE_YCHANNEL) { Image *y_image = packet->get_y_image();