Hi Nicolai, actually as I said I already did it and ir didn't work. Here is my original message<br>"I tryed to link avidemux - decodebin with on-pad event, and decodebin - queue as well. It didn't work."<br>
<br><br>I post the code:<br><br>// pad-event for avidemux<br>static void on_pad_added (GstElement *element, GstPad *pad, gpointer data)<br>{<br> g_debug ("Signal: pad-added");<br> GstCaps *caps;<br>
GstStructure *str;<br><br> GstElement *queue = (GstElement*)data;<br> caps = gst_pad_get_caps (pad);<br> g_assert (caps != NULL);<br> str = gst_caps_get_structure (caps, 0);<br> g_assert (str != NULL);<br>
<br> cout << "enlazando enlazara pads" << endl << endl;<br> if (g_strrstr (gst_structure_get_name (str), "video")) {<br> g_debug ("Linking video pad to dec_vd");<br>
// Link it actually<br> GstPad *targetsink = gst_element_get_pad (queue, "sink");<br><br> //GstCaps *capsV = gst_caps_from_string("video/x-raw-yuv;video/x-raw-rgb");<br>
//GstPad *targetsink = gst_element_get_compatible_pad(data,pad,capsV);<br> cout << "enlazando cola de video" << endl << endl;<br> g_assert (targetsink != NULL);<br>
gst_pad_link (pad, targetsink);<br> gst_object_unref (targetsink);<br> }<br><br> if (g_strrstr (gst_structure_get_name (str), "audio")) {<br> g_debug ("Linking audio pad to dec_ad");<br>
// Link it actually<br> //GstPad *targetsink = gst_element_get_pad (decad, "sink");<br> GstPad *targetsink = gst_element_get_pad (queue, "sink");<br> cout << "enlazando cola de audio" << endl << endl;<br>
g_assert (targetsink != NULL);<br> gst_pad_link (pad, targetsink);<br> gst_object_unref (targetsink);<br> }<br><br> gst_caps_unref (caps);<br> //gst_caps_unref (capsV);<br>
}<br><br>// pad event for decodebin2<br>static void cb_pad_added (GstElement *element, GstPad *pad, gpointer data)<br>{<br> GstPad *sinkpad = NULL;<br> GstElement * queue = (GstElement *) data;<br><br> /* Ahora linkeo el pad de comp con sink pad */<br>
g_print ("Dynamic pad created, linking queue\n");<br> sinkpad = gst_element_get_static_pad (queue, "sink");<br><br> gst_pad_link (pad, sinkpad);<br><br> gst_object_unref (sinkpad);<br><br>}<br><br>
<br><br><div class="gmail_quote">2012/1/5 Nicolai Hess <span dir="ltr"><<a href="mailto:nicolaihess@web.de">nicolaihess@web.de</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br><br><div class="gmail_quote">2012/1/5 Rossana Guerra <span dir="ltr"><<a href="mailto:guerra.rossana@gmail.com" target="_blank">guerra.rossana@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div><div class="h5">
Hi I am trying to play an avi file, for some reasons I don't want to do it with a playbin.<br>The fact is I had an avidemux and a mad decoder but not every avi file can play. Then I replaced it for the following pipeline, to get the most codecs.<br>
<br> decodebin ----- queue ------ audioconvert ---- audioresample ------ autoaudiosink<br>filescr --- avidemux ---<br> decodebin ----- queue ------ ffmpegcolorspace ----- videoscale ----autovideosink<br>
<br><br>I tryed to link avidemux - decodebin with on-pad event, and decodebin - queue as well. It didn't work.<br><br>I tryed to link avidemux - decodebin with the following code, but it didn't work either.<br><br>
// demuxer avidemux's name<br>// decvd a decodebin name for video, decad a decodebin name for audio.<br><br>GstPad *targetsrc = gst_element_get_pad(demuxer, "video_%02");<br><br>GstPad *targetsrc2 = gst_element_get_pad(demuxer, "audio_%02");<br>
<br>GstPad *padV = gst_element_get_static_pad(decvd,"sink");<br><br>GstPad *padA = gst_element_get_static_pad(decad,"sink");<br><br>gst_pad_link (targetsrc,padV);<br>gst_pad_link (targetsrc2,padA);<br>
<br>Any suggestion? Thanks a lot.<span><font color="#888888"><br><br>Rossana<br>
</font></span><br></div></div>_______________________________________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.freedesktop.org" target="_blank">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>I think this is the same error I wrote about in <br>your last program. You can not get the srcpads from the<br>avidemux, as they are dynamic pads.<br>At this point, the demuxer can not know if there are audio and/or<br>
video streams at all. <br>You have to create a pad-added callback for the demuxer as well.<span class="HOEnZb"><font color="#888888"><br><br>nicolai<br>
</font></span><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>