How to add metadata using probe and how to create encodebin for saving multiple video files

Hello everyone,
I am trying to modify “deepstream-nvdsanalytics-test” for my use case. My use-case includes saving multiple video files and showing some data over frame by using buffer probe.

Right now I am able to save a single videofile using file-sink. I want to know if I can use something similar to decode-bin which is used to handle multiple sources. If not then how can I create multiple file-sink to encode and save multiple videos.

For my second issue (showing data over frame) I tried implementing snippet of code which is implemented in “osd_sink_pad_buffer_probe” function in "/app/common-apps/deepstream-test1/deepstream_test1.c " but I got error which is mentioned below-

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";

Please let me know if any information is required from my side.
Thanks in advance

• Hardware Platform - GPU
• DeepStream Version - 5.0(docker-container
• NVIDIA GPU Driver Version - 440.33.01

Hello all,
I have tried code taken from this post -

Here the pipeline is written to save image file and I have edited my sink-bin so that I can save the video file. Below I have mentioned the pipeline of sink-bin and the error I am facing while trying the code in above post.

sink-bin:
queue -> nvvidconv -> cap-filter("video/x-raw(Memory:NVMM), format = l420") -> h264encoder(nvv4l2h264enc) -> codecparse(h264parse) -> qtmux -> filesink 

Error snippet:
    0:00:07.014783994  1120 0x7f1ae4013d90 WARN                    v4l2 gstv4l2object.c:2921:gst_v4l2_object_probe_caps_for_format:<nvv4l2decoder0:sink> Could not probe minimum capture size for pixelformat H264
    0:00:07.014796689  1120 0x7f1ae4013d90 WARN                    v4l2 gstv4l2object.c:3035:gst_v4l2_object_get_nearest_size:<nvv4l2decoder0:sink> Unable to try format: Unknown error -1
    0:00:07.014809509  1120 0x7f1ae4013d90 WARN                    v4l2 gstv4l2object.c:2927:gst_v4l2_object_probe_caps_for_format:<nvv4l2decoder0:sink> Could not probe maximum capture size for pixelformat H264
    0:00:07.014874971  1120 0x7f1ae4013d90 WARN                    v4l2 gstv4l2object.c:3035:gst_v4l2_object_get_nearest_size:<nvv4l2decoder0:src> Unable to try format: Unknown error -1

0:00:07.131256250  1120 0x7f1aec011e30 ERROR                   v4l2 gstv4l2object.c:2074:gst_v4l2_object_get_interlace_mode: Driver bug detected - check driver with v4l2-compliance from http://git.linuxtv.org/v4l-utils.git
0:00:07.131315844  1120 0x7f1aec011e30 ERROR                   v4l2 gstv4l2object.c:2074:gst_v4l2_object_get_interlace_mode: Driver bug detected - check driver with v4l2-compliance from http://git.linuxtv.org/v4l-utils.git

Thanks in advance

Hey Customer,
Pls fill your setup info firstly.
Regarding the error your first code snippet, you can refer Using the nvdsanalytics plugin - c++ only? .

Thank you @bcao,
The post you have shared have solved my issue.