not well linked : avidemux - decodebin - queue

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

not well linked : avidemux - decodebin - queue

rossana
Hi I am trying to play an avi file, for some reasons I don't want to do it with a playbin.
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.

                                decodebin ----- queue ------ audioconvert ---- audioresample ------ autoaudiosink
filescr --- avidemux ---
                                decodebin ----- queue ------ ffmpegcolorspace ----- videoscale ----autovideosink


I tryed to link avidemux - decodebin with on-pad event, and decodebin - queue as well. It didn't work.

I tryed to link avidemux - decodebin with the following code, but it didn't work either.

// demuxer avidemux's name
// decvd a decodebin name for video, decad a decodebin name for audio.

GstPad *targetsrc = gst_element_get_pad(demuxer, "video_%02");

GstPad *targetsrc2 = gst_element_get_pad(demuxer, "audio_%02");

GstPad *padV = gst_element_get_static_pad(decvd,"sink");

GstPad *padA = gst_element_get_static_pad(decad,"sink");

gst_pad_link (targetsrc,padV);
gst_pad_link (targetsrc2,padA);

Any suggestion? Thanks a lot.

Rossana

_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: not well linked : avidemux - decodebin - queue

Nicolai Hess


2012/1/5 Rossana Guerra <[hidden email]>
Hi I am trying to play an avi file, for some reasons I don't want to do it with a playbin.
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.

                                decodebin ----- queue ------ audioconvert ---- audioresample ------ autoaudiosink
filescr --- avidemux ---
                                decodebin ----- queue ------ ffmpegcolorspace ----- videoscale ----autovideosink


I tryed to link avidemux - decodebin with on-pad event, and decodebin - queue as well. It didn't work.

I tryed to link avidemux - decodebin with the following code, but it didn't work either.

// demuxer avidemux's name
// decvd a decodebin name for video, decad a decodebin name for audio.

GstPad *targetsrc = gst_element_get_pad(demuxer, "video_%02");

GstPad *targetsrc2 = gst_element_get_pad(demuxer, "audio_%02");

GstPad *padV = gst_element_get_static_pad(decvd,"sink");

GstPad *padA = gst_element_get_static_pad(decad,"sink");

gst_pad_link (targetsrc,padV);
gst_pad_link (targetsrc2,padA);

Any suggestion? Thanks a lot.

Rossana

_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel


I think this is the same error I wrote about in
your last program. You can not get the srcpads from the
avidemux, as they are dynamic pads.
At this point, the demuxer can not know if there are audio and/or
video streams at all.
You have to create a pad-added callback for the demuxer as well.

nicolai

_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: not well linked : avidemux - decodebin - queue

rossana
Hi Nicolai, actually as I said I already did it and ir didn't work. Here is my original message
"I tryed to link avidemux - decodebin with on-pad event, and decodebin - queue as well. It didn't work."


I post the code:

// pad-event for avidemux
static void on_pad_added (GstElement *element, GstPad *pad, gpointer  data)
{
        g_debug ("Signal: pad-added");
        GstCaps *caps;
        GstStructure *str;

        GstElement *queue = (GstElement*)data;
        caps = gst_pad_get_caps (pad);
        g_assert (caps != NULL);
        str = gst_caps_get_structure (caps, 0);
        g_assert (str != NULL);

        cout << "enlazando enlazara pads" << endl << endl;
        if (g_strrstr (gst_structure_get_name (str), "video")) {
                g_debug ("Linking video pad to dec_vd");
                // Link it actually
                GstPad *targetsink = gst_element_get_pad (queue, "sink");

                //GstCaps *capsV = gst_caps_from_string("video/x-raw-yuv;video/x-raw-rgb");
                //GstPad *targetsink = gst_element_get_compatible_pad(data,pad,capsV);
                cout << "enlazando cola de video" << endl << endl;
                g_assert (targetsink != NULL);
                gst_pad_link (pad, targetsink);
                gst_object_unref (targetsink);
        }

        if (g_strrstr (gst_structure_get_name (str), "audio")) {
                g_debug ("Linking audio pad to dec_ad");
                // Link it actually
                //GstPad *targetsink = gst_element_get_pad (decad, "sink");
                GstPad *targetsink = gst_element_get_pad (queue, "sink");
                cout << "enlazando cola de audio" << endl << endl;
                g_assert (targetsink != NULL);
                gst_pad_link (pad, targetsink);
                gst_object_unref (targetsink);
        }

        gst_caps_unref (caps);
        //gst_caps_unref (capsV);
}

// pad event for decodebin2
static void cb_pad_added (GstElement *element, GstPad *pad, gpointer  data)
{
  GstPad *sinkpad = NULL;
  GstElement * queue = (GstElement *) data;

  /* Ahora linkeo el pad de comp con sink pad */
  g_print ("Dynamic pad created, linking queue\n");
  sinkpad = gst_element_get_static_pad (queue, "sink");

  gst_pad_link (pad, sinkpad);

  gst_object_unref (sinkpad);

}



2012/1/5 Nicolai Hess <[hidden email]>


2012/1/5 Rossana Guerra <[hidden email]>
Hi I am trying to play an avi file, for some reasons I don't want to do it with a playbin.
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.

                                decodebin ----- queue ------ audioconvert ---- audioresample ------ autoaudiosink
filescr --- avidemux ---
                                decodebin ----- queue ------ ffmpegcolorspace ----- videoscale ----autovideosink


I tryed to link avidemux - decodebin with on-pad event, and decodebin - queue as well. It didn't work.

I tryed to link avidemux - decodebin with the following code, but it didn't work either.

// demuxer avidemux's name
// decvd a decodebin name for video, decad a decodebin name for audio.

GstPad *targetsrc = gst_element_get_pad(demuxer, "video_%02");

GstPad *targetsrc2 = gst_element_get_pad(demuxer, "audio_%02");

GstPad *padV = gst_element_get_static_pad(decvd,"sink");

GstPad *padA = gst_element_get_static_pad(decad,"sink");

gst_pad_link (targetsrc,padV);
gst_pad_link (targetsrc2,padA);

Any suggestion? Thanks a lot.

Rossana

_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel


I think this is the same error I wrote about in
your last program. You can not get the srcpads from the
avidemux, as they are dynamic pads.
At this point, the demuxer can not know if there are audio and/or
video streams at all.
You have to create a pad-added callback for the demuxer as well.

nicolai

_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel



_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel