<br><br><div class="gmail_quote">2012/1/3 Rossana Guerra <span dir="ltr">&lt;<a href="mailto:guerra.rossana@gmail.com">guerra.rossana@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Actually I use the &quot;pad-added&quot; event it was posted in the thread :) but for sure, I did it wrong since I get  the &quot;caps are incompatible&quot; message.<br>thanks!<br><br><div class="gmail_quote">2012/1/3 Nathanael D. Noblet <span dir="ltr">&lt;<a href="mailto:nathanael@gnat.ca" target="_blank">nathanael@gnat.ca</a>&gt;</span><div>
<div class="h5"><br>

<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>On 01/03/2012 11:21 AM, Rossana Guerra wrote:<br>
<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
I need to point out that using the gstparse it works. It fails when I<br>
try to create the pipeline by myself.<br>
</blockquote>
<br></div>
Hello,<br>
<br>
  I haven&#39;t read this thread, however it seems that more often than not when going from a gst-launch command to code to create a pipeline the most common mistake is to try linking a decoder to the rest of the pipeline. The issue here is that prior to the decoder getting some data, it doesn&#39;t know how many streams it contains (a file could have multiple audio streams for one video for example). So you have to use the &#39;pad-added&#39; signals to dynamically link things once everything is ready. If you google for the gstreamer hello world example it has an example of doing just that. Hopefully that helps if this is the issue, otherwise feel free to disregard this message...<span><font color="#888888"><br>



<br>
-- <br>
Nathanael d. Noblet<br>
t <a href="tel:403.875.4613" value="+14038754613" target="_blank">403.875.4613</a></font></span><div><div><br>
______________________________<u></u>_________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.freedesktop.org" target="_blank">gstreamer-devel@lists.<u></u>freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" target="_blank">http://lists.freedesktop.org/<u></u>mailman/listinfo/gstreamer-<u></u>devel</a><br>
</div></div></blockquote></div></div></div><br>
<br>_______________________________________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>
<br></blockquote></div><br>Hi Rossana,<br>I think you need an additional pad-added callback for your avidemux element.<br>I don&#39;t get the &quot;incompatible pad&quot; error message, but instead the <br>targetsrc and targetsrc2 pads from<br>
 GstPad *targetsrc = gst_element_get_pad(demuxer, &quot;video_%02&quot;);<br>GstPad *targetsrc2 = gst_element_get_pad(demuxer, &quot;audio_%02&quot;);<br>are NULL, because the demuxer srcpads are &quot;sometimes&quot; pads and<br>
not available at this point.<br>So, add another on_pad_added callback and link your<br>video and audio decodebin there, depending on the type of the pad added.<br><br><br>Something like this:<br><br>// register the callback<br>
g_signal_connect (demuxer, &quot;pad-added&quot;, G_CALLBACK (on_demuxer_pad_added), pipeline);<br><br>// the  demuxer &quot;pad-added&quot; callback<br>void on_demuxer_pad_added (GstElement *demuxer, GstPad *pad, GstElement *pipeline)<br>
{<br>  char* pad_name = gst_pad_get_name(pad);<br>  if(g_strrstr(pad_name, &quot;video_00&quot;))<br>  {<br>    GstElement* decvd = gst_bin_get_by_name(GST_BIN(pipeline), &quot;decvd&quot;);<br>    GstPad *padV = gst_element_get_static_pad(decvd,&quot;sink&quot;);    <br>
    gst_pad_link(pad,padV);<br>    gst_object_unref(decvd);<br>  }<br>  else if(g_strrstr(pad_name, &quot;audio_00&quot;))<br>  {<br>    GstElement* decad = gst_bin_get_by_name(GST_BIN(pipeline), &quot;decad&quot;);<br>    GstPad *padA = gst_element_get_static_pad(decad,&quot;sink&quot;);    <br>
    gst_pad_link(pad,padA);<br>    gst_object_unref(decad);<br>  }<br>  g_free(pad_name);<br>}<br>