Hi Nicolai, does the crossfade work?. <br>Actually this is the syntax of the command (from console)<br><br>./crossfade file:///video1.avi file:///video2.avi<br><br>crossfade : name of the programm<br><br>I intended the uri format in several ways (according to URI specification), though noneone works, the same error. &quot;Resource not found&quot;,<br>
<br>file:///video1.avi<br>file://video1.avi <br>file:/video1.avi<br><br>In the last 2 format the message says, resource for reading not found.<br><br>Thanks for your help<br><br>Rossana<br><br><br><div class="gmail_quote">
2011/9/7 Nicolai Hess <span dir="ltr">&lt;<a href="mailto:nicolaihess@web.de">nicolaihess@web.de</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi Rossane,<br>
your code is working for me.<br>Remember to use an URI for your input file arguments, example:<br><br>nameofyourprogram file://&lt;path_to_file1&gt; file://&lt;path_to_file2&gt;<div><div></div><div class="h5"><br><div class="gmail_quote">

2011/9/7 Rossana Guerra <span dir="ltr">&lt;<a href="mailto:guerra.rossana@gmail.com" target="_blank">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">

Hi Angel, the path is correct. In fact I use the same path to another example.<br>Can you please tell me what kind of bug is? I can&#39;t realize.<br>Thanks for your response<div><div></div><div><br><br><div class="gmail_quote">

2011/9/7 Angel Martin <span dir="ltr">&lt;<a href="mailto:amartin@vicomtech.org" target="_blank">amartin@vicomtech.org</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">Dear Rossana,<br><br>I think that this kind of error message is obtained when the video resource is not found so check the file path to the files and be sure that the paths are right in the location assignment of each gnlfilesource.<br>



<br>Moreover, You have a bug in the getAndSetController concerning the duration of the transition:<br><br>g_value_set_double (&amp;val_double, 1.0);<br> gst_interpolation_control_source_set(csource,(duracion * GST_MSECOND),&amp;val_double);<br>



<br>Best,<br><br>Angel<br><br><div class="gmail_quote"><div><div></div><div>2011/9/7 Rossana Guerra <span dir="ltr">&lt;<a href="mailto:guerra.rossana@gmail.com" target="_blank">guerra.rossana@gmail.com</a>&gt;</span><br>


</div></div><blockquote class="gmail_quote" style="border-left:1px solid rgb(204, 204, 204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex"><div><div></div><div>
Hi all, I am totally new with GSteamer, so sorry for the lots of mistakes I have. I am trying to do the example of this link in C/C++ <a href="http://notes.brooks.nu/gstreamer-video-crossfade-example/" target="_blank">http://notes.brooks.nu/gstreamer-video-crossfade-example/</a><br>




It&#39;s about crossfade. I doing it with .AVI files.<br><br>At runtime I got the Resource not found error. Another  examples, like a playbin, work properly with .AVI&#39;s, so I don&#39;t think is a codec issue.<br>The video files are passing as arguments (uri format).<br>




<br>Thanks in advance.<br><br>/////////////////////////<br>Heres the code<br><br><br>#include &lt;gst.h&gt;<br>#include &lt;controller/gstcontroller.h&gt;<br><br>#include &lt;iostream&gt;<br><br>using namespace std;<br><br>




