• Hardware Platform (Jetson / GPU) Jetson Nano
• DeepStream Version 6.0
• JetPack Version (valid for Jetson only) 4.6.1 (Linux 32.7.1)
• TensorRT Version 8.2.1.9
• Issue Type( questions, new requirements, bugs) Error
I am developing a plugin that crops a frame (i know i can use the nvvideoconvert plugin).
I am trying to perform NvBufSurfTransform to crop the input frame, the return value of the operation is 0 so as it says in the documentation the result is correct, however now i am facing another deal, ¿ this new surface (output_surface in my case) is the one that is going through the pipeline or i have to copy to a output buffer? .
I first started using the transform_ip which only has input buffer function of gstbasetransform_class but i saw a topic that recommend to use the transform function that has both input and output buffer. I am trying to memcopy this output_surface on the out_map_info.data that has been maped to the buffer.
The code goes like this:
if (NvBufSurfTransform(input_surface, output_surface, &transform_params) != 0) {
g_print("Error: NvBufSurfTransform failed.");
NvBufSurfaceDestroy(output_surface);
gst_buffer_unmap(inbuf, &in_map_info);
return GST_FLOW_ERROR;
}else{
GST_DEBUG_OBJECT (dscustomplugin, "\n-----TRANSFORM PERFORMED PERFECTLY-----");
}
// Mapear el buffer de salida
if (!gst_buffer_map(outbuf, &out_map_info, GST_MAP_WRITE)) {
GST_ERROR_OBJECT(dscustomplugin, "\nError: Failed to map output buffer");
NvBufSurfaceDestroy(output_surface);
gst_buffer_unmap(inbuf, &in_map_info);
return GST_FLOW_ERROR;
}else{
GST_DEBUG_OBJECT (dscustomplugin, "\n-----OUTPUT BUFFER MAPPED-----");
}
memcpy(out_map_info.data, output_surface, sizeof(NvBufSurface));
When i run this pipeline i have the following error: 0x55826ea680 ERROR nvvideoconvert gstnvvideoconvert.c:3488:gst_nvvideoconvert_transform: buffer transform failed
gst-launch-1.0 nvarguscamerasrc bufapi-version=true ! nvvideoconvert ! "video/x-raw(memory:NVMM), format=(string)RGBA, width=(int)1920, height=(int)1080, framerate=(fraction)30/1" ! dscustomplugin ! nvvideoconvert ! nvv4l2h264enc bitrate=4000000 ! h264parse ! rtph264pay ! udpsink host=172.25.61.8 port=5000
What i am supposed to do if i want the plugin to perform a crop that is a region of the input frame?