How to set nvv4l2decoder output suface layout

I use pipeline :
mainLoop_ = g_main_loop_new(NULL, FALSE);
sourcePipeline_ = gst_pipeline_new(“rtsp-decode-pipeline”);
source_ = gst_element_factory_make(“uridecodebin”, “uri-decode”);
videoconvert_ = gst_element_factory_make(“videoconvert”, “videoconvert”);
appsink_ = gst_element_factory_make(“appsink”, “rtsp-appsink”);
I get result surface correctly , but surface memory layout is NVBUF_LAYOUT_BLOCK_LINEAR, anybdoy know how to set to
NVBUF_LAYOUT_PITCH. Because NVBUF_LAYOUT_BLOCK_LINEAR can not process with opencv, I must NvBufSurfTransform change layout?

• Hardware Platform (Jetson )
• DeepStream Version(6.0)
• JetPack Version (4.6)
• TensorRT Version
• NVIDIA GPU Driver Version (valid for GPU only)

Please provide complete information as applicable to your setup.
• Hardware Platform (Jetson / GPU)
• DeepStream Version
• JetPack Version (valid for Jetson only)
• TensorRT Version
• NVIDIA GPU Driver Version (valid for GPU only)
• Issue Type( questions, new requirements, bugs)
• How to reproduce the issue ? (This is for bugs. Including which sample app is using, the configuration files content, the command line used and other details for reproducing)
• Requirement details( This is for new requirement. Including the module name-for which plugin or for which sample application, the function description)

@fanzh I update question, supplied setup information.

here is a sample to operate NvBufSurface by opencv.

This sample i already test, it’s ok when layout is pitch, but output result layout is linear, opencv save result is not right jpg. So I create surface to NvBufSurfTransform convert to pitch, then save is right. My question is how to set param that I could get suface layout is pitch not linear? or unsupport set?

What is the difference between NvBufferLayout_Pitch NvBufferLayout_BlockLinear in nvbuf_utils.h? - #7 by fire9953 here infer @DaneLLL

Hi tanchao7217,
Decoder output is fixed to block linear and please call NvBufSurftransform() to convert to pitch linear.

1 Like

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