// Error handler<br>static gboolean bus_call (GstBus *bus, GstMessage *msg, gpointer data)<br>{<br>    GMainLoop *loop = (GMainLoop *) data;<br><br>    switch (GST_MESSAGE_TYPE (msg))<br>    {<br>    case GST_MESSAGE_EOS:<br>




        g_print (&quot;Final de stream\n&quot;);<br>        g_main_loop_quit (loop);<br>        break;<br>    case GST_MESSAGE_ERROR:<br>    {<br>        gchar *debug;<br>        GError *error;<br>        gst_message_parse_error (msg, &amp;error, &amp;debug);<br>




        g_free (debug);<br>        g_printerr (&quot;Error: %s\n&quot;, error-&gt;message);<br>        g_error_free (error);<br>        g_main_loop_quit (loop);<br>        break;<br>    }<br>    default:<br>        break;<br>




    }<br>    return TRUE;<br>}<br><br>static void on_pad_added (GstElement *element, GstPad *pad, gpointer  data)<br>{<br>  GstPad *sinkpad;<br>  GstElement * queue = (GstElement *) data;<br><br>  /* We can now link this pad with the vorbis-decoder sink pad */<br>




  g_print (&quot;Dynamic pad created, linking demuxer/decoder\n&quot;);<br>  sinkpad = gst_element_get_static_pad (queue, &quot;sink&quot;);<br><br>  gst_pad_link (pad, sinkpad);<br><br>  gst_object_unref (sinkpad);<br>}<br>




<br>GstElement * getBin(const gchar * nomBin, GstElement * &amp;alfa1, GstElement *&amp;alfa2, GstElement * &amp;color)<br>{<br><br>  GstElement * bin = gst_bin_new(nomBin);<br><br>  if (!bin)<br>  {<br>      g_printerr (&quot;No se pudo crear el bin. Saliendo\n&quot;);<br>




     return NULL;<br>  }<br><br>  alfa1   = gst_element_factory_make (&quot;alpha&quot;,&quot;alfa1&quot;);<br>  alfa2  = gst_element_factory_make (&quot;alpha&quot;,&quot;alfa2&quot;);<br>  color  = gst_element_factory_make (&quot;ffmpegcolorspace&quot;, &quot;color&quot;);<br>




  GstElement * mixer  = gst_element_factory_make(&quot;videomixer&quot;, &quot;mixer&quot;);<br><br>  if ((!alfa1) || (!alfa2) || (!color) || (!mixer))<br>  {<br>      g_printerr (&quot;Alguno de los elementos del Bin no pudo ser creado. Saliendo\n&quot;);<br>




     return NULL;<br>  }<br><br>  // Anexamos al bin<br>  gst_bin_add_many(GST_BIN (bin),alfa1,alfa2,mixer,color,NULL);<br><br>  // Enlazamos elementos<br>  gst_element_link (alfa1, mixer);<br>  gst_element_link (alfa2, mixer);<br>




  gst_element_link (mixer,color);<br><br>  return bin;<br>}<br><br>void getAndSetController(GstElement * alfa2, gdouble duracion)<br>{<br>    GstController * ctrl = NULL;<br>    if (!(ctrl = gst_controller_new (G_OBJECT (alfa2), &quot;alpha&quot;,NULL))) {<br>




        GST_WARNING (&quot;No puede controlar el elemento fuente\n&quot;);<br>        return;<br>  }<br><br>  // Todo valor GValue debe inicializarse en 0<br>  GValue val_double = { 0, };<br>  g_value_init (&amp;val_double, G_TYPE_DOUBLE);<br>




<br><br>  // Seteo los valores de control del alfa2<br><br>  GstInterpolationControlSource * csource = gst_interpolation_control_source_new();<br><br>  gst_controller_set_control_source (ctrl, &quot;alpha&quot;, GST_CONTROL_SOURCE (csource));<br>




<br>  gst_interpolation_control_source_set_interpolation_mode(csource,GST_INTERPOLATE_LINEAR);<br><br><br>  g_value_set_double(&amp;val_double, 0.0);<br>  gst_interpolation_control_source_set(csource,(0* GST_MSECOND),&amp;val_double); <br>




<br>  g_value_set_double (&amp;val_double, duracion);<br>  gst_interpolation_control_source_set(csource,(1 * GST_MSECOND),&amp;val_double);<br><br><br>  g_object_unref (csource);<br><br>}<br><br>void addGhostPadsToBin(GstElement *alfa1, GstElement * alfa2, GstElement * color, GstElement* bin)<br>




