I need to get RGB images to call face recognition server before image preprocessing. Higher resolution is needed for face recognition so need to get high resolution images before rescaling. How can I extract out? May I have sample or any hints?
The more elegant solution (that requires more code) is to implement a GStreamer element based on GstVideoFilter, where you implement the virtual method transform_frame_ip. In that method, you receive a GstFrame with the raw data.
The easy solution is to add a probe with gst_pad_add_probe. Inside the probe callback, you can obtain the buffer with gst_pad_probe_info_get_buffer, map it for reading, and retrieve the raw data.
I use this Luxand face recognition library and they provide an api to call their library with an image. So I need to extract image from Deepstream pipeline.
What kind of image it needs? If it is JPEG, there is sample for how to use hardware accelerated API to encoded NvBufSurface into JPEG images. /opt/nvidia/sources/apps/sample_apps/deepstream-image-meta-test
According to this C++ interface from FaceSDK, I need to pass unsigned char* Buffer to FaceSDK.
I can call this C++ FaceSDK API using the buffer (unsigned char *)dsexample->inter_buf->surfaceList[0].mappedAddr.addr[0] from gst_dsexample_transform_ip function.