Gstreamer OpenCv Appsink to Appsrc Link Problem

Hello I want to integrate opencv in Gstreamer, to give details, I want to read the data in v4l2src with appsink, do opencv operations and transfer it to a unicast broadcast with appsrc, but when I do this, the pipeline constantly resets itself, I couldn’t figure out why. I would be happy if you could help.

if(gst_element_link_many(GMainElement.v4l2src, GMainElement.source2convertcapsfilter GMainElement.tee, NULL) !=TRUE ||

gst_element_link_many (GUnicastElement.queue_unicast, GUnicastElement.videoconvert1, GUnicastElement.cairooverlay, GUnicastElement.videoconvert2, GUnicastElement.nvvidconv, GUnicastElement.convert2encodercapsfilter, GUnicastElement.nvv4l2h265enc, GUnicastElement.encoder2muxcapsfilter, GUnicastElement.mpegtsmux, GUnicastElement.mux2payloadcapsfilter, GUnicastElement.rtpmp2tpay, GUnicastElement.payload2udpcapsfilter, GUnicastElement.udpsink, NULL) !=TRUE ||

gst_element_link_many (GMulticastElement.queue_multicast, GMulticastElement.nvvidconv, GMulticastElement.convert2encodercapsfilter, GMulticastElement.nvv4l2h265enc, GMulticastElement.encoder2muxcapsfilter, GMulticastElement.mpegtsmux, GMulticastElement.mux2payloadcapsfilter, GMulticastElement.rtpmp2tpay, GMulticastElement.payload2udpcapsfilter, GMulticastElement.udpsink, NULL) !=TRUE ||

gst_element_link_many (GAppsinkElement.queue_appsink, GAppsinkElement.nvvidconv, GAppsinkElement.convert2encodercapsfilter, GAppsinkElement.nvv4l2h265enc, GAppsinkElement.encoder2muxcapsfilter, GAppsinkElement.mpegtsmux, GAppsinkElement.mux2payloadcapsfilter, GAppsinkElement.appsinkCV, NULL) != TRUE || gst_element_link_many (GAppsinkElement.appsourceCV, GaAppsinkElement.unicast_cv NULL) != TRUE)

tee_unicast_pad = gst_element_get_request_pad(GMainElement.tee, src); queue_unicast_pad = gst_element_get_static_pad(GUnicastElement.queue_unicast, “sink”);

tee_multicast_pad = gst_element_get_request_pad(GMainElement.tee, src); queue_multicast_pad = gst_element_get_static_pad(GUnicastElement.queue_multicast, “sink”);

tee_appsink_pad = gst_element_get_request_pad(GMainElement.tee, src); queue_appsink_pad = gst_element_get_static_pad(GAppsinkElement.queue_appsink, “sink”);

if (gst_pad_link(GUnicastElement.tee_pad, GUnicastElement.queue_pad) != GST_PAD_LINK_OK || gst_pad_link(GMulticastElement.tee_pad, GMulticastElement.queue_pad) != GST_PAD_LINK_OK || gst_pad_link(GAppsinkElement.tee_pad, GAppsinkElement.queue_pad) != GST_PAD_LINK_OK)

Appsink Method → void setAppSink(){ _appsinkCV = gst_element_link_factory_make(appsink, “appsink0”); g_object_set(G_OBJECT(_appsinkCV), emit-signals, TRUE, synchronized, FALSE, NULL); }

Appsrc Method → void setAppSource(){ _appsourceCV = gst_element_link_factory_make(appsrc, “appsrc0”); g_object_set(G_OBJECT(_appsourceCV), caps, “gst_caps_new_simple”(…), NULL); }

Callback Method → g_signal_connect(_appsinkCV, “new-sample”, G_CALLBACK(callback_function_opencv), _appsourceCV);

Can you help me on this issue ? Mr. @slomo @tpm