This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Linux/AM5728: GStreamer application error

Part Number: AM5728

Tool/software: Linux

hi,

we are developing application for receiving ethernet stream of RTP video data and storing in a file.the below pipeline is used for the receiving which is working fine on shell.

gst-launch-1.0 udpsrc port=500 ! 'application/x-rtp,media=video,payload=97,clock-rate=90000,encoding-name=MP2T' ! rtpmp2tdepay ! filesink location=/home/root/video.mp4.

When the same is  implemented in c file we are getting the following error:

gst_capsfilter_prepare_buf: assertion 'out_caps ! =NULL' failed

the capsfilter section of c code is

g_object_set (G_OBJECT (filter1), "caps", gst_caps_new_simple("application/x-rtp","media", G_TYPE_STRING, "video","payload", G_TYPE_INT,33,"clock-rate", G_TYPE_INT,90000,NULL), NULL);

 


can any body help us?

BR

Marka reddy

 

  • Hello,

    Here is example of how capsfilter could be set in gst app. In this example the caps filter is between v4l2src and videoconvert.




    static gboolean link_source_element_with_filter (GstElement *element1,
    GstElement *element2)

    {
    /* CAPS to be link:
    * 'video/x-raw, format=(string)YUY2, width=(int)800, height=(int)600, framerate=5/1'
    * */

    gboolean link_ok;
    GstCaps *caps;

    caps = gst_caps_new_simple ("video/x-raw",
    "format", G_TYPE_STRING, "NV12",
    "width", G_TYPE_INT, 800,
    "height", G_TYPE_INT, 600,
    "framerate", GST_TYPE_FRACTION, 5, 1,
    NULL);

    link_ok = gst_element_link_filtered (element1, element2, caps);
    gst_caps_unref (caps);

    if (!link_ok) {
    g_warning ("Failed to link element1 and element2!(v4l2src->convert)");
    }
    return link_ok;


    .......


    int main ()
    {

    //create elements
    ....
    //set priperties
    ....
    //add the elements to the bin
    ...
    //link element (this includes elements with filter)



    link_source_element_with_filter (src, convert);



    //move to playing etc ...

    }

    BR
    Margarita
  • Hi,
    We have implemented as per the given example

    as link_source_element_with_filter (src, rtpdepay);

    we are getting the warning as Failed to link element1 and element2
    I think link_ok variable from gst_element_link_filtered is updating with false

    what may be the possible reason?

    BR
    Marka reddy
  • Hello,

    Could you provide debugging log, capsfilter function and part of the code where you link the elements.

    BR
    Margarita
  • In additional, I assume that probably one or more of the params in capfilter are not set correctly. This is why you are observing the error the elements are not link. You could recheck the types of these params.
    But would be better if you share the debugging log etc(check previous answer).

    Let me know.

    BR
    Margarita

  • Hi,
    Thank u very much for your inputs.
    While debugging we found out that in gst_element_factory_make function "rtpmp2depay" given by typing error instead of "rtpmp2tdepay". we corrected the code. it is working now.
    BR
    Marka reddy
  • Hello,

    I am glad that this issue is solved.
    I am closing this thread.

    BR
    Margarita