I am running my custom solution inside docker desktop and the enginer being utilized is WSL.
I have modified the deepstream-test5-app to generate base64 encoded frames via a custom function. I have also modified the Makefile to include openCV for usage in the deepstream_nvdsanalytics.cpp file in which the custom function is defined.
My objective is to extract each frame, encode it in base64 to send over kafka.
Whenever I call this function however I get the following error:
terminate called after throwing an instance of 'cv::Exception'
what(): OpenCV(3.4.18) /opencv/modules/core/src/matrix.cpp:428: error: (-215:Assertion failed) total() == 0 || data != NULL in function 'Mat'
Aborted (core dumped)
I have tried all supported values for nvbuf-memory-type in my config file, ranging from 0-4 for all elements, but none seems to work.
Kindly let me know what I am doing wrong, as the application works perfectly otherwise.
Here are my custom application files: custom_solution.zip (21.5 KB)
I have shifted from building deepstream solutions in python to C, so please forgive my lack of understanding, but any help will be really appreciated :)
Hello Fiona,
Thank you for responding to my query.
So I already have followed this and setup deepstream properly, and it works very well with all the default pre-built applications on my PC and WSL environment.
My problem is that I am trying to run a custom function to extract and encode base64 images. To do that I need to use access a different type of memory and use opencv.
I have added opencv to my make file but when I try to run it I get the following error:
what(): OpenCV(3.4.18) /opencv/modules/core/src/matrix.cpp:428: error: (-215:Assertion failed) total() == 0 || data != NULL in function 'Mat'
Aborted (core dumped)
I feel like I might be accessing the memory incorrectly.
I have already attached my code. Can you please tell me what I am doing wrong?
There is already sample of using opencv to handle the data inside NvBufSurface.I’ve tried the sample in WSL2, it works. Please refer to /opt/nvidia/deepstream/deepstream/sources/apps/sample_apps/deepstream-opencv-test
Enable opencv function of “gst-dsexample” first, please refer to /opt/nvidia/deepstream/deepstream/sources/gst-plugins/gst-dsexample/README.
The dsexample can also be used with test5 sample app. You only need to add the following configuration in your deepstream-test5-app configuration YAML file
gst-dsexample is open source, you may refer to the implementation of /opt/nvidia/deepstream/deepstream/sources/gst-plugins/gst-dsexample/gstdsexample.cpp and /opt/nvidia/deepstream/deepstream/sources/apps/apps-common/src/deepstream_dsexample.c for how to transfer the correct NvBufSurface buffer to opencv