{<br>    /* add ghostpad */<br>  GstPad * pad1 = gst_element_get_static_pad (alfa1, &quot;sink&quot;);<br>  gst_element_add_pad(bin, gst_ghost_pad_new(&quot;alfasink1&quot;, pad1));<br>  gst_object_unref (GST_OBJECT (pad1));<br>




<br>  GstPad * pad2 = gst_element_get_static_pad (alfa2, &quot;sink&quot;);<br>  gst_element_add_pad(bin, gst_ghost_pad_new(&quot;alfasink2&quot;, pad2));<br>  gst_object_unref(GST_OBJECT(pad2));<br><br>  GstPad * pad3 = gst_element_get_static_pad (color, &quot;src&quot;);<br>




  gst_element_add_pad(bin, gst_ghost_pad_new(&quot;colorsrc&quot;, pad3));<br>  gst_object_unref(GST_OBJECT(pad3));<br> <br><br>}<br><br>void crossFade(gdouble duracion, GstElement * &amp; bin)<br>{<br>    // devuelve el bin<br>




    GstElement * alfa1, *alfa2, *color;<br>    alfa1 = 0;<br>    alfa2 = 0;<br>    color = 0;<br><br>    bin = getBin(&quot;bin&quot;,alfa1, alfa2,color);  // Crea el bin y los elementos<br><br>    getAndSetController(alfa2,duracion);<br>




<br>    addGhostPadsToBin(alfa1, alfa2, color, bin);<br>    <br><br>}<br><br>GstElement * getSetPipeline(gchar *argv[])<br>{<br>    gint dur1 = 9000; // duration (in ms) to play of first clip<br>    gint dur2 = 8000; // duration (in ms) to play of second clip<br>




    gint dur_crossfade = 500; //number of milliseconds to crossfade for<br>    GstElement *comp = 0;<br>    GstElement *pipeline, *video1, *video2, *op, *bin, *queue, *sink;<br><br>     //we play two clips serially with a crossfade between them<br>




     // using the gnonlin gnlcomposition element.<br>    if ((comp = gst_element_factory_make(&quot;gnlcomposition&quot;, &quot;mycomposition&quot;)) == NULL)<br>    {<br>      printf (&quot;\n Fallo al crear gnlcomposition \n&quot;);<br>




      return NULL;<br>    }<br><br>    // setup first clip<br><br>    if ((video1 = gst_element_factory_make(&quot;gnlfilesource&quot;, &quot;video1&quot;)) == NULL)<br>    {<br>      printf (&quot;\n Falló la creacion del gnlfilesource \n&quot;);<br>




      return NULL;<br>    }<br>    if (gst_bin_add (GST_BIN (comp), video1) == FALSE)<br>    {<br>      printf (&quot;\n No pudo agregar video1 a comp \n&quot;);<br>      return NULL;<br>    }<br><br>    g_object_set (video1, &quot;location&quot;, argv[1], NULL);<br>




    g_object_set (video1, &quot;start&quot;, 0 * GST_MSECOND, NULL);<br>    g_object_set (video1, &quot;duration&quot;, dur1 * GST_MSECOND, NULL);<br>    g_object_set (video1, &quot;media-start&quot;, 0* GST_MSECOND, NULL);<br>




    g_object_set (video1, &quot;media-duration&quot;, dur1 * GST_MSECOND, NULL);<br>    g_object_set (video1, &quot;priority&quot;, 1,NULL);<br><br>    if ((video2 = gst_element_factory_make(&quot;gnlfilesource&quot;, &quot;video2&quot;)) == NULL)<br>




    {<br>      printf (&quot;\n Falló la creacion del gnlfilesource \n&quot;);<br>      return NULL;<br>    }<br>    if (gst_bin_add (GST_BIN (comp), video2) == FALSE)<br>    {<br>      printf (&quot;\n No pudo agregar video2 a comp \n&quot;);<br>




      return NULL;<br>    }<br><br>    // setup second clip<br>    g_object_set (video2, &quot;location&quot;, argv[2], NULL);<br>    g_object_set (video2, &quot;start&quot;, (dur1-dur_crossfade) * GST_MSECOND, NULL);<br>




    g_object_set (video2, &quot;duration&quot;, dur2 * GST_MSECOND, NULL);<br>    g_object_set (video2, &quot;media-start&quot;, 0 * GST_MSECOND, NULL);<br>    g_object_set (video2, &quot;media-duration&quot;, dur2 * GST_MSECOND, NULL);<br>




    g_object_set (video2, &quot;priority&quot;, 2,NULL);<br><br>    // setup the crossfade<br>    op = gst_element_factory_make(&quot;gnloperation&quot;, &quot;op&quot;);<br><br>    crossFade(dur_crossfade, bin);<br><br>



    if (gst_bin_add (GST_BIN (op), bin) == FALSE)<br>
    {<br>      printf (&quot;\n No pudo agregar el bin a la gnloperacion op \n&quot;);<br>      return NULL;<br>    }<br><br>    g_object_set (op,&quot;start&quot;, (dur1-dur_crossfade) * GST_MSECOND,NULL);<br>    g_object_set (op,&quot;duration&quot;, dur_crossfade *  GST_MSECOND,NULL);<br>




    g_object_set (op,&quot;media-start&quot;, 0 *  GST_MSECOND,NULL);<br>    g_object_set(op,&quot;media-duration&quot;, dur_crossfade * GST_MSECOND,NULL);<br>    g_object_set(op,&quot;priority&quot;,0,NULL);<br><br>    if (gst_bin_add (GST_BIN (comp), op) == FALSE)<br>




    {<br>      printf (&quot;\n No pudo agregar la gnloperacion a la gnlcomposition \n&quot;);<br>      return NULL;<br>    }<br><br>    // setup the backend viewer<br>    queue = gst_element_factory_make(&quot;queue&quot;, &quot;queue&quot;);<br>




    sink  = gst_element_factory_make(&quot;autovideosink&quot;, &quot;sink&quot;);<br><br>    pipeline = gst_pipeline_new (&quot;video-player&quot;);<br><br><br>    /* Agrego elementos al pipeline */<br><br>    gst_bin_add_many (GST_BIN (pipeline),comp, queue, sink, NULL);<br>




