How to save ip_surf image data?

Please provide complete information as applicable to your setup.

• Hardware Platform (Jetson / GPU)
GPU
• DeepStream Version
deepstream 6.1 triton(docker)

Hello

I’m really sorry to keep asking the same question

Each time a problem is solved, a different problem arises, so I ask the question like this

I want to save image data of ip_surf

so, my code is

    for (uint32_t i = 0; i < bh.batchSize; ++i)
    {
		// surfaceList: Holds a pointer to an array of batched buffers.
		NvBufSurfaceParams& sp = ip_surf->surfaceList[i];
        ImageHeader ih;
        ih.colorFormat = sp.colorFormat;
        ih.dataSize    = sp.dataSize;
        std::memcpy(&ih.planeParams, &sp.planeParams, sizeof(SurfacePlaneParams));

        ofs.write((const char*)&ih, sizeof(ImageHeader));
        ofs.write((const char*)sp.dataPtr, sp.dataSize);
    }

In conclusion, I want to save “ip_surf->surfaceList[i].dataPtr”
However, the data is stored in the gpu, and it is confirmed that the data cannot be retrieved with that code now.
How can I get that data down to the cpu and save it?

You can refer the example from other user on this topic: Use nvds_obj_enc_process to save image is much slower than opencv

thank you for reply

in that topic, “cudaMemcpy” and “cudaMemcpyDeviceToHost” are not declared

so Is there anything I need to include separately to use that function?

Yes, you can also refer the link below:
https://forums.developer.nvidia.com/t/deepstream-sdk-faq/80236/17

thank you i resolved

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