• Hardware Platform (Jetson / GPU) All • DeepStream Version 5.0 dp • JetPack Version (valid for Jetson only)
I’m trying to use the nvdsanalytics plugin and incorporate into my C deepstream application. However I notice the header file for the user meta uses C++ vectors and unordered_map’s. Correct me if I am wrong but does this mean any user of this plugin must develop their apps in C++ now? Why does this plugin use C++ and not others? Is there a recommendation to start using c++ for deepstream applications?
I have same question. I am trying to use nvdsanalytics plugin in “/deepstream-test3/deepstream_test3.c” so that I can overlay some data from nvdsanalytics to the frame.
Unfortunately there seems to be no way unless you compile your program as C++. Or… you create another gstreamer plugin which can read the user meta created by nvdsanalytics (using C++ data structures) and write new user meta using simply C types or glib data structures. The plugin option is better I think - however its more work, so for now I have just made my app compile as c++. Only needed some minor changes to do so.
Hey customoer,
I think nvinfer is using c++11, it will be more efficient based on the move semantic/perfect forward, so I would suggest to use c++ or modern c++, I will check internally and give your reply ASAP.
Hello @jasonpgf2a,
That means I have to create a separate plugin just to add display meta so that I can overlay those data on frame.
I am trying to add some part of deepstream-test3 into nvdsanalytics pipeline so that I can display some data on screen. But while running Makefile command I am facing this error -
deepsteam_nvdsanalytics_test.cpp:123:46: error: invalid conversion from 'gpointer {aka void*}' to 'char*' [-fpermissive]
txt_params->display_text = g_malloc0 (MAX_DISPLAY_LEN);
~~~~~~~~~~^~~~~~~~~~~~~~~~~
deepsteam_nvdsanalytics_test.cpp:132:45: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
txt_params->font_params.font_name = "Serif";
g_malloc just allocates some memory of a suppled size in bytes. You need to specify what you want to use that memory as explicitly. You also probably want g_malloc0 which zeroes out the allocated memory, or g_try_malloc0 which returns null on failure rather than aborting the program.
Second error is similar to the first. You just need to cast:
Lastly, you don’t need to make your own plugin for display meta (you can use a probe), but a plugin is more reusable. Be careful though, since there is a lot of boilerplate involved that’s easy to mess up when modifying.
Edit: see I was ninja’d by @jasonpgf2a … Should really have scrolled down.
Thank you @mdegans and @jasonpgf2a ,
Now my all two errors are solved. If you don’t mind can I ask one more problem which I am facing.
I am trying to create sink-bin in my nvdsanalytics pipeline so that I can save h264 encoded output videos. Right now I am able to save single video by directly connecting sink-bin(except queue) elements to the main pipeline -
For DS 5.0 DP: how to integrate nvdsanalytics plugin in C deepstream-app
User need to create analytics bin in /opt/nvidia/deepstream/deepstream-5.0/sources/apps/apps-common/src
Refer deepstream_dsexample.c and similarly create deepstream_nvdsanalytics.c
deepstream_app.h should be modified to add the instance of nvdsanalytics bin and config in the structures
deepstream_config_file_parser.c needs to updated for parsing of nvdsanalytics config from configuration file
deepstream_app.c should be updated for adding the nvdsanalytics bin in the pipeline, ideally location is after the tracker
Create a new cpp file with process_meta function declared with extern “C”, this will parse the meta for nvdsanalytics, refer sample nvdanalytics test app probe call for creation of the function
Add the probe in deepstream_app_main.c after nvdsanalytics bin
Modify Makefile to compile the cpp and deepstream_app_main.c using g++ with -fpermisive flag and link deepstream-app using g++
These are rough steps, but additional modifications in header files required
For DS 5.0 GA we would be adding the support for meta access