Need some clarifications regarding capsfilter

Yogesh Marwaha yogeshm.007 at gmail.com
Fri Nov 2 09:06:33 PDT 2012


Hi,

I'm using a bin (in the format- visualisation_element ! videoscale ! 
videoconvert ! capsfilter) to set visualisation in playbin - Purpose is to 
enforce a particular window size (atm i'm settings caps like - 
gst_caps_new_simple ("video/x-raw", "width", G_TYPE_INT, 640, "height", 
G_TYPE_INT, 480, NULL))

The problem is that when I switch to "monoscope" visualisation, gstreamer 
flags "General stream error". I see the following in the output: -
baseparse gstbaseparse.c:3008:gst_base_parse_loop:<mpegaudioparse0> 
error: streaming stopped, reason not-negotiated

Though if "monoscope" visualisation is set before starting the playback and 
video sink is xvimagesink, everything goes fine.

What I may be doing wrong? Relevant section of code (just 18 lines) is 
attached. I'm on gsteramer 1.0 (I've just ported my app from gstreamer 0.10). 


Regards,

Yogesh M
-------------- next part --------------
    GstElement *newVisualisationElement = gst_element_factory_make(visualisation.toLocal8Bit(), "visualisation");
    GstElement *newCapsfilterElement = gst_element_factory_make("capsfilter", "visualisation-capsfilter");
    GstCaps *caps = gst_caps_new_simple ("video/x-raw",
                                         "width", G_TYPE_INT, 640,
                                         "height", G_TYPE_INT, 480,
                                         NULL);
    g_object_set(G_OBJECT(newCapsfilterElement), "caps", caps, NULL);

    GstElement *newVideoconvertElement = gst_element_factory_make("videoconvert", "visualisation-videoconvert");
    GstElement *newVideoscaleElement = gst_element_factory_make("videoscale", "visualisation-videoscale");
    if(newVisualisationElement){
        m_pVisualisationBin = gst_bin_new("visualisation-bin");
        gst_bin_add_many(GST_BIN(m_pVisualisationBin), newVisualisationElement, newVideoscaleElement, newVideoconvertElement, newCapsfilterElement, NULL);
        gst_element_link_many(newVisualisationElement, newVideoscaleElement, newVideoconvertElement, newCapsfilterElement, NULL);
        gst_element_add_pad(m_pVisualisationBin, gst_ghost_pad_new("sink", gst_element_get_static_pad(newVisualisationElement, "sink")));
        gst_element_add_pad(m_pVisualisationBin, gst_ghost_pad_new("src", gst_element_get_static_pad(newCapsfilterElement, "src")));

        g_object_set(G_OBJECT(m_pPlayBin), "vis-plugin", m_pVisualisationBin, NULL);


More information about the gstreamer-devel mailing list