<br>    g_signal_connect (comp, &quot;pad-added&quot;, G_CALLBACK (on_pad_added), queue);<br><br>    gst_element_link (queue, sink);<br><br>    cout &lt;&lt; &quot;creó pipeline!!!&quot; &lt;&lt; endl;<br><br>    return pipeline;<br>




<br>}<br><br>void startPlay(GstElement * pip)<br>{<br>    /* Set the pipeline to &quot;playing&quot; state*/<br>  cout &lt;&lt; &quot;antes del PLAY&quot; &lt;&lt; endl;<br>  gst_element_set_state (pip, GST_STATE_PLAYING);<br>




  cout &lt;&lt; &quot;dp del PLAY&quot; &lt;&lt; endl;<br><br>}<br><br><br>int main(gint argc, gchar *argv[])<br>{<br>    GMainLoop *loop = NULL;<br><br>    /* init GStreamer */<br>    gst_init (&amp;argc, &amp;argv);<br>




    gst_controller_init (&amp;argc, &amp;argv);<br><br><br>    loop = g_main_loop_new (NULL, FALSE);<br><br>    /* make sure we have a URI */<br>    if (argc != 3)<br>    {<br>        g_print (&quot;Uso: %s &lt;URI1&gt;  &lt;URI2&gt;\n&quot;, argv[0]);<br>




        return -1;<br>    }<br><br>    GstElement * play = getSetPipeline(argv);<br><br>    cout &lt;&lt; &quot;creo pipeline&quot; &lt;&lt; endl;<br><br>    GstBus *bus2 = gst_pipeline_get_bus (GST_PIPELINE (play));<br>



    gst_bus_add_watch (bus2, bus_call, loop);<br>
    gst_object_unref (bus2);<br><br>    cout &lt;&lt; &quot;start play&quot; &lt;&lt; endl;<br><br>    startPlay(play);<br><br>    /* now run */<br>    g_main_loop_run (loop);<br><br>    /* also clean up */<br>    gst_element_set_state (play, GST_STATE_NULL);<br>




    gst_object_unref (GST_OBJECT (play));<br>    return 0;<br>}<br><br><br><br>
