Hy,
I’m trying to make this work in c, the following pipeline:
gst-launch-1.0
v4l2src device=/dev/video2 io-mode=dmabuf !
video/x-raw,width=1920,height=1080,framerate=30/1,format=YUY2 !
queue2 ! c.sink_0
v4l2src device=/dev/video3 io-mode=dmabuf !
video/x-raw,width=1920,height=1080,framerate=30/1,format=YUY2 !
queue2 ! c.sink_1
imxg2dcompositor name=c background-color=0x223344
sink_0::xpos=100 sink_0::ypos=100 sink_0::width=1000 sink_0::height=1080
sink_1::xpos=1000 sink_1::ypos=0 sink_1::width=1000 sink_1::height=1080 !
queue2 ! v4l2h265enc extra-controls="encode,frame_level_rate_control_enable=1,h265_mb_level_rate_control=1,video_gop_size=30,video_bitrate=2048000,video_bitrate_mode=1,h265_level=11,h265_profile=4;" output-io-mode=dmabuf-import !
queue2 ! gdppay ! tcpserversink host=0.0.0.0 port=12346
after creating the elements and adding them to bin, i’m having a problem with linking them:
first i’m creating a template :
GstPadTemplate *queue_sink_pad_template = gst_element_class_get_pad_template(GST_ELEMENT_GET_CLASS(data.compositor), "sink_%u");
then i m trying to link the pad of the queue with the pad of the compositor sink_%u which i expected to do sink_0 and then set the properties of the sink_0 pad (also for sink_1)
GstPad *padComp1 = gst_element_request_pad(data.compositor, queue_sink_pad_template, NULL, NULL);
GstPad *padQ2 = gst_element_request_pad_simple(data.queue1, "qsink1");
g_object_set(padComp1, "xpos", 700, NULL);
g_object_set(padComp1, "ypos", 0, NULL);
g_object_set(padComp1, "width", 700, NULL);
g_object_set(padComp1, "height", 500, NULL);
g_print("template: %sn", queue_sink_pad_template->name_template);
GstPad *padComp1 = gst_element_request_pad(data.compositor, queue_sink_pad_template, NULL, NULL);
GstPad *padQ2 = gst_element_request_pad_simple(data.queue1, "qsink1");
g_object_set(padComp1, "xpos", 700, NULL);
g_object_set(padComp1, "ypos", 0, NULL);
g_object_set(padComp1, "width", 700, NULL);
g_object_set(padComp1, "height", 500, NULL);
g_print("template: %sn", queue_sink_pad_template->name_template);
but it seems that sink_0 and sink_1 it s never created since the output is:
template: sink_%u
template: sink_%u
Segmentation fault (core dumped)
maybe it’s a problem with how i link them:
// link elements
if (!gst_element_link_many(data.vsrc1, filter1, data.queue, NULL))
g_error("Failed to link all elements...");
if (!gst_element_link_many(data.vsrc2, filter2, data.queue1, NULL))
g_error("Failed to link all elements...");
if (!gst_element_link_many(data.compositor, data.queue2, data.encoder, data.queue3, data.gdppay, data.tcpserversink, NULL))
g_error("Failed to link all elements...");
I’m trying for some time to make this work so please , any help would be appreciate.