<html><head></head><body><div style="color:#000; background-color:#fff; font-family:Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:13px"><div><span>Solved ! <br></span></div><div id="yui_3_16_0_1_1504198671561_11627"><br><span></span></div><div id="yui_3_16_0_1_1504198671561_11628"><span id="yui_3_16_0_1_1504198671561_11629">This is the correct pipeline:</span></div><div id="yui_3_16_0_1_1504198671561_11630"><br><span></span></div><div dir="ltr" id="yui_3_16_0_1_1504198671561_11631"><span id="yui_3_16_0_1_1504198671561_11667"><b id="yui_3_16_0_1_1504198671561_11669">v4l2src device=/dev/webcam ! videoconvert ! video/x-raw,width=544,height=288,framerate=10/1 ! tee name=t ! queue ! v4l2h264enc ! h264parse ! mp4mux ! filesink location=video.mp4 t. ! queue  ! videoconvert ! pngenc ! multifilesink location=file%6d.png</b></span></div><div id="yui_3_16_0_1_1504198671561_11671" dir="ltr"><br><span id="yui_3_16_0_1_1504198671561_11667"></span></div><div id="yui_3_16_0_1_1504198671561_11673" dir="ltr"><span id="yui_3_16_0_1_1504198671561_11667">Simon</span></div> <div class="qtdSeparateBR"><br><br></div><div style="display: block;" class="yahoo_quoted"> <div style="font-family: Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 13px;"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;"> <div dir="ltr"><font face="Arial" size="2"> El Jueves 31 de agosto de 2017 18:23, simo zz <simon.zz@yahoo.com> escribió:<br></font></div>  <br><br> <div class="y_msg_container"><div id="yiv7986446956"><div><div style="color:#000;background-color:#fff;font-family:Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:13px;"><div dir="ltr" id="yiv7986446956yui_3_16_0_1_1504196873211_4350">There is an error in the return of the function <b id="yiv7986446956yui_3_16_0_1_1504196873211_4738">buildPipeline</b>. Should return <b>true</b> and of course not 0.<br clear="none"></div><div id="yiv7986446956yui_3_16_0_1_1504196873211_4735"><br clear="none"></div><div id="yiv7986446956yui_3_16_0_1_1504196873211_4539"><b id="yiv7986446956yui_3_16_0_1_1504196873211_4540">gboolean buildPipeline(GstData *gstData, const char *filename)<br id="yiv7986446956yui_3_16_0_1_1504196873211_4541" clear="none">{<br id="yiv7986446956yui_3_16_0_1_1504196873211_4542" clear="none">    gstData->pipeline = gst_pipeline_new ("pipeline");<br id="yiv7986446956yui_3_16_0_1_1504196873211_4543" clear="none">    if (! gstData->pipeline)<br id="yiv7986446956yui_3_16_0_1_1504196873211_4544" clear="none">    {<br id="yiv7986446956yui_3_16_0_1_1504196873211_4545" clear="none">        printf("Error creating pipeline.\n");<br id="yiv7986446956yui_3_16_0_1_1504196873211_4546" clear="none">        return false;<br id="yiv7986446956yui_3_16_0_1_1504196873211_4547" clear="none">    }<br id="yiv7986446956yui_3_16_0_1_1504196873211_4548" clear="none">    <br id="yiv7986446956yui_3_16_0_1_1504196873211_4549" clear="none">    gstData->v4l2src = gst_element_factory_make("v4l2src", NULL);<br id="yiv7986446956yui_3_16_0_1_1504196873211_4550" clear="none">    if (! gstData->v4l2src)<br id="yiv7986446956yui_3_16_0_1_1504196873211_4551" clear="none">    {<br id="yiv7986446956yui_3_16_0_1_1504196873211_4552" clear="none">        printf("Error creating v4l2src.\n");<br id="yiv7986446956yui_3_16_0_1_1504196873211_4553" clear="none">        return false;<br id="yiv7986446956yui_3_16_0_1_1504196873211_4554" clear="none">    }<br id="yiv7986446956yui_3_16_0_1_1504196873211_4555" clear="none"><br id="yiv7986446956yui_3_16_0_1_1504196873211_4556" clear="none">    gstData->tee = gst_element_factory_make("tee", "tee");<br id="yiv7986446956yui_3_16_0_1_1504196873211_4557" clear="none">    if (! gstData->tee)<br id="yiv7986446956yui_3_16_0_1_1504196873211_4558" clear="none">    {<br id="yiv7986446956yui_3_16_0_1_1504196873211_4559" clear="none">        printf("Error creating tee.\n");<br id="yiv7986446956yui_3_16_0_1_1504196873211_4560" clear="none">        return false;<br id="yiv7986446956yui_3_16_0_1_1504196873211_4561" clear="none">    }<br id="yiv7986446956yui_3_16_0_1_1504196873211_4562" clear="none"><br id="yiv7986446956yui_3_16_0_1_1504196873211_4563" clear="none">    gstData->vQueue = gst_element_factory_make("queue", NULL);<br id="yiv7986446956yui_3_16_0_1_1504196873211_4564" clear="none">    if (! gstData->vQueue)<br id="yiv7986446956yui_3_16_0_1_1504196873211_4565" clear="none">    {<br id="yiv7986446956yui_3_16_0_1_1504196873211_4566" clear="none">        printf("Error creating video queue.\n");<br id="yiv7986446956yui_3_16_0_1_1504196873211_4567" clear="none">        return false;<br id="yiv7986446956yui_3_16_0_1_1504196873211_4568" clear="none">    }<br id="yiv7986446956yui_3_16_0_1_1504196873211_4569" clear="none"><br id="yiv7986446956yui_3_16_0_1_1504196873211_4570" clear="none">    gstData->iQueue = gst_element_factory_make("queue", NULL);<br id="yiv7986446956yui_3_16_0_1_1504196873211_4571" clear="none">    if (! gstData->iQueue)<br id="yiv7986446956yui_3_16_0_1_1504196873211_4572" clear="none">    {<br id="yiv7986446956yui_3_16_0_1_1504196873211_4573" clear="none">        printf("Error creating image queue.\n");<br id="yiv7986446956yui_3_16_0_1_1504196873211_4574" clear="none">        return false;<br id="yiv7986446956yui_3_16_0_1_1504196873211_4575" clear="none">    }<br id="yiv7986446956yui_3_16_0_1_1504196873211_4576" clear="none"><br id="yiv7986446956yui_3_16_0_1_1504196873211_4577" clear="none">    gstData->decodebin = gst_element_factory_make("decodebin", NULL);<br id="yiv7986446956yui_3_16_0_1_1504196873211_4578" clear="none">    if (! gstData->decodebin)<br id="yiv7986446956yui_3_16_0_1_1504196873211_4579" clear="none">    {<br id="yiv7986446956yui_3_16_0_1_1504196873211_4580" clear="none">        printf("Error creating decodebin.\n");<br id="yiv7986446956yui_3_16_0_1_1504196873211_4581" clear="none">        return false;<br id="yiv7986446956yui_3_16_0_1_1504196873211_4582" clear="none">    }<br id="yiv7986446956yui_3_16_0_1_1504196873211_4583" clear="none"><br id="yiv7986446956yui_3_16_0_1_1504196873211_4584" clear="none">    gstData->pngenc = gst_element_factory_make("pngenc", NULL);<br id="yiv7986446956yui_3_16_0_1_1504196873211_4585" clear="none">    if (! gstData->pngenc)<br id="yiv7986446956yui_3_16_0_1_1504196873211_4586" clear="none">    {<br id="yiv7986446956yui_3_16_0_1_1504196873211_4587" clear="none">        printf("Error creating pngenc.\n");<br id="yiv7986446956yui_3_16_0_1_1504196873211_4588" clear="none">        return false;<br id="yiv7986446956yui_3_16_0_1_1504196873211_4589" clear="none">    }<br id="yiv7986446956yui_3_16_0_1_1504196873211_4590" clear="none"><br id="yiv7986446956yui_3_16_0_1_1504196873211_4591" clear="none">    gstData->iVideoconvert = gst_element_factory_make("videoconvert", NULL);<br id="yiv7986446956yui_3_16_0_1_1504196873211_4592" clear="none">    if (! gstData->iVideoconvert)<br id="yiv7986446956yui_3_16_0_1_1504196873211_4593" clear="none">    {<br id="yiv7986446956yui_3_16_0_1_1504196873211_4594" clear="none">        printf("Error creating iVideoconvert.\n");<br id="yiv7986446956yui_3_16_0_1_1504196873211_4595" clear="none">        return false;<br id="yiv7986446956yui_3_16_0_1_1504196873211_4596" clear="none">    }<br id="yiv7986446956yui_3_16_0_1_1504196873211_4597" clear="none"><br id="yiv7986446956yui_3_16_0_1_1504196873211_4598" clear="none">    gstData->vVideoconvert = gst_element_factory_make("videoconvert", NULL);<br id="yiv7986446956yui_3_16_0_1_1504196873211_4599" clear="none">    if (! gstData->vVideoconvert)<br id="yiv7986446956yui_3_16_0_1_1504196873211_4600" clear="none">    {<br id="yiv7986446956yui_3_16_0_1_1504196873211_4601" clear="none">        printf("Error creating vVideoconvert.\n");<br id="yiv7986446956yui_3_16_0_1_1504196873211_4602" clear="none">        return false;<br id="yiv7986446956yui_3_16_0_1_1504196873211_4603" clear="none">    }<br id="yiv7986446956yui_3_16_0_1_1504196873211_4604" clear="none"><br id="yiv7986446956yui_3_16_0_1_1504196873211_4605" clear="none">    gstData->capsfilter = gst_element_factory_make("capsfilter", NULL);<br id="yiv7986446956yui_3_16_0_1_1504196873211_4606" clear="none">    if (! gstData->capsfilter)<br id="yiv7986446956yui_3_16_0_1_1504196873211_4607" clear="none">    {<br id="yiv7986446956yui_3_16_0_1_1504196873211_4608" clear="none">        printf("Error creating capsfilter.\n");<br id="yiv7986446956yui_3_16_0_1_1504196873211_4609" clear="none">        return false;<br id="yiv7986446956yui_3_16_0_1_1504196873211_4610" clear="none">    }<br id="yiv7986446956yui_3_16_0_1_1504196873211_4611" clear="none"><br id="yiv7986446956yui_3_16_0_1_1504196873211_4612" clear="none">    gstData->v4l2h264enc = gst_element_factory_make("v4l2h264enc", NULL);<br id="yiv7986446956yui_3_16_0_1_1504196873211_4613" clear="none">    if (! gstData->v4l2h264enc)<br id="yiv7986446956yui_3_16_0_1_1504196873211_4614" clear="none">    {<br id="yiv7986446956yui_3_16_0_1_1504196873211_4615" clear="none">        printf("Error creating v4l2h264enc.\n");<br id="yiv7986446956yui_3_16_0_1_1504196873211_4616" clear="none">        return false;<br id="yiv7986446956yui_3_16_0_1_1504196873211_4617" clear="none">    }<br id="yiv7986446956yui_3_16_0_1_1504196873211_4618" clear="none"><br id="yiv7986446956yui_3_16_0_1_1504196873211_4619" clear="none">    gstData->h264parse = gst_element_factory_make("h264parse", NULL);<br id="yiv7986446956yui_3_16_0_1_1504196873211_4620" clear="none">    if (! gstData->h264parse)<br id="yiv7986446956yui_3_16_0_1_1504196873211_4621" clear="none">    {<br id="yiv7986446956yui_3_16_0_1_1504196873211_4622" clear="none">        printf("Error creating h264parse.\n");<br id="yiv7986446956yui_3_16_0_1_1504196873211_4623" clear="none">        return false;<br id="yiv7986446956yui_3_16_0_1_1504196873211_4624" clear="none">    }<br id="yiv7986446956yui_3_16_0_1_1504196873211_4625" clear="none"><br id="yiv7986446956yui_3_16_0_1_1504196873211_4626" clear="none">    gstData->mp4mux = gst_element_factory_make("mp4mux", NULL);<br id="yiv7986446956yui_3_16_0_1_1504196873211_4627" clear="none">    if (! gstData->mp4mux)<br id="yiv7986446956yui_3_16_0_1_1504196873211_4628" clear="none">    {<br id="yiv7986446956yui_3_16_0_1_1504196873211_4629" clear="none">        printf("Error creating mp4mux.\n");<br id="yiv7986446956yui_3_16_0_1_1504196873211_4630" clear="none">        return false;<br id="yiv7986446956yui_3_16_0_1_1504196873211_4631" clear="none">    }<br id="yiv7986446956yui_3_16_0_1_1504196873211_4632" clear="none"><br id="yiv7986446956yui_3_16_0_1_1504196873211_4633" clear="none">    gstData->filesink = gst_element_factory_make("filesink", NULL);<br id="yiv7986446956yui_3_16_0_1_1504196873211_4634" clear="none">    if (! gstData->filesink)<br id="yiv7986446956yui_3_16_0_1_1504196873211_4635" clear="none">    {<br id="yiv7986446956yui_3_16_0_1_1504196873211_4636" clear="none">        printf("Error creating filesink.\n");<br id="yiv7986446956yui_3_16_0_1_1504196873211_4637" clear="none">        return false;<br id="yiv7986446956yui_3_16_0_1_1504196873211_4638" clear="none">    }<br id="yiv7986446956yui_3_16_0_1_1504196873211_4639" clear="none"><br id="yiv7986446956yui_3_16_0_1_1504196873211_4640" clear="none">    gstData->multifilesink = gst_element_factory_make("multifilesink", NULL);<br id="yiv7986446956yui_3_16_0_1_1504196873211_4641" clear="none">    if (! gstData->multifilesink)<br id="yiv7986446956yui_3_16_0_1_1504196873211_4642" clear="none">    {<br id="yiv7986446956yui_3_16_0_1_1504196873211_4643" clear="none">        printf("Error creating multifilesink.\n");<br id="yiv7986446956yui_3_16_0_1_1504196873211_4644" clear="none">        return false;<br id="yiv7986446956yui_3_16_0_1_1504196873211_4645" clear="none">    }<br id="yiv7986446956yui_3_16_0_1_1504196873211_4646" clear="none"><br id="yiv7986446956yui_3_16_0_1_1504196873211_4647" clear="none">    g_object_set(G_OBJECT(gstData->v4l2src), "device", filename, NULL);<br id="yiv7986446956yui_3_16_0_1_1504196873211_4648" clear="none">    g_object_set(G_OBJECT(gstData->filesink), "location", "video.mp4", NULL);<br id="yiv7986446956yui_3_16_0_1_1504196873211_4649" clear="none">    g_object_set(G_OBJECT(gstData->multifilesink), "location", "file%6u.png", NULL);<br id="yiv7986446956yui_3_16_0_1_1504196873211_4650" clear="none"><br id="yiv7986446956yui_3_16_0_1_1504196873211_4651" clear="none">    gstData->caps = gst_caps_from_string(CAPS_STR);<br id="yiv7986446956yui_3_16_0_1_1504196873211_4652" clear="none">    g_object_set(G_OBJECT(gstData->capsfilter), "caps", gstData->caps, NULL);<br id="yiv7986446956yui_3_16_0_1_1504196873211_4653" clear="none"><br id="yiv7986446956yui_3_16_0_1_1504196873211_4654" clear="none">   
 gst_bin_add_many(GST_BIN(gstData->pipeline), gstData->v4l2src, 
gstData->tee, gstData->vQueue, gstData->iQueue, 
gstData->iVideoconvert, gstData->vVideoconvert, 
gstData->decodebin, gstData->pngenc, gstData->capsfilter, 
gstData->v4l2h264enc, gstData->h264parse, gstData->mp4mux, 
gstData->filesink, gstData->multifilesink, NULL);<br id="yiv7986446956yui_3_16_0_1_1504196873211_4655" clear="none"><br id="yiv7986446956yui_3_16_0_1_1504196873211_4656" clear="none">   
 if(gst_element_link_many(gstData->v4l2src, 
gstData->vVideoconvert, gstData->capsfilter, gstData->tee, 
NULL) != true)<br id="yiv7986446956yui_3_16_0_1_1504196873211_4657" clear="none">    {<br id="yiv7986446956yui_3_16_0_1_1504196873211_4658" clear="none">        g_print("Error linking pipeline: v4l2src ! videoconvert ! capsfilter ! tee ...\n");<br id="yiv7986446956yui_3_16_0_1_1504196873211_4659" clear="none">        return false;<br id="yiv7986446956yui_3_16_0_1_1504196873211_4660" clear="none">    }<br id="yiv7986446956yui_3_16_0_1_1504196873211_4661" clear="none"><br id="yiv7986446956yui_3_16_0_1_1504196873211_4662" clear="none">   
 if(gst_element_link_many(gstData->vQueue, gstData->v4l2h264enc, 
gstData->h264parse, gstData->mp4mux, gstData->filesink, NULL) 
!= true)<br id="yiv7986446956yui_3_16_0_1_1504196873211_4663" clear="none">    {<br id="yiv7986446956yui_3_16_0_1_1504196873211_4664" clear="none">        g_print("Error linking pipeline: queue ! v4l2h264enc ! h264parse ! mp4mux ! filesink ...\n");<br id="yiv7986446956yui_3_16_0_1_1504196873211_4665" clear="none">        return false;<br id="yiv7986446956yui_3_16_0_1_1504196873211_4666" clear="none">    }<br id="yiv7986446956yui_3_16_0_1_1504196873211_4667" clear="none"><br id="yiv7986446956yui_3_16_0_1_1504196873211_4668" clear="none">    // Program fails here<br id="yiv7986446956yui_3_16_0_1_1504196873211_4669" clear="none">   
 if(gst_element_link_many(gstData->iQueue, gstData->decodebin, 
gstData->iVideoconvert, gstData->pngenc, 
gstData->multifilesink, NULL) != true)<br id="yiv7986446956yui_3_16_0_1_1504196873211_4670" clear="none">    {<br id="yiv7986446956yui_3_16_0_1_1504196873211_4671" clear="none">        g_print("Error linking pipeline: queue ! decodebin ! videoconvert ! pngenc ! multifilesink ...\n");<br id="yiv7986446956yui_3_16_0_1_1504196873211_4672" clear="none">        return false;<br id="yiv7986446956yui_3_16_0_1_1504196873211_4673" clear="none">    }<br id="yiv7986446956yui_3_16_0_1_1504196873211_4674" clear="none"><br id="yiv7986446956yui_3_16_0_1_1504196873211_4675" clear="none">    // manually link pads<br id="yiv7986446956yui_3_16_0_1_1504196873211_4676" clear="none">    gstData->teepadtmplate = gst_element_class_get_pad_template(GST_ELEMENT_GET_CLASS (gstData->tee), "src_%u");<br id="yiv7986446956yui_3_16_0_1_1504196873211_4677" clear="none">    if (! gstData->teepadtmplate)<br id="yiv7986446956yui_3_16_0_1_1504196873211_4678" clear="none">    {<br id="yiv7986446956yui_3_16_0_1_1504196873211_4679" clear="none">        g_print("Error setting tee pad template...\n");<br id="yiv7986446956yui_3_16_0_1_1504196873211_4680" clear="none">        return false;<br id="yiv7986446956yui_3_16_0_1_1504196873211_4681" clear="none">    }<br id="yiv7986446956yui_3_16_0_1_1504196873211_4682" clear="none">    <br id="yiv7986446956yui_3_16_0_1_1504196873211_4683" clear="none">    gstData->teeSrcVPad = gst_element_request_pad(gstData->tee, gstData->teepadtmplate, NULL, NULL);<br id="yiv7986446956yui_3_16_0_1_1504196873211_4684" clear="none">    if(! gstData->teeSrcVPad)<br id="yiv7986446956yui_3_16_0_1_1504196873211_4685" clear="none">    {<br id="yiv7986446956yui_3_16_0_1_1504196873211_4686" clear="none">        g_print("Error setting tee video src pad...\n");<br id="yiv7986446956yui_3_16_0_1_1504196873211_4687" clear="none">        return false;<br id="yiv7986446956yui_3_16_0_1_1504196873211_4688" clear="none">    }<br id="yiv7986446956yui_3_16_0_1_1504196873211_4689" clear="none"><br id="yiv7986446956yui_3_16_0_1_1504196873211_4690" clear="none">    gstData->vQueueSinkPad = gst_element_get_static_pad(gstData->vQueue, "sink");<br id="yiv7986446956yui_3_16_0_1_1504196873211_4691" clear="none">    if(! gstData->vQueueSinkPad)<br id="yiv7986446956yui_3_16_0_1_1504196873211_4692" clear="none">    {<br id="yiv7986446956yui_3_16_0_1_1504196873211_4693" clear="none">        g_print("Error setting tee video sink pad...\n");<br id="yiv7986446956yui_3_16_0_1_1504196873211_4694" clear="none">        return false;<br id="yiv7986446956yui_3_16_0_1_1504196873211_4695" clear="none">    }<br id="yiv7986446956yui_3_16_0_1_1504196873211_4696" clear="none"><br id="yiv7986446956yui_3_16_0_1_1504196873211_4697" clear="none">    gstData->teeSrcIPad = gst_element_request_pad(gstData->tee, gstData->teepadtmplate, NULL, NULL);<br id="yiv7986446956yui_3_16_0_1_1504196873211_4698" clear="none">    if(! gstData->teeSrcIPad)<br id="yiv7986446956yui_3_16_0_1_1504196873211_4699" clear="none">    {<br id="yiv7986446956yui_3_16_0_1_1504196873211_4700" clear="none">        g_print("Error setting tee image src pad...\n");<br id="yiv7986446956yui_3_16_0_1_1504196873211_4701" clear="none">        return false;<br id="yiv7986446956yui_3_16_0_1_1504196873211_4702" clear="none">    }<br id="yiv7986446956yui_3_16_0_1_1504196873211_4703" clear="none">    gstData->iQueueSinkPad = gst_element_get_static_pad (gstData->iQueue, "sink");<br id="yiv7986446956yui_3_16_0_1_1504196873211_4704" clear="none">    if(! gstData->iQueueSinkPad)<br id="yiv7986446956yui_3_16_0_1_1504196873211_4705" clear="none">    {<br id="yiv7986446956yui_3_16_0_1_1504196873211_4706" clear="none">        g_print("Error setting queue image sink pad...\n");<br id="yiv7986446956yui_3_16_0_1_1504196873211_4707" clear="none">        return false;<br id="yiv7986446956yui_3_16_0_1_1504196873211_4708" clear="none">    }<br id="yiv7986446956yui_3_16_0_1_1504196873211_4709" clear="none"><br id="yiv7986446956yui_3_16_0_1_1504196873211_4710" clear="none">    if (gst_pad_link(gstData->teeSrcVPad, gstData->vQueueSinkPad) != GST_PAD_LINK_OK)<br id="yiv7986446956yui_3_16_0_1_1504196873211_4711" clear="none">    {<br id="yiv7986446956yui_3_16_0_1_1504196873211_4712" clear="none">        g_print("Error: cannot connect tee to video queue...\n");<br id="yiv7986446956yui_3_16_0_1_1504196873211_4713" clear="none">        return false;<br id="yiv7986446956yui_3_16_0_1_1504196873211_4714" clear="none">    }<br id="yiv7986446956yui_3_16_0_1_1504196873211_4715" clear="none"><br id="yiv7986446956yui_3_16_0_1_1504196873211_4716" clear="none">    if (gst_pad_link(gstData->teeSrcIPad, gstData->iQueueSinkPad) != GST_PAD_LINK_OK)<br id="yiv7986446956yui_3_16_0_1_1504196873211_4717" clear="none">    {<br id="yiv7986446956yui_3_16_0_1_1504196873211_4718" clear="none">        g_print("Error: cannot connect tee to appsink queue...\n");<br id="yiv7986446956yui_3_16_0_1_1504196873211_4719" clear="none">        return false;<br id="yiv7986446956yui_3_16_0_1_1504196873211_4720" clear="none">    }<br id="yiv7986446956yui_3_16_0_1_1504196873211_4721" clear="none">    <br id="yiv7986446956yui_3_16_0_1_1504196873211_4722" clear="none">    return true;<br id="yiv7986446956yui_3_16_0_1_1504196873211_4723" clear="none"></b></div><div dir="ltr" id="yiv7986446956yui_3_16_0_1_1504196873211_4724"><div dir="ltr" id="yiv7986446956yui_3_16_0_1_1504196873211_4726"><b id="yiv7986446956yui_3_16_0_1_1504196873211_4725">}</b></div></div><div> </div><div id="yiv7986446956yui_3_16_0_1_1504196873211_4345"><br clear="none"><span></span></div><div id="yiv7986446956yui_3_16_0_1_1504196873211_4796">Simon<br clear="none"></div><div id="yiv7986446956yui_3_16_0_1_1504196873211_4795"> <br clear="none"></div><div class="yiv7986446956qtdSeparateBR"><br clear="none"><br clear="none"></div><div class="yiv7986446956yqt4688267471" id="yiv7986446956yqt52734"><div class="yiv7986446956yahoo_quoted" style="display:block;"> <div style="font-family:Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:13px;"> <div style="font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px;"> <div dir="ltr"><font face="Arial" size="2"> El Jueves 31 de agosto de 2017 17:30, simo zz <simon.zz@yahoo.com> escribió:<br clear="none"></font></div>  <br clear="none"><br clear="none"> <div class="yiv7986446956y_msg_container"><div id="yiv7986446956"><div><div style="color:#000;background-color:#fff;font-family:Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:13px;"><div id="yiv7986446956"><div id="yiv7986446956yui_3_16_0_1_1504192874455_2486"><div id="yiv7986446956yui_3_16_0_1_1504192874455_2485" style="color:#000;background-color:#fff;font-family:Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:13px;"><div id="yiv7986446956"><div id="yiv7986446956yui_3_16_0_1_1504184226553_4882"><div id="yiv7986446956yui_3_16_0_1_1504184226553_4881" style="color:#000;background-color:#fff;font-family:Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:13px;"><div id="yiv7986446956"><div id="yiv7986446956yui_3_16_0_1_1504184226553_2567"><div id="yiv7986446956yui_3_16_0_1_1504184226553_2566" style="color:#000;background-color:#fff;font-family:Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:13px;"><div id="yiv7986446956yui_3_16_0_1_1504175479485_6908">Hello,</div><div id="yiv7986446956yui_3_16_0_1_1504175479485_6914"><br clear="none"></div><div dir="ltr" id="yiv7986446956yui_3_16_0_1_1504175479485_6988"><div dir="ltr" id="yiv7986446956yui_3_16_0_1_1504192874455_2620">I need to implement the following pipeline (successfully tested with <b>gst-launch-1.0 -e</b>) using C API:<br clear="none"></div></div><div dir="ltr" id="yiv7986446956yui_3_16_0_1_1504175479485_7190"><br clear="none"></div><div dir="ltr" id="yiv7986446956yui_3_16_0_1_1504175479485_7191"><div dir="ltr" id="yiv7986446956yui_3_16_0_1_1504192874455_2565"><b id="yiv7986446956yui_3_16_0_1_1504175479485_7194">v4l2src device=/dev/webcam ! videoconvert ! video/x-raw,width=544,height=288,framerate=10/1 ! tee name=t ! queue ! v4l2h264enc ! h264parse ! mp4mux ! filesink location=video.mp4 t. ! queue ! decodebin ! videoconvert ! pngenc ! multifilesink location=file%6d.png</b></div></div><div dir="ltr" id="yiv7986446956yui_3_16_0_1_1504175479485_8542"><div id="yiv7986446956yui_3_16_0_1_1504184226553_5412"><div id="yiv7986446956yui_3_16_0_1_1504192874455_2737"><br clear="none"></div><div dir="ltr" id="yiv7986446956yui_3_16_0_1_1504192874455_2640">The C code used for GstElements declaration and pipeline initialization is the following:</div><div dir="ltr" id="yiv7986446956yui_3_16_0_1_1504192874455_2656"><br clear="none"></div><b id="yiv7986446956yui_3_16_0_1_1504192874455_3475">typedef struct _CustomData<br id="yiv7986446956yui_3_16_0_1_1504192874455_4284" clear="none">{<br id="yiv7986446956yui_3_16_0_1_1504192874455_4285" clear="none">    GstElement *pipeline;<br id="yiv7986446956yui_3_16_0_1_1504192874455_4286" clear="none">    GstElement *v4l2src;<br id="yiv7986446956yui_3_16_0_1_1504192874455_4287" clear="none">        <br id="yiv7986446956yui_3_16_0_1_1504192874455_4288" clear="none">    GstElement *tee;<br id="yiv7986446956yui_3_16_0_1_1504192874455_4289" clear="none">    // connect this pad to v4lserc<br id="yiv7986446956yui_3_16_0_1_1504192874455_4290" clear="none">    GstPadTemplate *teepadtmplate;<br id="yiv7986446956yui_3_16_0_1_1504192874455_4291" clear="none">    <br id="yiv7986446956yui_3_16_0_1_1504192874455_4292" clear="none">    // tee src pads<br id="yiv7986446956yui_3_16_0_1_1504192874455_4293" clear="none">    GstPad *teeSrcVPad;<br id="yiv7986446956yui_3_16_0_1_1504192874455_4294" clear="none">    GstPad *teeSrcIPad;<br id="yiv7986446956yui_3_16_0_1_1504192874455_4295" clear="none"><br id="yiv7986446956yui_3_16_0_1_1504192874455_4296" clear="none">    // queues sink pads<br id="yiv7986446956yui_3_16_0_1_1504192874455_4297" clear="none">    GstPad *vQueueSinkPad;<br id="yiv7986446956yui_3_16_0_1_1504192874455_4298" clear="none">    GstPad *iQueueSinkPad;<br id="yiv7986446956yui_3_16_0_1_1504192874455_4299" clear="none"><br id="yiv7986446956yui_3_16_0_1_1504192874455_4300" clear="none">    GstElement *vQueue;<br id="yiv7986446956yui_3_16_0_1_1504192874455_4301" clear="none">    GstElement *iQueue;<br id="yiv7986446956yui_3_16_0_1_1504192874455_4302" clear="none"><br id="yiv7986446956yui_3_16_0_1_1504192874455_4303" clear="none">    GstElement *decodebin;<br id="yiv7986446956yui_3_16_0_1_1504192874455_4304" clear="none">    GstElement *pngenc;<br id="yiv7986446956yui_3_16_0_1_1504192874455_4305" clear="none"><br id="yiv7986446956yui_3_16_0_1_1504192874455_4306" clear="none">    GstElement *vVideoconvert;<br id="yiv7986446956yui_3_16_0_1_1504192874455_4307" clear="none">    GstElement *iVideoconvert;<br id="yiv7986446956yui_3_16_0_1_1504192874455_4308" clear="none"><br id="yiv7986446956yui_3_16_0_1_1504192874455_4309" clear="none">    GstElement *capsfilter;<br id="yiv7986446956yui_3_16_0_1_1504192874455_4310" clear="none">    GstCaps *caps;<br id="yiv7986446956yui_3_16_0_1_1504192874455_4311" clear="none">    GstElement *v4l2h264enc;<br id="yiv7986446956yui_3_16_0_1_1504192874455_4312" clear="none">    GstElement *h264parse;<br id="yiv7986446956yui_3_16_0_1_1504192874455_4313" clear="none">    GstElement *mp4mux;<br id="yiv7986446956yui_3_16_0_1_1504192874455_4314" clear="none">    GstElement *filesink;<br id="yiv7986446956yui_3_16_0_1_1504192874455_4315" clear="none">    GstElement *multifilesink;<br id="yiv7986446956yui_3_16_0_1_1504192874455_4316" clear="none">    GstBuffer *buffer;<br id="yiv7986446956yui_3_16_0_1_1504192874455_4317" clear="none"><br id="yiv7986446956yui_3_16_0_1_1504192874455_4318" clear="none">} GstData;<br id="yiv7986446956yui_3_16_0_1_1504192874455_4319" clear="none"><br id="yiv7986446956yui_3_16_0_1_1504192874455_4320" clear="none"><br id="yiv7986446956yui_3_16_0_1_1504192874455_4321" clear="none">gboolean buildPipeline(GstData *gstData, const char *filename)<br id="yiv7986446956yui_3_16_0_1_1504192874455_4322" clear="none">{<br id="yiv7986446956yui_3_16_0_1_1504192874455_4323" clear="none">    gstData->pipeline = gst_pipeline_new ("pipeline");<br id="yiv7986446956yui_3_16_0_1_1504192874455_4324" clear="none">    if (! gstData->pipeline)<br id="yiv7986446956yui_3_16_0_1_1504192874455_4325" clear="none">    {<br id="yiv7986446956yui_3_16_0_1_1504192874455_4326" clear="none">        printf("Error creating pipeline.\n");<br id="yiv7986446956yui_3_16_0_1_1504192874455_4327" clear="none">        return false;<br id="yiv7986446956yui_3_16_0_1_1504192874455_4328" clear="none">    }<br id="yiv7986446956yui_3_16_0_1_1504192874455_4329" clear="none">    <br id="yiv7986446956yui_3_16_0_1_1504192874455_4330" clear="none">    gstData->v4l2src = gst_element_factory_make("v4l2src", NULL);<br id="yiv7986446956yui_3_16_0_1_1504192874455_4331" clear="none">    if (! gstData->v4l2src)<br id="yiv7986446956yui_3_16_0_1_1504192874455_4332" clear="none">    {<br id="yiv7986446956yui_3_16_0_1_1504192874455_4333" clear="none">        printf("Error creating v4l2src.\n");<br id="yiv7986446956yui_3_16_0_1_1504192874455_4334" clear="none">        return false;<br id="yiv7986446956yui_3_16_0_1_1504192874455_4335" clear="none">    }<br id="yiv7986446956yui_3_16_0_1_1504192874455_4336" clear="none"><br id="yiv7986446956yui_3_16_0_1_1504192874455_4337" clear="none">    gstData->tee = gst_element_factory_make("tee", "tee");<br id="yiv7986446956yui_3_16_0_1_1504192874455_4338" clear="none">    if (! gstData->tee)<br id="yiv7986446956yui_3_16_0_1_1504192874455_4339" clear="none">    {<br id="yiv7986446956yui_3_16_0_1_1504192874455_4340" clear="none">        printf("Error creating tee.\n");<br id="yiv7986446956yui_3_16_0_1_1504192874455_4341" clear="none">        return false;<br id="yiv7986446956yui_3_16_0_1_1504192874455_4342" clear="none">    }<br id="yiv7986446956yui_3_16_0_1_1504192874455_4343" clear="none"><br id="yiv7986446956yui_3_16_0_1_1504192874455_4344" clear="none">    gstData->vQueue = gst_element_factory_make("queue", NULL);<br id="yiv7986446956yui_3_16_0_1_1504192874455_4345" clear="none">    if (! gstData->vQueue)<br id="yiv7986446956yui_3_16_0_1_1504192874455_4346" clear="none">    {<br id="yiv7986446956yui_3_16_0_1_1504192874455_4347" clear="none">        printf("Error creating video queue.\n");<br id="yiv7986446956yui_3_16_0_1_1504192874455_4348" clear="none">        return false;<br id="yiv7986446956yui_3_16_0_1_1504192874455_4349" clear="none">    }<br id="yiv7986446956yui_3_16_0_1_1504192874455_4350" clear="none"><br id="yiv7986446956yui_3_16_0_1_1504192874455_4351" clear="none">    gstData->iQueue = gst_element_factory_make("queue", NULL);<br id="yiv7986446956yui_3_16_0_1_1504192874455_4352" clear="none">    if (! gstData->iQueue)<br id="yiv7986446956yui_3_16_0_1_1504192874455_4353" clear="none">    {<br id="yiv7986446956yui_3_16_0_1_1504192874455_4354" clear="none">        printf("Error creating image queue.\n");<br id="yiv7986446956yui_3_16_0_1_1504192874455_4355" clear="none">        return false;<br id="yiv7986446956yui_3_16_0_1_1504192874455_4356" clear="none">    }<br id="yiv7986446956yui_3_16_0_1_1504192874455_4357" clear="none"><br id="yiv7986446956yui_3_16_0_1_1504192874455_4358" clear="none">    gstData->decodebin = gst_element_factory_make("decodebin", NULL);<br id="yiv7986446956yui_3_16_0_1_1504192874455_4359" clear="none">    if (! gstData->decodebin)<br id="yiv7986446956yui_3_16_0_1_1504192874455_4360" clear="none">    {<br id="yiv7986446956yui_3_16_0_1_1504192874455_4361" clear="none">        printf("Error creating decodebin.\n");<br id="yiv7986446956yui_3_16_0_1_1504192874455_4362" clear="none">        return false;<br id="yiv7986446956yui_3_16_0_1_1504192874455_4363" clear="none">    }<br id="yiv7986446956yui_3_16_0_1_1504192874455_4364" clear="none"><br id="yiv7986446956yui_3_16_0_1_1504192874455_4365" clear="none">    gstData->pngenc = gst_element_factory_make("pngenc", NULL);<br id="yiv7986446956yui_3_16_0_1_1504192874455_4366" clear="none">    if (! gstData->pngenc)<br id="yiv7986446956yui_3_16_0_1_1504192874455_4367" clear="none">    {<br id="yiv7986446956yui_3_16_0_1_1504192874455_4368" clear="none">        printf("Error creating pngenc.\n");<br id="yiv7986446956yui_3_16_0_1_1504192874455_4369" clear="none">        return false;<br id="yiv7986446956yui_3_16_0_1_1504192874455_4370" clear="none">    }<br id="yiv7986446956yui_3_16_0_1_1504192874455_4371" clear="none"><br id="yiv7986446956yui_3_16_0_1_1504192874455_4372" clear="none">    gstData->iVideoconvert = gst_element_factory_make("videoconvert", NULL);<br id="yiv7986446956yui_3_16_0_1_1504192874455_4373" clear="none">    if (! gstData->iVideoconvert)<br id="yiv7986446956yui_3_16_0_1_1504192874455_4374" clear="none">    {<br id="yiv7986446956yui_3_16_0_1_1504192874455_4375" clear="none">        printf("Error creating iVideoconvert.\n");<br id="yiv7986446956yui_3_16_0_1_1504192874455_4376" clear="none">        return false;<br id="yiv7986446956yui_3_16_0_1_1504192874455_4377" clear="none">    }<br id="yiv7986446956yui_3_16_0_1_1504192874455_4378" clear="none"><br id="yiv7986446956yui_3_16_0_1_1504192874455_4379" clear="none">    gstData->vVideoconvert = gst_element_factory_make("videoconvert", NULL);<br id="yiv7986446956yui_3_16_0_1_1504192874455_4380" clear="none">    if (! gstData->vVideoconvert)<br id="yiv7986446956yui_3_16_0_1_1504192874455_4381" clear="none">    {<br id="yiv7986446956yui_3_16_0_1_1504192874455_4382" clear="none">        printf("Error creating vVideoconvert.\n");<br id="yiv7986446956yui_3_16_0_1_1504192874455_4383" clear="none">        return false;<br id="yiv7986446956yui_3_16_0_1_1504192874455_4384" clear="none">    }<br id="yiv7986446956yui_3_16_0_1_1504192874455_4385" clear="none"><br id="yiv7986446956yui_3_16_0_1_1504192874455_4386" clear="none">    gstData->capsfilter = gst_element_factory_make("capsfilter", NULL);<br id="yiv7986446956yui_3_16_0_1_1504192874455_4387" clear="none">    if (! gstData->capsfilter)<br id="yiv7986446956yui_3_16_0_1_1504192874455_4388" clear="none">    {<br id="yiv7986446956yui_3_16_0_1_1504192874455_4389" clear="none">        printf("Error creating capsfilter.\n");<br id="yiv7986446956yui_3_16_0_1_1504192874455_4390" clear="none">        return false;<br id="yiv7986446956yui_3_16_0_1_1504192874455_4391" clear="none">    }<br id="yiv7986446956yui_3_16_0_1_1504192874455_4392" clear="none"><br id="yiv7986446956yui_3_16_0_1_1504192874455_4393" clear="none">    gstData->v4l2h264enc = gst_element_factory_make("v4l2h264enc", NULL);<br id="yiv7986446956yui_3_16_0_1_1504192874455_4394" clear="none">    if (! gstData->v4l2h264enc)<br id="yiv7986446956yui_3_16_0_1_1504192874455_4395" clear="none">    {<br id="yiv7986446956yui_3_16_0_1_1504192874455_4396" clear="none">        printf("Error creating v4l2h264enc.\n");<br id="yiv7986446956yui_3_16_0_1_1504192874455_4397" clear="none">        return false;<br id="yiv7986446956yui_3_16_0_1_1504192874455_4398" clear="none">    }<br id="yiv7986446956yui_3_16_0_1_1504192874455_4399" clear="none"><br id="yiv7986446956yui_3_16_0_1_1504192874455_4400" clear="none">    gstData->h264parse = gst_element_factory_make("h264parse", NULL);<br id="yiv7986446956yui_3_16_0_1_1504192874455_4401" clear="none">    if (! gstData->h264parse)<br id="yiv7986446956yui_3_16_0_1_1504192874455_4402" clear="none">    {<br id="yiv7986446956yui_3_16_0_1_1504192874455_4403" clear="none">        printf("Error creating h264parse.\n");<br id="yiv7986446956yui_3_16_0_1_1504192874455_4404" clear="none">        return false;<br id="yiv7986446956yui_3_16_0_1_1504192874455_4405" clear="none">    }<br id="yiv7986446956yui_3_16_0_1_1504192874455_4406" clear="none"><br id="yiv7986446956yui_3_16_0_1_1504192874455_4407" clear="none">    gstData->mp4mux = gst_element_factory_make("mp4mux", NULL);<br id="yiv7986446956yui_3_16_0_1_1504192874455_4408" clear="none">    if (! gstData->mp4mux)<br id="yiv7986446956yui_3_16_0_1_1504192874455_4409" clear="none">    {<br id="yiv7986446956yui_3_16_0_1_1504192874455_4410" clear="none">        printf("Error creating mp4mux.\n");<br id="yiv7986446956yui_3_16_0_1_1504192874455_4411" clear="none">        return false;<br id="yiv7986446956yui_3_16_0_1_1504192874455_4412" clear="none">    }<br id="yiv7986446956yui_3_16_0_1_1504192874455_4413" clear="none"><br id="yiv7986446956yui_3_16_0_1_1504192874455_4414" clear="none">    gstData->filesink = gst_element_factory_make("filesink", NULL);<br id="yiv7986446956yui_3_16_0_1_1504192874455_4415" clear="none">    if (! gstData->filesink)<br id="yiv7986446956yui_3_16_0_1_1504192874455_4416" clear="none">    {<br id="yiv7986446956yui_3_16_0_1_1504192874455_4417" clear="none">        printf("Error creating filesink.\n");<br id="yiv7986446956yui_3_16_0_1_1504192874455_4418" clear="none">        return false;<br id="yiv7986446956yui_3_16_0_1_1504192874455_4419" clear="none">    }<br id="yiv7986446956yui_3_16_0_1_1504192874455_4420" clear="none"><br id="yiv7986446956yui_3_16_0_1_1504192874455_4421" clear="none">    gstData->multifilesink = gst_element_factory_make("multifilesink", NULL);<br id="yiv7986446956yui_3_16_0_1_1504192874455_4422" clear="none">    if (! gstData->multifilesink)<br id="yiv7986446956yui_3_16_0_1_1504192874455_4423" clear="none">    {<br id="yiv7986446956yui_3_16_0_1_1504192874455_4424" clear="none">        printf("Error creating multifilesink.\n");<br id="yiv7986446956yui_3_16_0_1_1504192874455_4425" clear="none">        return false;<br id="yiv7986446956yui_3_16_0_1_1504192874455_4426" clear="none">    }<br id="yiv7986446956yui_3_16_0_1_1504192874455_4427" clear="none"><br id="yiv7986446956yui_3_16_0_1_1504192874455_4428" clear="none">    g_object_set(G_OBJECT(gstData->v4l2src), "device", filename, NULL);<br id="yiv7986446956yui_3_16_0_1_1504192874455_4429" clear="none">    g_object_set(G_OBJECT(gstData->filesink), "location", "video.mp4", NULL);<br id="yiv7986446956yui_3_16_0_1_1504192874455_4430" clear="none">    g_object_set(G_OBJECT(gstData->multifilesink), "location", "file%6u.png", NULL);<br id="yiv7986446956yui_3_16_0_1_1504192874455_4431" clear="none"><br id="yiv7986446956yui_3_16_0_1_1504192874455_4432" clear="none">    gstData->caps = gst_caps_from_string(CAPS_STR);<br id="yiv7986446956yui_3_16_0_1_1504192874455_4433" clear="none">    g_object_set(G_OBJECT(gstData->capsfilter), "caps", gstData->caps, NULL);<br id="yiv7986446956yui_3_16_0_1_1504192874455_4434" clear="none"><br id="yiv7986446956yui_3_16_0_1_1504192874455_4435" clear="none">    gst_bin_add_many(GST_BIN(gstData->pipeline), gstData->v4l2src, gstData->tee, gstData->vQueue, gstData->iQueue, gstData->iVideoconvert, gstData->vVideoconvert, gstData->decodebin, gstData->pngenc, gstData->capsfilter, gstData->v4l2h264enc, gstData->h264parse, gstData->mp4mux, gstData->filesink, gstData->multifilesink, NULL);<br id="yiv7986446956yui_3_16_0_1_1504192874455_4436" clear="none"><br id="yiv7986446956yui_3_16_0_1_1504192874455_4437" clear="none">    if(gst_element_link_many(gstData->v4l2src, gstData->vVideoconvert, gstData->capsfilter, gstData->tee, NULL) != true)<br id="yiv7986446956yui_3_16_0_1_1504192874455_4438" clear="none">    {<br id="yiv7986446956yui_3_16_0_1_1504192874455_4439" clear="none">        g_print("Error linking pipeline: v4l2src ! videoconvert ! capsfilter ! tee ...\n");<br id="yiv7986446956yui_3_16_0_1_1504192874455_4440" clear="none">        return false;<br id="yiv7986446956yui_3_16_0_1_1504192874455_4441" clear="none">    }<br id="yiv7986446956yui_3_16_0_1_1504192874455_4442" clear="none"><br id="yiv7986446956yui_3_16_0_1_1504192874455_4443" clear="none">    if(gst_element_link_many(gstData->vQueue, gstData->v4l2h264enc, gstData->h264parse, gstData->mp4mux, gstData->filesink, NULL) != true)<br id="yiv7986446956yui_3_16_0_1_1504192874455_4444" clear="none">    {<br id="yiv7986446956yui_3_16_0_1_1504192874455_4445" clear="none">        g_print("Error linking pipeline: queue ! v4l2h264enc ! h264parse ! mp4mux ! filesink ...\n");<br id="yiv7986446956yui_3_16_0_1_1504192874455_4446" clear="none">        return false;<br id="yiv7986446956yui_3_16_0_1_1504192874455_4447" clear="none">    }<br id="yiv7986446956yui_3_16_0_1_1504192874455_4448" clear="none"><br id="yiv7986446956yui_3_16_0_1_1504192874455_4449" clear="none">    // Program fails here<br id="yiv7986446956yui_3_16_0_1_1504192874455_4450" clear="none">    if(gst_element_link_many(gstData->iQueue, gstData->decodebin, gstData->iVideoconvert, gstData->pngenc, gstData->multifilesink, NULL) != true)<br id="yiv7986446956yui_3_16_0_1_1504192874455_4451" clear="none">    {<br id="yiv7986446956yui_3_16_0_1_1504192874455_4452" clear="none">        g_print("Error linking pipeline: queue ! decodebin ! videoconvert ! pngenc ! multifilesink ...\n");<br id="yiv7986446956yui_3_16_0_1_1504192874455_4453" clear="none">        return false;<br id="yiv7986446956yui_3_16_0_1_1504192874455_4454" clear="none">    }<br id="yiv7986446956yui_3_16_0_1_1504192874455_4455" clear="none"><br id="yiv7986446956yui_3_16_0_1_1504192874455_4456" clear="none">    // manually link pads<br id="yiv7986446956yui_3_16_0_1_1504192874455_4457" clear="none">    gstData->teepadtmplate = gst_element_class_get_pad_template(GST_ELEMENT_GET_CLASS (gstData->tee), "src_%u");<br id="yiv7986446956yui_3_16_0_1_1504192874455_4458" clear="none">    if (! gstData->teepadtmplate)<br id="yiv7986446956yui_3_16_0_1_1504192874455_4459" clear="none">    {<br id="yiv7986446956yui_3_16_0_1_1504192874455_4460" clear="none">        g_print("Error setting tee pad template...\n");<br id="yiv7986446956yui_3_16_0_1_1504192874455_4461" clear="none">        return false;<br id="yiv7986446956yui_3_16_0_1_1504192874455_4462" clear="none">    }<br id="yiv7986446956yui_3_16_0_1_1504192874455_4463" clear="none">    <br id="yiv7986446956yui_3_16_0_1_1504192874455_4464" clear="none">    gstData->teeSrcVPad = gst_element_request_pad(gstData->tee, gstData->teepadtmplate, NULL, NULL);<br id="yiv7986446956yui_3_16_0_1_1504192874455_4465" clear="none">    if(! gstData->teeSrcVPad)<br id="yiv7986446956yui_3_16_0_1_1504192874455_4466" clear="none">    {<br id="yiv7986446956yui_3_16_0_1_1504192874455_4467" clear="none">        g_print("Error setting tee video src pad...\n");<br id="yiv7986446956yui_3_16_0_1_1504192874455_4468" clear="none">        return false;<br id="yiv7986446956yui_3_16_0_1_1504192874455_4469" clear="none">    }<br id="yiv7986446956yui_3_16_0_1_1504192874455_4470" clear="none"><br id="yiv7986446956yui_3_16_0_1_1504192874455_4471" clear="none">    gstData->vQueueSinkPad = gst_element_get_static_pad(gstData->vQueue, "sink");<br id="yiv7986446956yui_3_16_0_1_1504192874455_4472" clear="none">    if(! gstData->vQueueSinkPad)<br id="yiv7986446956yui_3_16_0_1_1504192874455_4473" clear="none">    {<br id="yiv7986446956yui_3_16_0_1_1504192874455_4474" clear="none">        g_print("Error setting tee video sink pad...\n");<br id="yiv7986446956yui_3_16_0_1_1504192874455_4475" clear="none">        return false;<br id="yiv7986446956yui_3_16_0_1_1504192874455_4476" clear="none">    }<br id="yiv7986446956yui_3_16_0_1_1504192874455_4477" clear="none"><br id="yiv7986446956yui_3_16_0_1_1504192874455_4478" clear="none">    gstData->teeSrcIPad = gst_element_request_pad(gstData->tee, gstData->teepadtmplate, NULL, NULL);<br id="yiv7986446956yui_3_16_0_1_1504192874455_4479" clear="none">    if(! gstData->teeSrcIPad)<br id="yiv7986446956yui_3_16_0_1_1504192874455_4480" clear="none">    {<br id="yiv7986446956yui_3_16_0_1_1504192874455_4481" clear="none">        g_print("Error setting tee image src pad...\n");<br id="yiv7986446956yui_3_16_0_1_1504192874455_4482" clear="none">        return false;<br id="yiv7986446956yui_3_16_0_1_1504192874455_4483" clear="none">    }<br id="yiv7986446956yui_3_16_0_1_1504192874455_4484" clear="none">    gstData->iQueueSinkPad = gst_element_get_static_pad (gstData->iQueue, "sink");<br id="yiv7986446956yui_3_16_0_1_1504192874455_4485" clear="none">    if(! gstData->iQueueSinkPad)<br id="yiv7986446956yui_3_16_0_1_1504192874455_4486" clear="none">    {<br id="yiv7986446956yui_3_16_0_1_1504192874455_4487" clear="none">        g_print("Error setting queue image sink pad...\n");<br id="yiv7986446956yui_3_16_0_1_1504192874455_4488" clear="none">        return false;<br id="yiv7986446956yui_3_16_0_1_1504192874455_4489" clear="none">    }<br id="yiv7986446956yui_3_16_0_1_1504192874455_4490" clear="none"><br id="yiv7986446956yui_3_16_0_1_1504192874455_4491" clear="none">    if (gst_pad_link(gstData->teeSrcVPad, gstData->vQueueSinkPad) != GST_PAD_LINK_OK)<br id="yiv7986446956yui_3_16_0_1_1504192874455_4492" clear="none">    {<br id="yiv7986446956yui_3_16_0_1_1504192874455_4493" clear="none">        g_print("Error: cannot connect tee to video queue...\n");<br id="yiv7986446956yui_3_16_0_1_1504192874455_4494" clear="none">        return false;<br id="yiv7986446956yui_3_16_0_1_1504192874455_4495" clear="none">    }<br id="yiv7986446956yui_3_16_0_1_1504192874455_4496" clear="none"><br id="yiv7986446956yui_3_16_0_1_1504192874455_4497" clear="none">    if (gst_pad_link(gstData->teeSrcIPad, gstData->iQueueSinkPad) != GST_PAD_LINK_OK)<br id="yiv7986446956yui_3_16_0_1_1504192874455_4498" clear="none">    {<br id="yiv7986446956yui_3_16_0_1_1504192874455_4499" clear="none">        g_print("Error: cannot connect tee to appsink queue...\n");<br id="yiv7986446956yui_3_16_0_1_1504192874455_4500" clear="none">        return false;<br id="yiv7986446956yui_3_16_0_1_1504192874455_4501" clear="none">    }<br id="yiv7986446956yui_3_16_0_1_1504192874455_4502" clear="none">    <br id="yiv7986446956yui_3_16_0_1_1504192874455_4503" clear="none">    return 0;<br id="yiv7986446956yui_3_16_0_1_1504192874455_4504" clear="none"></b><div dir="ltr" id="yiv7986446956yui_3_16_0_1_1504192874455_4505"><b id="yiv7986446956yui_3_16_0_1_1504192874455_3475">}</b></div><div dir="ltr" id="yiv7986446956yui_3_16_0_1_1504184226553_6562"><div id="yiv7986446956yui_3_16_0_1_1504192874455_3660"><br clear="none"></div><div dir="ltr" id="yiv7986446956yui_3_16_0_1_1504192874455_3693">This code is inspired from the tutorial</div><div dir="ltr" id="yiv7986446956yui_3_16_0_1_1504192874455_3768"><br clear="none"></div><div dir="ltr" id="yiv7986446956yui_3_16_0_1_1504192874455_3769"> <a rel="nofollow" shape="rect" class="yiv7986446956" id="yiv7986446956yui_3_16_0_1_1504192874455_3698" target="_blank" href="https://gstreamer.freedesktop.org/documentation/tutorials/basic/short-cutting-the-pipeline.html">https://gstreamer.freedesktop.org/documentation/tutorials/basic/short-cutting-the-pipeline.html</a><br clear="none"></div><div id="yiv7986446956yui_3_16_0_1_1504192874455_3770"><br clear="none"></div><div id="yiv7986446956yui_3_16_0_1_1504192874455_3690">But I cannot understand why it fails. What's wrong with it ?<br clear="none"></div></div><div dir="ltr" id="yiv7986446956yui_3_16_0_1_1504184226553_10076">Thank you in advance for your help.</div><div dir="ltr" id="yiv7986446956yui_3_16_0_1_1504184226553_10078">Simon<br clear="none"></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div><br clear="none"><br clear="none"></div>  </div> </div>  </div></div></div></div></div><br><br></div>  </div> </div>  </div></div></body></html>