<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><br clear="all"><br>-- <br><pre>Ángel Martín Navas<br>Investigador / Researcher<br>Televisión Digital y Servicios Multimedia / Digital TV &amp; Multimedia Services<br><br>Vicomtech - Visual Interaction Communication Technologies<br>



Mikeletegi Pasealekua, 57 - Parque Tecnológico<br>20009 Donostia - San Sebastián - Spain<br>Tel: <a href="tel:%2B%5B34%5D%20943%2030%2092%2030" value="+34943309230" target="_blank">+[34] 943 30 92 30</a><br>Fax: <a href="tel:%2B%5B34%5D%20943%2030%2093%2093" value="+34943309393" target="_blank">+[34] 943 30 93 93</a><br>


e-mail: <a href="mailto:amartin@vicomtech.org" target="_blank">amartin@vicomtech.org</a><br>
<a href="http://www.vicomtech.org" target="_blank">www.vicomtech.org</a><br><br>*** member of IK4 Research Alliance ****<br><a href="http://www.ik4.es/" target="_blank">www.ik4.es</a><br>*** member of GraphicsMedia.net ****<br>



<a href="http://www.graphicsmedia.net" target="_blank">www.graphicsmedia.net</a><br><br><br><br>-----------------------------------------------------<br>Vicomtech is an ISO 9001:2000 certified institute<br>-----------------------------------------------------<br>



<br>Este mensaje se dirige exclusivamente a su destinatario. <br>La información incluida en el presente correo es confidencial sometida a <br>secreto profesional, especialmente en lo que respecta a los datos de <br>carácter personal, cuya divulgación está prohibida, en virtud de la <br>



legislación vigente. Si usted no es el destinatario legítimo y lo ha <br>recibido por error o tiene conocimiento del mismo por cualquier motivo, <br>le rogamos que nos lo comunique por este medio y proceda a destruirlo o <br>



borrarlo. En todo caso abstengase de utilizar, reproducir, alterar, <br>archivar o comunicar a terceros el presente mensaje así como los ficheros <br>anexos, todo ello bajo pena de incurrir en responsabilidades legales. <br>



Cualquier opinión contenida en este correo es exclusiva de su autor y no <br>representa necesariamente la opinión de ASOCIACIÓN CENTRO DE TECNOLOGÍAS <br>DE INTERACCIÓN VISUAL Y COMUNICACIONES VICOMTECH (en adelante Vicomtech-IK4) <br>



El emisor no garantiza la integridad, rapidez o seguridad del presente correo, <br>ni se responsabiliza de posibles perjuicios derivados de la captura, <br>incorporaciones de virus o cualesquiera otras manipulaciones efectuadas por terceros.<br>



Con motivo de la entrada en vigor de la Ley 34/2002, de 11 de julio, de <br>Servicios de la Sociedad de la Información y de Comercio Electrónico, le <br>informamos que pueden revocar en cualquier momento, de forma sencilla y gratuita, <br>



el consentimiento para la recepción de mensajes de <a href="http://vicomtech.org" target="_blank">vicomtech.org</a> en <a href="mailto:info.lopd@vicomtech.org" target="_blank">info.lopd@vicomtech.org</a>.<br></pre><br>
<br>_______________________________________________<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>
</div></div><br>_______________________________________________<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>
</div></div><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>