To access a gray frame from YUV420p(progressive)

Hardware Platform (Jetson / GPU) NX
• DeepStream Version 6.11
• JetPack Version (valid for Jetson only) 5.02
• TensorRT Version 8.4

I am using preprocess plug-in, the source is a 800x512 rtsp h264 stream. For I need a gray frame before to calculate the ROI params,
I insert a piece of codes:
cv::Mat yuv;
yuv.create(height, width, CV_8UC1);
memcpy(, surface->surfacelist[frameIndex].mappedAddr.addr[0],heightwidthsizeof(uchar));

is above code correct?

Before you dump data from NvBufSurface, you need to check memType, format and layout first. Different memType, format and layout, the dump method is different. DeepStream SDK FAQ - Intelligent Video Analytics / DeepStream SDK - NVIDIA Developer Forums 5

here is a sample: DeepStream SDK FAQ - #18 by bcao

Thanks, I’ll check further.

Do you still need support for this topic? Or should we close it? Thanks.

close ok. Thanks

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.