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 development

Part Number: AM5728

Tool/software: Linux

Hi,

My pipeline is

gst-launch-1.0 -e v4l2src device=/dev/video1 ! 'video/x-raw, format=(string)YUY2, width=(int)640, height=(int)720, framerate=10/1' ! ducatijpegdec ! tee name=t ! queue ! videocrop left = 2016 right=1008 ! videoscale ! video/x-raw , format=NV12 , height=240 , width=320 ! videoconvert ! video/x-raw , format=Y444 ! plugin1 ! fakesink t. ! queue min-threshold-buffers=2 ! ducatih264enc hrd-buffer-size=4064256 rate-preset=1 ! plugin2 ! fakesink


This pipeline works fine. I am going to make application based on this pipeline but it gives segmentation fault while adding elements.

#include <stdio.h>
#include <gst/gst.h>


/* BUS function for ERROR */

static gboolean bus_call(GstBus *bus, GstMessage *msg, gpointer data)
{
    GMainLoop *loop = (GMainLoop *) data;
    switch (GST_MESSAGE_TYPE (msg)) 
    {
        case GST_MESSAGE_EOS:
            g_print ("End of stream\n");
            g_main_loop_quit (loop);
            break;
 
        case GST_MESSAGE_ERROR: 
        {
            gchar  *debug;
            GError *error;
            gst_message_parse_error (msg, &error, &debug);
            g_free (debug);
            g_printerr ("Error: %s\n", error->message);
            g_error_free (error);
            g_main_loop_quit (loop);
            break;
        }

        default:
        break;
    }
 
    return TRUE;
 }

/* Main function does atual processing */

int main (int argc , char *argv[])
{
    GstElement *pipeline, *video_source, *filter_source, *ducatijpegdec, *tee, *rtsp_queue, *ducatih264enc, *plugin2, *rtsp_sink;    
    GstElement *ovready_queue, *video_crop, *video_scale, *filter_scale, *video_convert, *filter_convert, *plugin1, *ovready_sink; 
    GstBus *bus;
    GstMessage *msg;
    GstPadTemplate *tee_src_pad_template;
    GstPad *tee_rtsp_pad, *tee_ovready_pad;
    GstPad *queue_rtsp_pad, *queue_ovready_pad;
    GstCaps *source_caps, *convert_caps, *scale_caps;

    gst_init (&argc, &argv);

    /* Create the elements */
    video_source = gst_element_factory_make ("v4l2src", "video_source");
    filter_source = gst_element_factory_make ("capsfilter", "filter_source");
    ducatijpegdec = gst_element_factory_make ("ducatijpegdec", "ducatijpegdec");
    
    tee = gst_element_factory_make ("tee", "tee");

    /* ovready thread */    
    ovready_queue = gst_element_factory_make ("queue", "ovready_queue"); 
    video_crop = gst_element_factory_make ("videocrop", "video_crop");
    video_scale = gst_element_factory_make ("videoscale", "video_scale");
    filter_scale = gst_element_factory_make ("capsfilter", "filter_scale");
    video_convert = gst_element_factory_make ("videoconvert", "video_convert");
    filter_convert= gst_element_factory_make ("capsfilter", "filter_convert");
    plugin1 = gst_element_factory_make ("plugin1", "plugin1");
    ovready_sink = gst_element_factory_make ("fakesink", "ovready_sink");

    /* rtsp thread */
    rtsp_queue = gst_element_factory_make ("queue", "rtsp_queue"); 
    ducatijpegdec = gst_element_factory_make ("ducatih264enc", "ducatih264enc");
    plugin2 = gst_element_factory_make ("plugin2", "plugin2");
    rtsp_sink = gst_element_factory_make ("fakesink", "rtsp_sink");



    /* source_caps*/
    source_caps = gst_caps_new_simple ("video/x-raw",
    "format", G_TYPE_STRING, "YUY2",
    "width", G_TYPE_INT, 640,
    "height", G_TYPE_INT, 720,
    "framerate", G_TYPE_FLOAT, 15/1,
     NULL);

    /* Set up elements for source_caps*/
    g_object_set (G_OBJECT (filter_source), "caps", source_caps, NULL);
    gst_caps_unref (source_caps);
    g_object_set (G_OBJECT (video_source), "device", "/dev/video1", NULL);


    /* scale_caps */
    scale_caps = gst_caps_new_simple ("video/x-raw",
    "format", G_TYPE_STRING, "NV12",
    "width", G_TYPE_INT, 320,
    "height", G_TYPE_INT, 240,
     NULL);

    /* Set up elements for scale_caps*/
    g_object_set (G_OBJECT (filter_scale), "caps", scale_caps, NULL);
    gst_caps_unref (scale_caps);
    

    /* convert_caps */
    convert_caps = gst_caps_new_simple ("video/x-raw",
    "format", G_TYPE_STRING, "Y444",
    "width", G_TYPE_INT, 320,
    "height", G_TYPE_INT, 240,
     NULL);

    /* Set up elements for convert_caps */
    g_object_set (G_OBJECT (filter_convert), "caps", convert_caps, NULL);
    gst_caps_unref (convert_caps);


    /* Set up elements for rtsp_queue */
    g_object_set (G_OBJECT (rtsp_queue), "min-threshold-buffers", 2, NULL);

    /* Set up elements for ducatih264enc */
    g_object_set (G_OBJECT (ducatih264enc), "rate-preset", 1, NULL);


    /* Set up elements for video_crop */
    g_object_set (G_OBJECT (video_crop), "left", 2016, NULL);

    
    /* Set up elements for video_crop */
    g_object_set (G_OBJECT (video_crop), "right", 1008, NULL);


    /* Create the empty pipeline */
    pipeline = gst_pipeline_new ("test-pipeline");

    if (!pipeline || !video_source || !filter_source || !ducatijpegdec || !tee || !ovready_queue || !video_crop || !video_scale || !filter_scale || !video_convert || !filter_convert || !plugin1 || !ovready_sink || !rtsp_queue || !ducatih264enc || !plugin2 || !rtsp_sink) 
    {
        g_printerr ("Not all elements could be created.\n");
        return -1;
    }

    /* Link all elements that can be automatically linked because they have "Always" pads */
     gst_bin_add_many (GST_BIN (pipeline), video_source, ducatijpegdec, tee, ovready_queue, video_crop, video_scale, video_convert, plugin1, ovready_sink, rtsp_queue, ducatih264enc, plugin2, rtsp_sink, NULL);
  
    if (gst_element_link_many (video_source, ducatijpegdec, tee, NULL) != TRUE ||gst_element_link_many (ovready_queue, video_crop, video_scale, video_convert, plugin1, ovready_sink, NULL) != TRUE || gst_element_link_many (rtsp_queue, ducatih264enc, plugin2, rtsp_sink, NULL) != TRUE) 
    {
        g_printerr ("Elements could not be linked.\n");
        gst_object_unref (pipeline);
        return -1;
    }


    /* Manually link the Tee, which has "Request" pads */
    tee_src_pad_template = gst_element_class_get_pad_template (GST_ELEMENT_GET_CLASS (tee), "src_%d");
    tee_ovready_pad = gst_element_request_pad (tee, tee_src_pad_template, NULL, NULL);
    g_print ("Obtained request pad %s for audio branch.\n", gst_pad_get_name (tee_ovready_pad));
    queue_ovready_pad = gst_element_get_static_pad (ovready_queue, "sink");
    tee_rtsp_pad = gst_element_request_pad (tee, tee_src_pad_template, NULL, NULL);
    g_print ("Obtained request pad %s for video branch.\n", gst_pad_get_name (tee_rtsp_pad));
    queue_rtsp_pad = gst_element_get_static_pad (rtsp_queue, "sink");
    if (gst_pad_link (tee_ovready_pad, queue_ovready_pad) != GST_PAD_LINK_OK || gst_pad_link (tee_rtsp_pad, queue_rtsp_pad) != GST_PAD_LINK_OK) 
    {
        g_printerr ("Tee could not be linked.\n");
        gst_object_unref (pipeline);
        return -1;
    }
    gst_object_unref (queue_ovready_pad);
    gst_object_unref (queue_rtsp_pad);


    /* Start playing the pipeline */
    gst_element_set_state (pipeline, GST_STATE_PLAYING);

    /* Wait until error or EOS */
    bus = gst_element_get_bus (pipeline);
    msg = gst_bus_timed_pop_filtered (bus, GST_CLOCK_TIME_NONE, GST_MESSAGE_ERROR | GST_MESSAGE_EOS);

    /* Release the request pads from the Tee, and unref them */
    gst_element_release_request_pad (tee, tee_ovready_pad);
    gst_element_release_request_pad (tee, tee_rtsp_pad);
    gst_object_unref (tee_ovready_pad);
    gst_object_unref (tee_rtsp_pad);

    /* Free resources */
    if (msg != NULL)
    {
        gst_message_unref (msg);
    }
    gst_object_unref (bus);
    gst_element_set_state (pipeline, GST_STATE_NULL);

    gst_object_unref (pipeline);
    return 0;
}



Attached my application. Give me some solution regarding issue.

Regards,

Prerak

  • Hi,

    I am sorry, but application development is out of the scope of support of this forum. Try asking on gstreamer.freedesktop.org/
  • Hello,

    Biser is right but I will take a look into it.
    I would recommend you to add --gst-debug -v and try to trace the elements linking (sink's & src's of the elements) for start. I would also recommend you to check the caps filters are they added properly.


    BR
    Margarita
  • Hello,

    Could you check this in your code:

    ducatijpegdec = gst_element_factory_make ("ducatijpegdec", "ducatijpegdec");

       tee = gst_element_factory_make ("tee", "tee");

       /* ovready thread */    

    ............

       /* rtsp thread */

       rtsp_queue = gst_element_factory_make ("queue", "rtsp_queue");

       ducatijpegdec = gst_element_factory_make ("ducatih264enc", "ducatih264enc");

    You have the same gst element name one time for ducatijpegdec and one time for ducati264enc.

    They should be unique for every element.

    In this line it seems that the enc is ducatih264enc.

       if (!pipeline || !video_source || !filter_source || !ducatijpegdec || !tee || !ovready_queue || !video_crop || !video_scale || !filter_scale || !video_convert || !filter_convert || !plugin1 || !ovready_sink || !rtsp_queue || !ducatih264enc || !plugin2 || !rtsp_sink)



    BR
    Margarita

  • Hi,

    Thanks for giving your valuable time.

    i have corrected ERROR suggested by you.

    ducatih264enc = gst_element_factory_make ("ducatih264enc", "ducatih264enc");

    still i am getting same error.
    i do not know at where i need to put --gst-debug -v

    By doing gdb i have get below log.

    #0 0xb6f52240 in ?? () from /usr/lib/libgstreamer-1.0.so.0
    #1 0xb6e9ca18 in g_type_value_table_peek () from /usr/lib/libgobject-2.0.so.0
    #2 0x00000000 in ?? ()
    Backtrace stopped: previous frame identical to this frame (corrupt stack?)


    Regards,
    Prerak
  • Hello,

    For example:
    ./gstapp -v --gst-debug=3


    BR
    Margarita
  • root@am57xx-evm:~/Gstreamer_application# ./stream --gst-debug=4
    0:00:00.001375681  1185    0x2b080 INFO                GST_INIT gstmessage.c:119:_priv_gst_message_initialize: init messages
    0:00:00.003365920  1185    0x2b080 INFO                GST_INIT gstcontext.c:77:_priv_gst_context_initialize: init contexts
    0:00:00.003986986  1185    0x2b080 INFO      GST_PLUGIN_LOADING gstplugin.c:316:_priv_gst_plugin_initialize: registering 0 static plugins
    0:00:00.004339812  1185    0x2b080 INFO      GST_PLUGIN_LOADING gstplugin.c:224:gst_plugin_register_static: registered static plugin "staticelements"
    0:00:00.004381943  1185    0x2b080 INFO      GST_PLUGIN_LOADING gstplugin.c:226:gst_plugin_register_static: added static plugin "staticelements", result: 1
    0:00:00.004462463  1185    0x2b080 INFO            GST_REGISTRY gstregistry.c:1723:ensure_current_registry: reading registry cache: /home/root/.cache/gstreamer-1.0/registry.arm.bin
    0:00:00.069997223  1185    0x2b080 INFO            GST_REGISTRY gstregistrybinary.c:619:priv_gst_registry_binary_read_cache: loaded /home/root/.cache/gstreamer-1.0/registry.arm.bin in 0.065474 seconds
    0:00:00.070205113  1185    0x2b080 INFO            GST_REGISTRY gstregistry.c:1579:scan_and_update_registry: Validating plugins from registry cache: /home/root/.cache/gstreamer-1.0/registry.arm.bin
    0:00:00.072777215  1185    0x2b080 INFO            GST_REGISTRY gstregistry.c:1681:scan_and_update_registry: Registry cache has not changed
    0:00:00.072814466  1185    0x2b080 INFO            GST_REGISTRY gstregistry.c:1758:ensure_current_registry: registry reading and updating done, result = 1
    0:00:00.072848626  1185    0x2b080 INFO                GST_INIT gst.c:720:init_post: GLib runtime version: 2.46.2
    0:00:00.072885877  1185    0x2b080 INFO                GST_INIT gst.c:722:init_post: GLib headers version: 2.46.2
    0:00:00.072919549  1185    0x2b080 INFO                GST_INIT gst.c:723:init_post: initialized GStreamer successfully
    0:00:00.087153626  1185    0x2b080 INFO      GST_PLUGIN_LOADING gstplugin.c:842:_priv_gst_plugin_load_file_for_registry: plugin "/usr/lib/gstreamer-1.0/libgstvideo4linux2.so" loaded
    0:00:00.087213650  1185    0x2b080 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:362:gst_element_factory_create: creating element "v4l2src" named "video_source"
    0:00:00.089288314  1185    0x2b080 INFO        GST_ELEMENT_PADS gstelement.c:646:gst_element_add_pad:<GstBaseSrc@0x14a0a0> adding pad 'src'
    0:00:00.090819831  1185    0x2b080 INFO      GST_PLUGIN_LOADING gstplugin.c:842:_priv_gst_plugin_load_file_for_registry: plugin "/usr/lib/gstreamer-1.0/libgstcoreelements.so" loaded
    0:00:00.090868956  1185    0x2b080 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:362:gst_element_factory_create: creating element "capsfilter" named "filter_source"
    0:00:00.091151836  1185    0x2b080 INFO        GST_ELEMENT_PADS gstelement.c:646:gst_element_add_pad:<GstBaseTransform@0x14e170> adding pad 'sink'
    0:00:00.091232844  1185    0x2b080 INFO        GST_ELEMENT_PADS gstelement.c:646:gst_element_add_pad:<GstBaseTransform@0x14e170> adding pad 'src'
    0:00:00.093557854  1185    0x2b080 INFO      GST_PLUGIN_LOADING gstplugin.c:842:_priv_gst_plugin_load_file_for_registry: plugin "/usr/lib/gstreamer-1.0/libgstducati.so" loaded
    0:00:00.093619830  1185    0x2b080 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:362:gst_element_factory_create: creating element "ducatijpegdec" named "ducatijpegdec"
    0:00:00.093998521  1185    0x2b080 INFO        GST_ELEMENT_PADS gstelement.c:646:gst_element_add_pad:<GstDucatiVidDec@0x154bd0> adding pad 'sink'
    0:00:00.094047484  1185    0x2b080 INFO        GST_ELEMENT_PADS gstelement.c:646:gst_element_add_pad:<GstDucatiVidDec@0x154bd0> adding pad 'src'
    0:00:00.094103279  1185    0x2b080 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:362:gst_element_factory_create: creating element "tee" named "tee"
    0:00:00.094387785  1185    0x2b080 INFO        GST_ELEMENT_PADS gstelement.c:646:gst_element_add_pad:<GstTee@0x156068> adding pad 'sink'
    0:00:00.094465052  1185    0x2b080 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:362:gst_element_factory_create: creating element "queue" named "ovready_queue"
    0:00:00.094938740  1185    0x2b080 INFO        GST_ELEMENT_PADS gstelement.c:646:gst_element_add_pad:<GstQueue@0x86038> adding pad 'sink'
    0:00:00.448638886  1185    0x2b080 INFO        GST_ELEMENT_PADS gstelement.c:646:gst_element_add_pad:<GstQueue@0x86038> adding pad 'src'
    0:00:00.449182359  1185    0x2b080 INFO      GST_PLUGIN_LOADING gstplugin.c:842:_priv_gst_plugin_load_file_for_registry: plugin "/usr/lib/gstreamer-1.0/libgstvideocrop.so" loaded
    0:00:00.449219447  1185    0x2b080 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:362:gst_element_factory_create: creating element "videocrop" named "video_crop"
    0:00:00.449548687  1185    0x2b080 INFO        GST_ELEMENT_PADS gstelement.c:646:gst_element_add_pad:<GstBaseTransform@0x8a2d0> adding pad 'sink'
    0:00:00.449616356  1185    0x2b080 INFO        GST_ELEMENT_PADS gstelement.c:646:gst_element_add_pad:<GstBaseTransform@0x8a2d0> adding pad 'src'
    0:00:00.450070850  1185    0x2b080 INFO      GST_PLUGIN_LOADING gstplugin.c:842:_priv_gst_plugin_load_file_for_registry: plugin "/usr/lib/gstreamer-1.0/libgstvideoscale.so" loaded
    0:00:00.450106637  1185    0x2b080 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:362:gst_element_factory_create: creating element "videoscale" named "video_scale"
    0:00:00.450544213  1185    0x2b080 INFO        GST_ELEMENT_PADS gstelement.c:646:gst_element_add_pad:<GstBaseTransform@0x164130> adding pad 'sink'
    0:00:00.450611558  1185    0x2b080 INFO        GST_ELEMENT_PADS gstelement.c:646:gst_element_add_pad:<GstBaseTransform@0x164130> adding pad 'src'
    0:00:00.450679553  1185    0x2b080 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:362:gst_element_factory_create: creating element "capsfilter" named "filter_scale"
    0:00:00.450761700  1185    0x2b080 INFO        GST_ELEMENT_PADS gstelement.c:646:gst_element_add_pad:<GstBaseTransform@0x14e3a0> adding pad 'sink'
    0:00:00.450824164  1185    0x2b080 INFO        GST_ELEMENT_PADS gstelement.c:646:gst_element_add_pad:<GstBaseTransform@0x14e3a0> adding pad 'src'
    0:00:00.451290533  1185    0x2b080 INFO      GST_PLUGIN_LOADING gstplugin.c:842:_priv_gst_plugin_load_file_for_registry: plugin "/usr/lib/gstreamer-1.0/libgstvideoconvert.so" loaded
    0:00:00.451326157  1185    0x2b080 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:362:gst_element_factory_create: creating element "videoconvert" named "video_convert"
    0:00:00.451982033  1185    0x2b080 INFO        GST_ELEMENT_PADS gstelement.c:646:gst_element_add_pad:<GstBaseTransform@0x16c138> adding pad 'sink'
    0:00:00.452049866  1185    0x2b080 INFO        GST_ELEMENT_PADS gstelement.c:646:gst_element_add_pad:<GstBaseTransform@0x16c138> adding pad 'src'
    0:00:00.452096551  1185    0x2b080 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:362:gst_element_factory_create: creating element "capsfilter" named "filter_convert"
    0:00:00.452166824  1185    0x2b080 INFO        GST_ELEMENT_PADS gstelement.c:646:gst_element_add_pad:<GstBaseTransform@0x14e5d0> adding pad 'sink'
    0:00:00.452229125  1185    0x2b080 INFO        GST_ELEMENT_PADS gstelement.c:646:gst_element_add_pad:<GstBaseTransform@0x14e5d0> adding pad 'src'
    0:00:00.469323063  1185    0x2b080 INFO      GST_PLUGIN_LOADING gstplugin.c:842:_priv_gst_plugin_load_file_for_registry: plugin "/usr/lib/gstreamer-1.0/libgsteiovready.so" loaded
    0:00:00.805735371  1185    0x2b080 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:362:gst_element_factory_create: creating element "eiovready" named "ei_ovready"
    0:00:00.806038096  1185    0x2b080 INFO        GST_ELEMENT_PADS gstelement.c:646:gst_element_add_pad:<GsteiOvReady@0x176808> adding pad 'sink'
    0:00:00.806144318  1185    0x2b080 INFO        GST_ELEMENT_PADS gstelement.c:646:gst_element_add_pad:<GsteiOvReady@0x176808> adding pad 'src'
    0:00:00.806200275  1185    0x2b080 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:362:gst_element_factory_create: creating element "fakesink" named "ovready_sink"
    0:00:00.806645334  1185    0x2b080 INFO        GST_ELEMENT_PADS gstelement.c:646:gst_element_add_pad:<GstBaseSink@0x17a230> adding pad 'sink'
    0:00:00.806704871  1185    0x2b080 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:362:gst_element_factory_create: creating element "queue" named "rtsp_queue"
    0:00:00.806816298  1185    0x2b080 INFO        GST_ELEMENT_PADS gstelement.c:646:gst_element_add_pad:<GstQueue@0x86288> adding pad 'sink'
    0:00:00.806917803  1185    0x2b080 INFO        GST_ELEMENT_PADS gstelement.c:646:gst_element_add_pad:<GstQueue@0x86288> adding pad 'src'
    0:00:00.806973760  1185    0x2b080 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:362:gst_element_factory_create: creating element "ducatih264enc" named "ducatih264enc"
    0:00:00.807549604  1185    0x2b080 INFO        GST_ELEMENT_PADS gstelement.c:646:gst_element_add_pad:<GstVideoEncoder@0x17e1a0> adding pad 'sink'
    0:00:00.807646554  1185    0x2b080 INFO        GST_ELEMENT_PADS gstelement.c:646:gst_element_add_pad:<GstVideoEncoder@0x17e1a0> adding pad 'src'
    0:00:00.809138705  1185    0x2b080 INFO      GST_PLUGIN_LOADING gstplugin.c:842:_priv_gst_plugin_load_file_for_registry: plugin "/usr/lib/gstreamer-1.0/libgsteirtspserver.so" loaded
    0:00:00.809186204  1185    0x2b080 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:362:gst_element_factory_create: creating element "eirtspserver" named "eirtsp_server"
    0:00:00.809512841  1185    0x2b080 INFO        GST_ELEMENT_PADS gstelement.c:646:gst_element_add_pad:<Gsteirtspserver@0x182008> adding pad 'sink'
    0:00:00.809617599  1185    0x2b080 INFO        GST_ELEMENT_PADS gstelement.c:646:gst_element_add_pad:<Gsteirtspserver@0x182008> adding pad 'src'
    0:00:00.809724634  1185    0x2b080 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:362:gst_element_factory_create: creating element "fakesink" named "rtsp_sink"
    0:00:00.809808571  1185    0x2b080 INFO        GST_ELEMENT_PADS gstelement.c:646:gst_element_add_pad:<GstBaseSink@0x17a610> adding pad 'sink'
    Segmentation fault (core dumped)
    

    atteched logs.

    Regards,

    Prerak

  • Hello,

    Are you sure this is the log from the application which code you shared.
    I see elements like eirtspserver, eiovready etc, which I could not allocate in the code.

    BR
    Margarita
  • Hi,

    plugin1 i have rename as eiovready.
    plugin2 i have rename as eirtspserver.

    Because of some policy i need to do that.

    Regards,
    Prerak
  • Hello,

    Since the pipeline that you are using is working on the board it seems that the problem is in the application.

    In the past I had trouble in some gst app when I tried to use gst_element_link_many and I see that in the log the error appears before the elements linking. Could you try something like:

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

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

    gboolean link_ok;
    GstCaps *source_caps;

    source_caps = gst_caps_new_simple ("video/x-raw",
    "format", G_TYPE_STRING, "YUY2",
    "width", G_TYPE_INT, 640,
    "height", G_TYPE_INT, 720,
    "framerate", G_TYPE_FLOAT, 10/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->jpegdec)");
    }
    return link_ok;

    }


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

    {
    /* CAPS to be link:
    * video/x-raw , format=NV12 , height=240 , width=320
    * */

    gboolean link_ok;
    GstCaps *scale_caps;

    scale_caps = gst_caps_new_simple ("video/x-raw",
    "format", G_TYPE_STRING, "NV12",
    "width", G_TYPE_INT, 320,
    "height", G_TYPE_INT, 240,
    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!(videoscale->videoconvert)");
    }
    return link_ok;

    }

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

    {
    /* CAPS to be link:
    * video/x-raw , format=Y444, height=240 , width=320
    * */

    gboolean link_ok;
    GstCaps *convert_caps;

    /* convert_caps */
    convert_caps = gst_caps_new_simple ("video/x-raw",
    "format", G_TYPE_STRING, "Y444",
    "width", G_TYPE_INT, 320,
    "height", G_TYPE_INT, 240,
    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!(videoconvert->plugin1)");
    }
    return link_ok;

    }

    int main ()
    ....
    /* Link the pipeline */
    gst_element_link_pads (video_source, "src", ducatijpegdec, "sink");
    link_source_element_with_filter (video_source, ducatijpegdec);
    gst_element_link_pads (ducatijpegdec, "src", tee, "sink");
    gst_element_link_pads (tee, "src", parser, "sink");
    gst_element_link_pads (parser, "src", decoder, "sink");
    gst_element_link_pads (decoder, "src", tee, "sink");
    gst_element_link_pads (tee, "src", ovready_queue, "sink");
    gst_element_link_pads (ovready_queue, "src", video_crop, "sink");
    gst_element_link_pads (video_crop, "src", video_scale, "sink");
    gst_element_link_pads (video_scale, "src",video_convert, "sink");
    link_scale_element_with_filter (video_scale, video_convert);
    gst_element_link_pads (video_convert, "src", plugin1, "sink");
    link_convert_element_with_filter (video_convert, plugin1);
    gst_element_link_pads (plugin1, "src", ovready_sink, "sink");
    gst_element_link_pads (tee, "src", rtsp_queue, "sink");
    gst_element_link_pads (rtsp_queue, "src", ducatih264enc, "sink");
    gst_element_link_pads (ducatih264enc, "src", plugin2, "sink");
    gst_element_link_pads (plugin2, "src", rtsp_sink, "sink");

    /* Manually link the Tee, which has "Request" pads */
    tee_src_pad_template = gst_element_class_get_pad_template (GST_ELEMENT_GET_CLASS (tee), "src_%d");
    tee_ovready_pad = gst_element_request_pad (tee, tee_src_pad_template, NULL, NULL);
    ....

    Please only recheck the gstElement names.

    BR
    Margarita
  • Hi,

    There is no need of

    gst_element_link_pads (tee, "src", parser, "sink");
    gst_element_link_pads (parser, "src", decoder, "sink");
    gst_element_link_pads (decoder, "src", tee, "sink");

    in your suggested code.(commented while compile code)

    i have modified my code as per your guidline and compile it.

    ./stream --gst-debug=4
    0:00:00.001464165  1163    0x2b080 INFO                GST_INIT gstmessage.c:119:_priv_gst_message_initialize: init messages
    0:00:00.003470011  1163    0x2b080 INFO                GST_INIT gstcontext.c:77:_priv_gst_context_initialize: init contexts
    0:00:00.004123445  1163    0x2b080 INFO      GST_PLUGIN_LOADING gstplugin.c:316:_priv_gst_plugin_initialize: registering 0 static plugins
    0:00:00.004498555  1163    0x2b080 INFO      GST_PLUGIN_LOADING gstplugin.c:224:gst_plugin_register_static: registered static plugin "staticelements"
    0:00:00.004546704  1163    0x2b080 INFO      GST_PLUGIN_LOADING gstplugin.c:226:gst_plugin_register_static: added static plugin "staticelements", result: 1
    0:00:00.004606403  1163    0x2b080 INFO            GST_REGISTRY gstregistry.c:1723:ensure_current_registry: reading registry cache: /home/root/.cache/gstreamer-1.0/registry.arm.bin
    0:00:00.074508959  1163    0x2b080 INFO            GST_REGISTRY gstregistrybinary.c:619:priv_gst_registry_binary_read_cache: loaded /home/root/.cache/gstreamer-1.0/registry.arm.bin in 0.069841 seconds
    0:00:00.074769226  1163    0x2b080 INFO            GST_REGISTRY gstregistry.c:1579:scan_and_update_registry: Validating plugins from registry cache: /home/root/.cache/gstreamer-1.0/registry.arm.bin
    0:00:00.081396929  1163    0x2b080 INFO            GST_REGISTRY gstregistry.c:1681:scan_and_update_registry: Registry cache has not changed
    0:00:00.081445892  1163    0x2b080 INFO            GST_REGISTRY gstregistry.c:1758:ensure_current_registry: registry reading and updating done, result = 1
    0:00:00.081485095  1163    0x2b080 INFO                GST_INIT gst.c:720:init_post: GLib runtime version: 2.46.2
    0:00:00.081528201  1163    0x2b080 INFO                GST_INIT gst.c:722:init_post: GLib headers version: 2.46.2
    0:00:00.081567079  1163    0x2b080 INFO                GST_INIT gst.c:723:init_post: initialized GStreamer successfully
    0:00:00.094693979  1163    0x2b080 INFO      GST_PLUGIN_LOADING gstplugin.c:842:_priv_gst_plugin_load_file_for_registry: plugin "/usr/lib/gstreamer-1.0/libgstvideo4linux2.so" loaded
    0:00:00.094757256  1163    0x2b080 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:362:gst_element_factory_create: creating element "v4l2src" named "video_source"
    0:00:00.096846551  1163    0x2b080 INFO        GST_ELEMENT_PADS gstelement.c:646:gst_element_add_pad:<GstBaseSrc@0x14a0a0> adding pad 'src'
    0:00:00.100199605  1163    0x2b080 INFO      GST_PLUGIN_LOADING gstplugin.c:842:_priv_gst_plugin_load_file_for_registry: plugin "/usr/lib/gstreamer-1.0/libgstcoreelements.so" loaded
    0:00:00.100260117  1163    0x2b080 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:362:gst_element_factory_create: creating element "capsfilter" named "filter_source"
    0:00:00.100582686  1163    0x2b080 INFO        GST_ELEMENT_PADS gstelement.c:646:gst_element_add_pad:<GstBaseTransform@0x14e170> adding pad 'sink'
    0:00:00.100672153  1163    0x2b080 INFO        GST_ELEMENT_PADS gstelement.c:646:gst_element_add_pad:<GstBaseTransform@0x14e170> adding pad 'src'
    0:00:00.103037168  1163    0x2b080 INFO      GST_PLUGIN_LOADING gstplugin.c:842:_priv_gst_plugin_load_file_for_registry: plugin "/usr/lib/gstreamer-1.0/libgstducati.so" loaded
    0:00:00.103094264  1163    0x2b080 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:362:gst_element_factory_create: creating element "ducatijpegdec" named "ducatijpegdec"
    0:00:00.103501094  1163    0x2b080 INFO        GST_ELEMENT_PADS gstelement.c:646:gst_element_add_pad:<GstDucatiVidDec@0x154bc8> adding pad 'sink'
    0:00:00.103554612  1163    0x2b080 INFO        GST_ELEMENT_PADS gstelement.c:646:gst_element_add_pad:<GstDucatiVidDec@0x154bc8> adding pad 'src'
    0:00:00.103615774  1163    0x2b080 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:362:gst_element_factory_create: creating element "tee" named "tee"
    0:00:00.103910202  1163    0x2b080 INFO        GST_ELEMENT_PADS gstelement.c:646:gst_element_add_pad:<GstTee@0x156068> adding pad 'sink'
    0:00:00.103998367  1163    0x2b080 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:362:gst_element_factory_create: creating element "queue" named "ovready_queue"
    0:00:00.104397064  1163    0x2b080 INFO        GST_ELEMENT_PADS gstelement.c:646:gst_element_add_pad:<GstQueue@0x86038> adding pad 'sink'
    0:00:00.104505075  1163    0x2b080 INFO        GST_ELEMENT_PADS gstelement.c:646:gst_element_add_pad:<GstQueue@0x86038> adding pad 'src'
    0:00:00.105109220  1163    0x2b080 INFO      GST_PLUGIN_LOADING gstplugin.c:842:_priv_gst_plugin_load_file_for_registry: plugin "/usr/lib/gstreamer-1.0/libgstvideocrop.so" loaded
    0:00:00.105157207  1163    0x2b080 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:362:gst_element_factory_create: creating element "videocrop" named "video_crop"
    0:00:00.105539474  1163    0x2b080 INFO        GST_ELEMENT_PADS gstelement.c:646:gst_element_add_pad:<GstBaseTransform@0x8a2e0> adding pad 'sink'
    0:00:00.105621784  1163    0x2b080 INFO        GST_ELEMENT_PADS gstelement.c:646:gst_element_add_pad:<GstBaseTransform@0x8a2e0> adding pad 'src'
    0:00:00.106165091  1163    0x2b080 INFO      GST_PLUGIN_LOADING gstplugin.c:842:_priv_gst_plugin_load_file_for_registry: plugin "/usr/lib/gstreamer-1.0/libgstvideoscale.so" loaded
    0:00:00.106211451  1163    0x2b080 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:362:gst_element_factory_create: creating element "videoscale" named "video_scale"
    0:00:00.106729708  1163    0x2b080 INFO        GST_ELEMENT_PADS gstelement.c:646:gst_element_add_pad:<GstBaseTransform@0x164130> adding pad 'sink'
    0:00:00.106816085  1163    0x2b080 INFO        GST_ELEMENT_PADS gstelement.c:646:gst_element_add_pad:<GstBaseTransform@0x164130> adding pad 'src'
    0:00:00.106901159  1163    0x2b080 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:362:gst_element_factory_create: creating element "capsfilter" named "filter_scale"
    0:00:00.107004290  1163    0x2b080 INFO        GST_ELEMENT_PADS gstelement.c:646:gst_element_add_pad:<GstBaseTransform@0x14e3a0> adding pad 'sink'
    0:00:00.107081394  1163    0x2b080 INFO        GST_ELEMENT_PADS gstelement.c:646:gst_element_add_pad:<GstBaseTransform@0x14e3a0> adding pad 'src'
    0:00:00.107676756  1163    0x2b080 INFO      GST_PLUGIN_LOADING gstplugin.c:842:_priv_gst_plugin_load_file_for_registry: plugin "/usr/lib/gstreamer-1.0/libgstvideoconvert.so" loaded
    0:00:00.107724417  1163    0x2b080 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:362:gst_element_factory_create: creating element "videoconvert" named "video_convert"
    0:00:00.108489928  1163    0x2b080 INFO        GST_ELEMENT_PADS gstelement.c:646:gst_element_add_pad:<GstBaseTransform@0x16c138> adding pad 'sink'
    0:00:00.108574189  1163    0x2b080 INFO        GST_ELEMENT_PADS gstelement.c:646:gst_element_add_pad:<GstBaseTransform@0x16c138> adding pad 'src'
    0:00:00.108633237  1163    0x2b080 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:362:gst_element_factory_create: creating element "capsfilter" named "filter_convert"
    0:00:00.108719451  1163    0x2b080 INFO        GST_ELEMENT_PADS gstelement.c:646:gst_element_add_pad:<GstBaseTransform@0x14e5d0> adding pad 'sink'
    0:00:00.108795579  1163    0x2b080 INFO        GST_ELEMENT_PADS gstelement.c:646:gst_element_add_pad:<GstBaseTransform@0x14e5d0> adding pad 'src'
    0:00:00.128757420  1163    0x2b080 INFO      GST_PLUGIN_LOADING gstplugin.c:842:_priv_gst_plugin_load_file_for_registry: plugin "/usr/lib/gstreamer-1.0/libgsteiovready.so" loaded
    0:00:00.128832897  1163    0x2b080 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:362:gst_element_factory_create: creating element "eiovready" named "ei_ovready"
    0:00:00.129164575  1163    0x2b080 INFO        GST_ELEMENT_PADS gstelement.c:646:gst_element_add_pad:<GsteiOvReady@0x176808> adding pad 'sink'
    0:00:00.129283322  1163    0x2b080 INFO        GST_ELEMENT_PADS gstelement.c:646:gst_element_add_pad:<GsteiOvReady@0x176808> adding pad 'src'
    0:00:00.129343184  1163    0x2b080 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:362:gst_element_factory_create: creating element "fakesink" named "ovready_sink"
    0:00:00.129836065  1163    0x2b080 INFO        GST_ELEMENT_PADS gstelement.c:646:gst_element_add_pad:<GstBaseSink@0x17a230> adding pad 'sink'
    0:00:00.129904548  1163    0x2b080 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:362:gst_element_factory_create: creating element "queue" named "rtsp_queue"
    0:00:00.130023132  1163    0x2b080 INFO        GST_ELEMENT_PADS gstelement.c:646:gst_element_add_pad:<GstQueue@0x86288> adding pad 'sink'
    0:00:00.130132119  1163    0x2b080 INFO        GST_ELEMENT_PADS gstelement.c:646:gst_element_add_pad:<GstQueue@0x86288> adding pad 'src'
    0:00:00.130193281  1163    0x2b080 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:362:gst_element_factory_create: creating element "ducatih264enc" named "ducatih264enc"
    0:00:00.130790595  1163    0x2b080 INFO        GST_ELEMENT_PADS gstelement.c:646:gst_element_add_pad:<GstVideoEncoder@0x17e1a0> adding pad 'sink'
    0:00:00.130898931  1163    0x2b080 INFO        GST_ELEMENT_PADS gstelement.c:646:gst_element_add_pad:<GstVideoEncoder@0x17e1a0> adding pad 'src'
    0:00:00.132425072  1163    0x2b080 INFO      GST_PLUGIN_LOADING gstplugin.c:842:_priv_gst_plugin_load_file_for_registry: plugin "/usr/lib/gstreamer-1.0/libgsteirtspserver.so" loaded
    0:00:00.132482168  1163    0x2b080 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:362:gst_element_factory_create: creating element "eirtspserver" named "eirtsp_server"
    0:00:00.132858743  1163    0x2b080 INFO        GST_ELEMENT_PADS gstelement.c:646:gst_element_add_pad:<Gsteirtspserver@0x182008> adding pad 'sink'
    0:00:00.132972935  1163    0x2b080 INFO        GST_ELEMENT_PADS gstelement.c:646:gst_element_add_pad:<Gsteirtspserver@0x182008> adding pad 'src'
    0:00:00.133095098  1163    0x2b080 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:362:gst_element_factory_create: creating element "fakesink" named "rtsp_sink"
    0:00:00.133196276  1163    0x2b080 INFO        GST_ELEMENT_PADS gstelement.c:646:gst_element_add_pad:<GstBaseSink@0x17a610> adding pad 'sink'
    0:00:00.133319741  1163    0x2b080 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:362:gst_element_factory_create: creating element "pipeline" named "test-pipeline"
    0:00:00.133747392  1163    0x2b080 INFO        GST_ELEMENT_PADS gstutils.c:1571:gst_element_link_pads_full: trying to link element video_source:src to element ducatijpegdec:sink
    0:00:00.133805627  1163    0x2b080 INFO        GST_ELEMENT_PADS gstelement.c:897:gst_element_get_static_pad: found pad video_source:src
    0:00:00.133854427  1163    0x2b080 INFO        GST_ELEMENT_PADS gstelement.c:897:gst_element_get_static_pad: found pad ducatijpegdec:sink
    0:00:00.133896883  1163    0x2b080 INFO                GST_PADS gstutils.c:1444:prepare_link_maybe_ghosting: video_source and ducatijpegdec in same bin, no need for ghost pads
    0:00:00.133962438  1163    0x2b080 INFO                GST_PADS gstpad.c:2234:gst_pad_link_prepare: trying to link video_source:src and ducatijpegdec:sink
    0:00:00.134048326  1163    0x2b080 INFO                GST_PADS gstpad.c:2440:gst_pad_link_full: linked video_source:src and ducatijpegdec:sink, successful
    0:00:00.134094686  1163    0x2b080 INFO               GST_EVENT gstevent.c:1374:gst_event_new_reconfigure: creating reconfigure event
    0:00:00.134132425  1163    0x2b080 INFO               GST_EVENT gstpad.c:5502:gst_pad_send_event_unchecked:<video_source:src> Received event on flushing pad. Discarding
    Segmentation fault (core dumped)
    
    

    Regards,

    Prerak

  • Hello,

    I guess you follow this gstreamer tutorial for tee element:

    For me this tutorial did not work even on PC. I found that there is a mistake in it at this line:

    tee_src_pad_template = gst_element_class_get_pad_template (GST_ELEMENT_GET_CLASS (tee), "src_%d");

    This line is working in the gstreamer version 0.10.

    For gstreamer version 1.0 > this line should be

    tee_src_pad_template = gst_element_class_get_pad_template (GST_ELEMENT_GET_CLASS (tee), "src_%u");

    You could check this also with gst-inspect "tee"(SRC template: 'src_%u').

    Please change this.

    Here is example which you could use as reference.

    #include <stdio.h>
    #include <gst/gst.h>
    
    
    static gboolean link_source_element_with_filter (GstElement *element1,
    GstElement *element2) 
    
    {
    	/* CAPS to be linked:
    	 * 'video/x-raw, format=(string)YUY2, width=(int)640, height=(int)720, framerate=10/1'
    	 * */
    	
        gboolean link_ok; 
        GstCaps *caps; 
    
        caps = gst_caps_new_simple ("video/x-raw",
        "format", G_TYPE_STRING, "YUY2",
        "width", G_TYPE_INT, 640,
        "height", G_TYPE_INT, 720,
        //"framerate", G_TYPE_FLOAT, 10/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->jpegdec)"); 
        } 
        return link_ok; 
        
    	}
    	
    
    	static gboolean link_scale_element_with_filter (GstElement *element1,
    GstElement *element2) 
    
    {
    	/* CAPS to be linked:
    	 * video/x-raw , format=NV12 , height=240 , width=320
    	 * */
    	
        gboolean link_ok; 
        GstCaps *caps; 
    
        caps = gst_caps_new_simple ("video/x-raw",
        "format", G_TYPE_STRING, "YUY2",
        "width", G_TYPE_INT, 320,
        "height", G_TYPE_INT, 240,
         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!(videoscale->videoconvert)"); 
        } 
        return link_ok; 
        
    	}
    	
    
    
    
    /* BUS function for ERROR */
    
    static gboolean bus_call(GstBus *bus, GstMessage *msg, gpointer data)
    {
        GMainLoop *loop = (GMainLoop *) data;
        switch (GST_MESSAGE_TYPE (msg)) 
        {
            case GST_MESSAGE_EOS:
                g_print ("End of stream\n");
                g_main_loop_quit (loop);
                break;
     
            case GST_MESSAGE_ERROR: 
            {
                gchar  *debug;
                GError *error;
                gst_message_parse_error (msg, &error, &debug);
                g_free (debug);
                g_printerr ("Error: %s\n", error->message);
                g_error_free (error);
                g_main_loop_quit (loop);
                break;
            }
    
            default:
            break;
        }
     
        return TRUE;
     }
    
    /* Main function does atual processing */
    
    int main (int argc , char *argv[])
    {
    	GMainLoop *loop;
    	loop = g_main_loop_new (NULL, FALSE);
    	
        GstElement *pipeline, *video_source, *queue_src, *tee1, *video_queue0,  *video_sink0;    
        GstElement *video_queue1,  *video_scale,  *video_sink1; 
        GstBus *bus;
        GstMessage *msg;
    
         GstPadTemplate *tee_src_pad_template;
      GstPad *tee_audio_pad, *tee_video_pad;
      GstPad *queue_audio_pad, *queue_video_pad;
        
    
        gst_init (&argc, &argv);
        
        
        
    //Pipeline 
    //gst-launch-1.0 videotestsrc ! 'video/x-raw, format=YUY2, width=640, height=320' ! queue ! tee name=t ! queue ! autovideosink  t. ! queue ! videoscale ! 'video/x-raw, format=YUY2, width=320, height=240' ! autovideosink
    
    
        /* Create the empty pipeline */
        pipeline = gst_pipeline_new ("test-pipeline");
    
        /* Create the elements */
        video_source = gst_element_factory_make ("videotestsrc", "video_source");
        queue_src = gst_element_factory_make ("queue", "queue_src");
        tee1 = gst_element_factory_make ("tee", "tee1");
    
        /* rtsp thread */
        video_queue0 = gst_element_factory_make ("queue", "queue0"); 
        video_sink0 = gst_element_factory_make ("autovideosink", "sink0");
    
        /* ovready thread */    
        video_queue1 = gst_element_factory_make ("queue", "queue1"); 
        video_scale = gst_element_factory_make ("videoscale", "video_scale");
        video_sink1 = gst_element_factory_make ("autovideosink", "sink1");
    
    
    
    
        /* Link all elements that can be automatically linked because they have "Always" pads */
         //gst_bin_add_many (GST_BIN (pipeline), video_source, queue_src,  tee, rtsp_queue, rtsp_sink, ovready_queue, video_scale, ovready_sink, NULL);
      
     
    
       gst_bin_add_many (GST_BIN (pipeline), video_source, queue_src, tee1, video_queue0, video_sink0, video_queue1,  video_scale, video_sink1, NULL);
    
       
          
    /*if (gst_element_link_many (video_source, queue_src, tee1, NULL) != TRUE || 
       gst_element_link_many (video_queue0, video_sink0, NULL) != TRUE || 
      gst_element_link_many (video_queue1, video_scale, video_sink1, NULL) != TRUE) {
      g_printerr ("Elements could not be linked.\n");
      gst_object_unref (pipeline);
      return -1;
     }*/
    
    
    /* Link the pipeline manually*/
    
     link_source_element_with_filter (video_source, queue_src);
     gst_element_link_pads (queue_src, "src", tee1, "sink");
     gst_element_link_pads (tee1, "src", video_queue0, "sink");
     gst_element_link_pads (video_queue0, "src", video_sink0, "sink");
     gst_element_link_pads (tee1, "src", video_queue1, "sink");
     gst_element_link_pads (video_queue1, "src",video_scale, "sink");
     link_scale_element_with_filter ( video_scale, video_sink1 );
     
    
    
     tee_src_pad_template = gst_element_class_get_pad_template (GST_ELEMENT_GET_CLASS (tee1), "src_%u");
      tee_audio_pad = gst_element_request_pad (tee1, tee_src_pad_template, NULL, NULL);
     g_print ("Obtained request pad %s for audio branch.\n", gst_pad_get_name (tee_audio_pad));
     queue_audio_pad = gst_element_get_static_pad (video_queue0, "sink");
     tee_video_pad = gst_element_request_pad (tee1, tee_src_pad_template, NULL, NULL);
     g_print ("Obtained request pad %s for video branch.\n", gst_pad_get_name (tee_video_pad));
     queue_video_pad = gst_element_get_static_pad (video_queue1, "sink");
     if (gst_pad_link (tee_audio_pad, queue_audio_pad) != GST_PAD_LINK_OK ||
       gst_pad_link (tee_video_pad, queue_video_pad) != GST_PAD_LINK_OK) {
      g_printerr ("Tee could not be linked1.\n");
       gst_object_unref (pipeline);
       return -1;
      }
      gst_object_unref (queue_audio_pad);
      gst_object_unref (queue_video_pad);
    
    
       /* Set the pipeline to "playing" state */
      gst_element_set_state (pipeline, GST_STATE_PLAYING);
      /* Iterate */
      
      g_main_loop_run (loop);
      
      /* Wait until error or EOS */
      bus = gst_element_get_bus (pipeline);
      msg = gst_bus_timed_pop_filtered (bus, GST_CLOCK_TIME_NONE, GST_MESSAGE_ERROR | GST_MESSAGE_EOS);
    
      /* Release the request pads from the Tee, and unref them */
     gst_element_release_request_pad (tee1, tee_audio_pad);
      gst_element_release_request_pad (tee1, tee_video_pad);
      gst_object_unref (tee_audio_pad);
      gst_object_unref (tee_video_pad);
    
      /* Free resources */
      if (msg != NULL)
        gst_message_unref (msg);
      gst_object_unref (bus);
      gst_element_set_state (pipeline, GST_STATE_NULL);
    
      gst_object_unref (pipeline);
      return 0;
    
    }
    
    
    //gcc tee_t.c -o tee_t `pkg-config --cflags --libs gstreamer-1.0`
    
    
    

    Let me know the result.

    Hope this helps you.

    BR
    Margarita

  • Hi Margarita,

    Thanks for your quick support.

    i am still getting same error.
    no any addition on logs. Logs are exactly same as previous.

    Regards,
    Prerak
  • Hello,

    Could you raise the debug level and share the log?

    BR
    Margarita
  • If you are using the code that I share please check if this lines are commented. If they are not, please comment them.
    /* Link the pipeline */
    //gst_element_link_pads (video_source, "src", ducatijpegdec, "sink");
    link_source_element_with_filter (video_source, ducatijpegdec);
    gst_element_link_pads (ducatijpegdec, "src", tee, "sink");
    gst_element_link_pads (tee, "src", ovready_queue, "sink");

    gst_element_link_pads (ovready_queue, "src", video_crop, "sink");
    gst_element_link_pads (video_crop, "src", video_scale, "sink");
    //gst_element_link_pads (video_scale, "src",video_convert, "sink");
    link_scale_element_with_filter (video_scale, video_convert);
    //gst_element_link_pads (video_convert, "src", plugin1, "sink");
    link_convert_element_with_filter (video_convert, plugin1);
    gst_element_link_pads (plugin1, "src", ovready_sink, "sink");
    gst_element_link_pads (tee, "src", rtsp_queue, "sink");
    gst_element_link_pads (rtsp_queue, "src", ducatih264enc, "sink");
    gst_element_link_pads (ducatih264enc, "src", plugin2, "sink");
    gst_element_link_pads (plugin2, "src", rtsp_sink, "sink");

    For example (first comment) video_source and ducatijpegdec are connected with capsfilter so if the first line is not comment the capsfilter will be ignore.

    Could you share the latest modification of the on your side.
    I also would recommend you to check the tee_t.c example that I shared.

    BR
    Margarita
  • Hi,

    Attached logs with debug level=6

    debug_6_logs.txt

    I have also make application without tee element which gives me same error like previous.

    attached application with logs of debug level=4 .

    #include <stdio.h>
    #include <gst/gst.h>
    
    
    
    static gboolean link_source_element_with_filter (GstElement *element1,GstElement *element2)
    
    {
    	/* CAPS to be link:
    	* 'video/x-raw, format=(string)YUY2, width=(int)640, height=(int)720, framerate=10/1'
    	* */
    
    	gboolean link_ok;
    	GstCaps *source_caps;
    
    	source_caps = gst_caps_new_simple ("video/x-raw",
    	"format", G_TYPE_STRING, "YUY2",
    	"width", G_TYPE_INT, 640,
    	"height", G_TYPE_INT, 720,
    	"framerate", G_TYPE_FLOAT, 15/1,
    	NULL);
    	
        	g_object_set (G_OBJECT (element1), "device", "/dev/video1" , NULL);
    	link_ok = gst_element_link_filtered (element1, element2, source_caps);
    	gst_caps_unref (source_caps);
    
    	if (!link_ok) 
    	{
    		g_warning ("Failed to link element1 and element2!(v4l2src->jpegdec)");
    	}
    	return link_ok;
    
    }
    
    
    /* BUS function for ERROR */
    
    static gboolean bus_call(GstBus *bus, GstMessage *msg, gpointer data)
    {
        GMainLoop *loop = (GMainLoop *) data;
        switch (GST_MESSAGE_TYPE (msg)) 
        {
            case GST_MESSAGE_EOS:
                g_print ("End of stream\n");
                g_main_loop_quit (loop);
                break;
     
            case GST_MESSAGE_ERROR: 
            {
                gchar  *debug;
                GError *error;
                gst_message_parse_error (msg, &error, &debug);
                g_free (debug);
                g_printerr ("Error: %s\n", error->message);
                g_error_free (error);
                g_main_loop_quit (loop);
                break;
            }
    
            default:
            break;
        }
     
        return TRUE;
     }
    
    /* Main function does atual processing */
    
    int main (int argc , char *argv[])
    {
        GstElement *pipeline, *video_source, *ducatijpegdec, *rtsp_queue ,*ducatih264enc,*eirtsp_server, *rtsp_sink;     
        GstBus *bus;
        GstMessage *msg;
        GstPadTemplate *tee_src_pad_template;
        GstPad *tee_rtsp_pad, *tee_ovready_pad;
        GstPad *queue_rtsp_pad, *queue_ovready_pad;
        GstCaps *source_caps, *convert_caps, *scale_caps;
        GMainLoop *loop;
        
        gst_init (&argc, &argv);
        loop = g_main_loop_new (NULL, FALSE);
    
        /* Create the elements */
        video_source = gst_element_factory_make ("v4l2src", "video_source");
        ducatijpegdec = gst_element_factory_make ("ducatijpegdec", "ducatijpegdec");
        rtsp_queue = gst_element_factory_make ("queue", "rtsp_queue"); 
        ducatih264enc = gst_element_factory_make ("ducatih264enc", "ducatih264enc");
        eirtsp_server = gst_element_factory_make ("eirtspserver", "eirtsp_server");
        rtsp_sink = gst_element_factory_make ("fakesink", "rtsp_sink");
    
    
    
        /* Set up elements for rtsp_queue */
        g_object_set (G_OBJECT (rtsp_queue), "min-threshold-buffers", 2, NULL);
    
        /* Set up elements for ducatih264enc */
        g_object_set (G_OBJECT (ducatih264enc), "rate-preset", 1, NULL);
    
    
    
        /* Create the empty pipeline */
        pipeline = gst_pipeline_new ("test-pipeline");
    
        if (!pipeline || !video_source || !ducatijpegdec || !rtsp_queue || !ducatih264enc || !eirtsp_server || !rtsp_sink) 
        {
            g_printerr ("Not all elements could be created.\n");
            return -1;
        }
    
    
    
        	/* Link all elements that can be automatically linked because they have "Always" pads */
         	gst_bin_add_many (GST_BIN (pipeline), video_source, ducatijpegdec, rtsp_queue, ducatih264enc, eirtsp_server, rtsp_sink, NULL);
    
      
    	
    	gst_element_link_pads (video_source, "src", ducatijpegdec, "sink");
    	link_source_element_with_filter (video_source, ducatijpegdec);
    	gst_element_link_pads (ducatijpegdec, "src", rtsp_queue, "sink");
    	gst_element_link_pads (rtsp_queue, "src", ducatih264enc, "sink");
    	gst_element_link_pads (ducatih264enc, "src", eirtsp_server, "sink");
    	gst_element_link_pads (eirtsp_server, "src", rtsp_sink, "sink");
    
    
    
    
        	/* Start playing the pipeline */
        	gst_element_set_state (pipeline, GST_STATE_PLAYING);
      	g_main_loop_run (loop);
        
    
    	/* Wait until error or EOS */
       	bus = gst_element_get_bus (pipeline);
        	msg = gst_bus_timed_pop_filtered (bus, GST_CLOCK_TIME_NONE, GST_MESSAGE_ERROR | GST_MESSAGE_EOS);
    
        
    	/* Free resources */
        	if (msg != NULL)
        	{
            	gst_message_unref (msg);
        	}
        	gst_object_unref (bus);
        	gst_element_set_state (pipeline, GST_STATE_NULL);
    
        	gst_object_unref (pipeline);
       	return 0;
    }
    
    
    
    

    ./wtee --gst-debug=4
    
    0:00:00.001442382  1172    0x2b080 INFO                GST_INIT gstmessage.c:119:_priv_gst_message_initialize: init messages
    0:00:00.003466793  1172    0x2b080 INFO                GST_INIT gstcontext.c:77:_priv_gst_context_initialize: init contexts
    0:00:00.004123160  1172    0x2b080 INFO      GST_PLUGIN_LOADING gstplugin.c:316:_priv_gst_plugin_initialize: registering 0 static plugins
    0:00:00.004493882  1172    0x2b080 INFO      GST_PLUGIN_LOADING gstplugin.c:224:gst_plugin_register_static: registered static plugin "staticelements"
    0:00:00.004540568  1172    0x2b080 INFO      GST_PLUGIN_LOADING gstplugin.c:226:gst_plugin_register_static: added static plugin "staticelements", result: 1
    0:00:00.004601731  1172    0x2b080 INFO            GST_REGISTRY gstregistry.c:1723:ensure_current_registry: reading registry cache: /home/root/.cache/gstreamer-1.0/registry.arm.bin
    0:00:00.069891532  1172    0x2b080 INFO            GST_REGISTRY gstregistrybinary.c:619:priv_gst_registry_binary_read_cache: loaded /home/root/.cache/gstreamer-1.0/registry.arm.bin in 0.065226 seconds
    0:00:00.070146271  1172    0x2b080 INFO            GST_REGISTRY gstregistry.c:1579:scan_and_update_registry: Validating plugins from registry cache: /home/root/.cache/gstreamer-1.0/registry.arm.bin
    0:00:00.072738558  1172    0x2b080 INFO            GST_REGISTRY gstregistry.c:1681:scan_and_update_registry: Registry cache has not changed
    0:00:00.072780689  1172    0x2b080 INFO            GST_REGISTRY gstregistry.c:1758:ensure_current_registry: registry reading and updating done, result = 1
    0:00:00.072819892  1172    0x2b080 INFO                GST_INIT gst.c:720:init_post: GLib runtime version: 2.46.2
    0:00:00.072858607  1172    0x2b080 INFO                GST_INIT gst.c:722:init_post: GLib headers version: 2.46.2
    0:00:00.072894232  1172    0x2b080 INFO                GST_INIT gst.c:723:init_post: initialized GStreamer successfully
    0:00:00.086659085  1172    0x2b080 INFO      GST_PLUGIN_LOADING gstplugin.c:842:_priv_gst_plugin_load_file_for_registry: plugin "/usr/lib/gstreamer-1.0/libgstvideo4linux2.so" loaded
    0:00:00.086724965  1172    0x2b080 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:362:gst_element_factory_create: creating element "v4l2src" named "video_source"
    0:00:00.088795086  1172    0x2b080 INFO        GST_ELEMENT_PADS gstelement.c:646:gst_element_add_pad:<GstBaseSrc@0x14a0a0> adding pad 'src'
    0:00:00.098423114  1172    0x2b080 INFO      GST_PLUGIN_LOADING gstplugin.c:842:_priv_gst_plugin_load_file_for_registry: plugin "/usr/lib/gstreamer-1.0/libgstducati.so" loaded
    0:00:00.098485416  1172    0x2b080 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:362:gst_element_factory_create: creating element "ducatijpegdec" named "ducatijpegdec"
    0:00:00.098924621  1172    0x2b080 INFO        GST_ELEMENT_PADS gstelement.c:646:gst_element_add_pad:<GstDucatiVidDec@0x14d000> adding pad 'sink'
    0:00:00.098982043  1172    0x2b080 INFO        GST_ELEMENT_PADS gstelement.c:646:gst_element_add_pad:<GstDucatiVidDec@0x14d000> adding pad 'src'
    0:00:00.100843297  1172    0x2b080 INFO      GST_PLUGIN_LOADING gstplugin.c:842:_priv_gst_plugin_load_file_for_registry: plugin "/usr/lib/gstreamer-1.0/libgstcoreelements.so" loaded
    0:00:00.100897466  1172    0x2b080 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:362:gst_element_factory_create: creating element "queue" named "rtsp_queue"
    0:00:00.101309180  1172    0x2b080 INFO        GST_ELEMENT_PADS gstelement.c:646:gst_element_add_pad:<GstQueue@0x86008> adding pad 'sink'
    0:00:00.101432157  1172    0x2b080 INFO        GST_ELEMENT_PADS gstelement.c:646:gst_element_add_pad:<GstQueue@0x86008> adding pad 'src'
    0:00:00.101497062  1172    0x2b080 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:362:gst_element_factory_create: creating element "ducatih264enc" named "ducatih264enc"
    0:00:00.102054527  1172    0x2b080 INFO        GST_ELEMENT_PADS gstelement.c:646:gst_element_add_pad:<GstVideoEncoder@0x15c0e0> adding pad 'sink'
    0:00:00.102143670  1172    0x2b080 INFO        GST_ELEMENT_PADS gstelement.c:646:gst_element_add_pad:<GstVideoEncoder@0x15c0e0> adding pad 'src'
    0:00:00.104858283  1172    0x2b080 INFO      GST_PLUGIN_LOADING gstplugin.c:842:_priv_gst_plugin_load_file_for_registry: plugin "/usr/lib/gstreamer-1.0/libgsteirtspserver.so" loaded
    0:00:00.104914566  1172    0x2b080 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:362:gst_element_factory_create: creating element "eirtspserver" named "eirtsp_server"
    0:00:00.105239416  1172    0x2b080 INFO        GST_ELEMENT_PADS gstelement.c:646:gst_element_add_pad:<Gsteirtspserver@0x160090> adding pad 'sink'
    0:00:00.105356212  1172    0x2b080 INFO        GST_ELEMENT_PADS gstelement.c:646:gst_element_add_pad:<Gsteirtspserver@0x160090> adding pad 'src'
    0:00:00.105472194  1172    0x2b080 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:362:gst_element_factory_create: creating element "fakesink" named "rtsp_sink"
    0:00:00.105954344  1172    0x2b080 INFO        GST_ELEMENT_PADS gstelement.c:646:gst_element_add_pad:<GstBaseSink@0x1622a0> adding pad 'sink'
    0:00:00.106047553  1172    0x2b080 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:362:gst_element_factory_create: creating element "pipeline" named "test-pipeline"
    0:00:00.106391434  1172    0x2b080 INFO        GST_ELEMENT_PADS gstutils.c:1571:gst_element_link_pads_full: trying to link element video_source:src to element ducatijpegdec:sink
    0:00:00.106448694  1172    0x2b080 INFO        GST_ELEMENT_PADS gstelement.c:897:gst_element_get_static_pad: found pad video_source:src
    0:00:00.106487897  1172    0x2b080 INFO        GST_ELEMENT_PADS gstelement.c:897:gst_element_get_static_pad: found pad ducatijpegdec:sink
    0:00:00.106529377  1172    0x2b080 INFO                GST_PADS gstutils.c:1444:prepare_link_maybe_ghosting: video_source and ducatijpegdec in same bin, no need for ghost pads
    0:00:00.106594282  1172    0x2b080 INFO                GST_PADS gstpad.c:2234:gst_pad_link_prepare: trying to link video_source:src and ducatijpegdec:sink
    0:00:00.106679846  1172    0x2b080 INFO                GST_PADS gstpad.c:2440:gst_pad_link_full: linked video_source:src and ducatijpegdec:sink, successful
    0:00:00.106725881  1172    0x2b080 INFO               GST_EVENT gstevent.c:1374:gst_event_new_reconfigure: creating reconfigure event
    0:00:00.106762644  1172    0x2b080 INFO               GST_EVENT gstpad.c:5502:gst_pad_send_event_unchecked:<video_source:src> Received event on flushing pad. Discarding
    Segmentation fault (core dumped)
    
    

    Regards,

    Prerak

  • Hello,

    Please check my previous post and comment this:
    //gst_element_link_pads (video_source, "src", ducatijpegdec, "sink");
    link_source_element_with_filter (video_source, ducatijpegdec);
    gst_element_link_pads (ducatijpegdec, "src", rtsp_queue, "sink");
    gst_element_link_pads (rtsp_queue, "src", ducatih264enc, "sink");
    gst_element_link_pads (ducatih264enc, "src", eirtsp_server, "sink");
    gst_element_link_pads (eirtsp_server, "src", rtsp_sink, "sink");

    BR
    Margarita
  • Hi,

    I have modified my application as per your suggestion.

    Attached application with logs.

    #include <stdio.h>
    #include <gst/gst.h>
    
    
    
    static gboolean link_source_element_with_filter (GstElement *element1,GstElement *element2)
    
    {
    	/* CAPS to be link:
    	* 'video/x-raw, format=(string)YUY2, width=(int)640, height=(int)720, framerate=10/1'
    	* */
    
    	gboolean link_ok;
    	GstCaps *source_caps;
    
    	source_caps = gst_caps_new_simple ("video/x-raw",
    	"format", G_TYPE_STRING, "YUY2",
    	"width", G_TYPE_INT, 640,
    	"height", G_TYPE_INT, 720,
    	"framerate", G_TYPE_FLOAT, 15/1,
    	NULL);
    	
        	g_object_set (G_OBJECT (element1), "device", "/dev/video1" , NULL);
    	link_ok = gst_element_link_filtered (element1, element2, source_caps);
    	gst_caps_unref (source_caps);
    
    	if (!link_ok) 
    	{
    		g_warning ("Failed to link element1 and element2!(v4l2src->jpegdec)");
    	}
    	return link_ok;
    
    }
    
    
    static gboolean link_scale_element_with_filter (GstElement *element1,GstElement *element2)
    
    {
    	/* CAPS to be link:
    	* video/x-raw , format=NV12 , height=240 , width=320
    	* */
    
    	gboolean link_ok;
    	GstCaps *scale_caps;
    
    	scale_caps = gst_caps_new_simple ("video/x-raw",
    	"format", G_TYPE_STRING, "NV12",
    	"width", G_TYPE_INT, 320,
    	"height", G_TYPE_INT, 240,
    	NULL);
    
    	
    	link_ok = gst_element_link_filtered (element1, element2, scale_caps);
    	gst_caps_unref (scale_caps);
    
    	if (!link_ok) 
    	{
    		g_warning ("Failed to link element1 and element2!(videoscale->videoconvert)");
    	}
    	return link_ok;
    
    }
    
    static gboolean link_convert_element_with_filter (GstElement *element1,GstElement *element2)
    
    {
    	/* CAPS to be link:
    	* video/x-raw , format=Y444, height=240 , width=320
    	* */
    
    	gboolean link_ok;
    	GstCaps *convert_caps;
    
    	/* convert_caps */
    	convert_caps = gst_caps_new_simple ("video/x-raw",
    	"format", G_TYPE_STRING, "Y444",
    	"width", G_TYPE_INT, 320,
    	"height", G_TYPE_INT, 240,
    	NULL);
    
    	link_ok = gst_element_link_filtered (element1, element2, convert_caps);
    	gst_caps_unref (convert_caps);
    
    	if (!link_ok) 
    	{
    		g_warning ("Failed to link element1 and element2!(videoconvert->plugin1)");
    	}
    	return link_ok;
    
    }
    
    
    
    
    
    /* BUS function for ERROR */
    
    static gboolean bus_call(GstBus *bus, GstMessage *msg, gpointer data)
    {
        GMainLoop *loop = (GMainLoop *) data;
        switch (GST_MESSAGE_TYPE (msg)) 
        {
            case GST_MESSAGE_EOS:
                g_print ("End of stream\n");
                g_main_loop_quit (loop);
                break;
     
            case GST_MESSAGE_ERROR: 
            {
                gchar  *debug;
                GError *error;
                gst_message_parse_error (msg, &error, &debug);
                g_free (debug);
                g_printerr ("Error: %s\n", error->message);
                g_error_free (error);
                g_main_loop_quit (loop);
                break;
            }
    
            default:
            break;
        }
     
        return TRUE;
     }
    
    /* Main function does atual processing */
    
    int main (int argc , char *argv[])
    {
        GstElement *pipeline, *video_source, *filter_source, *ducatijpegdec, *tee, *rtsp_queue, *ducatih264enc, *eirtsp_server, *rtsp_sink;    
        GstElement *ovready_queue, *video_crop, *video_scale, *filter_scale, *video_convert, *filter_convert, *ei_ovready, *ovready_sink; 
        GstBus *bus;
        GstMessage *msg;
        GstPadTemplate *tee_src_pad_template;
        GstPad *tee_rtsp_pad, *tee_ovready_pad;
        GstPad *queue_rtsp_pad, *queue_ovready_pad;
        GstCaps *source_caps, *convert_caps, *scale_caps;
        GMainLoop *loop;
        gst_init (&argc, &argv);
        loop = g_main_loop_new (NULL, FALSE);
        
        /* Create the elements */
        video_source = gst_element_factory_make ("v4l2src", "video_source");
        ducatijpegdec = gst_element_factory_make ("ducatijpegdec", "ducatijpegdec");
        
        tee = gst_element_factory_make ("tee", "tee");
    
        /* ovready thread */    
        ovready_queue = gst_element_factory_make ("queue", "ovready_queue"); 
        video_crop = gst_element_factory_make ("videocrop", "video_crop");
        video_scale = gst_element_factory_make ("videoscale", "video_scale");
        video_convert = gst_element_factory_make ("videoconvert", "video_convert");
        ei_ovready = gst_element_factory_make ("eiovready", "ei_ovready");
        ovready_sink = gst_element_factory_make ("fakesink", "ovready_sink");
    
        /* rtsp thread */
        rtsp_queue = gst_element_factory_make ("queue", "rtsp_queue"); 
        ducatih264enc = gst_element_factory_make ("ducatih264enc", "ducatih264enc");
        eirtsp_server = gst_element_factory_make ("eirtspserver", "eirtsp_server");
        rtsp_sink = gst_element_factory_make ("fakesink", "rtsp_sink");
    
    
    
    
    
    
        /* Set up elements for rtsp_queue */
        g_object_set (G_OBJECT (rtsp_queue), "min-threshold-buffers", 2, NULL);
    
        /* Set up elements for ducatih264enc */
        g_object_set (G_OBJECT (ducatih264enc), "rate-preset", 1, NULL);
    
    
        /* Set up elements for video_crop */
        g_object_set (G_OBJECT (video_crop), "left", 2016, NULL);
    
        
        /* Set up elements for video_crop */
        g_object_set (G_OBJECT (video_crop), "right", 1008, NULL);
    
    
        /* Create the empty pipeline */
        pipeline = gst_pipeline_new ("test-pipeline");
    
        if (!pipeline || !video_source || !filter_source || !ducatijpegdec || !tee || !ovready_queue || !video_crop || !video_scale || !filter_scale || !video_convert || !filter_convert || !ei_ovready || !ovready_sink || !rtsp_queue || !ducatih264enc || !eirtsp_server || !rtsp_sink) 
        {
            g_printerr ("Not all elements could be created.\n");
            return -1;
        }
    
    
    
        /* Link all elements that can be automatically linked because they have "Always" pads */
         gst_bin_add_many (GST_BIN (pipeline), video_source, ducatijpegdec, tee, ovready_queue, video_crop, video_scale, video_convert, ei_ovready, ovready_sink, rtsp_queue, ducatih264enc, eirtsp_server, rtsp_sink, NULL);
    
      
    
    
    //	gst_element_link_pads (video_source, "src", ducatijpegdec, "sink");
    	link_source_element_with_filter (video_source, ducatijpegdec);
    	gst_element_link_pads (ducatijpegdec, "src", tee, "sink");
    	gst_element_link_pads (tee, "src", ovready_queue, "sink");
    	gst_element_link_pads (ovready_queue, "src", video_crop, "sink");
    	gst_element_link_pads (video_crop, "src", video_scale, "sink");
    //	gst_element_link_pads (video_scale, "src",video_convert, "sink");
    	link_scale_element_with_filter (video_scale, video_convert);
    //	gst_element_link_pads (video_convert, "src", ei_ovready, "sink");
    	link_convert_element_with_filter (video_convert, ei_ovready);
    	gst_element_link_pads (ei_ovready, "src", ovready_sink, "sink");
    	gst_element_link_pads (tee, "src", rtsp_queue, "sink");
    	gst_element_link_pads (rtsp_queue, "src", ducatih264enc, "sink");
    	gst_element_link_pads (ducatih264enc, "src", eirtsp_server, "sink");
    	gst_element_link_pads (eirtsp_server, "src", rtsp_sink, "sink");
    
    
        /* Manually link the Tee, which has "Request" pads */
        tee_src_pad_template = gst_element_class_get_pad_template (GST_ELEMENT_GET_CLASS (tee), "src_%u");
        tee_ovready_pad = gst_element_request_pad (tee, tee_src_pad_template, NULL, NULL);
        g_print ("Obtained request pad %s for audio branch.\n", gst_pad_get_name (tee_ovready_pad));
        queue_ovready_pad = gst_element_get_static_pad (ovready_queue, "sink");
        tee_rtsp_pad = gst_element_request_pad (tee, tee_src_pad_template, NULL, NULL);
        g_print ("Obtained request pad %s for video branch.\n", gst_pad_get_name (tee_rtsp_pad));
        queue_rtsp_pad = gst_element_get_static_pad (rtsp_queue, "sink");
        if (gst_pad_link (tee_ovready_pad, queue_ovready_pad) != GST_PAD_LINK_OK || gst_pad_link (tee_rtsp_pad, queue_rtsp_pad) != GST_PAD_LINK_OK) 
        {
            g_printerr ("Tee could not be linked.\n");
            gst_object_unref (pipeline);
            return -1;
        }
        gst_object_unref (queue_ovready_pad);
        gst_object_unref (queue_rtsp_pad);
    
    
        /* Start playing the pipeline */
        gst_element_set_state (pipeline, GST_STATE_PLAYING);
        g_main_loop_run (loop);
        
    
       /* Wait until error or EOS */
       bus = gst_element_get_bus (pipeline);
       msg = gst_bus_timed_pop_filtered (bus, GST_CLOCK_TIME_NONE, GST_MESSAGE_ERROR | GST_MESSAGE_EOS);
    
        /* Release the request pads from the Tee, and unref them */
        gst_element_release_request_pad (tee, tee_ovready_pad);
        gst_element_release_request_pad (tee, tee_rtsp_pad);
        gst_object_unref (tee_ovready_pad);
        gst_object_unref (tee_rtsp_pad);
    
        /* Free resources */
        if (msg != NULL)
        {
            gst_message_unref (msg);
        }
        gst_object_unref (bus);
        gst_element_set_state (pipeline, GST_STATE_NULL);
    
        gst_object_unref (pipeline);
        return 0;
    }
    
    
    
    

    4747.debug_6_logs.txt

    Regards,

    Prerak

  • Hello,

    What about the app without the tee is it working when you comment the first line?

    BR
    Margarita
  • Hi Margarita,

    I had sent content to you before receiving your modification.

    I have modified without_tee application as per your latest suggestion.

    Getting same error as i get in G3Zstreaming_modified.c with debug level 6.

    Regards,
    Prerak
  • Hello,

    Ok let's try first to run the application without the tee element.
    The pipeline that you are building in it did you test it with gst-launch first?
    Could you modify the application without the tee by removing the eirtsp_server element. Just connect the enc output to fakesink.

    BR
    Margarita
  • Hi,

    The pipeline that you are building in it did you test it with gst-launch first?
    Ans: yes i have tested that pipeline with gst-launch. it is working fine.

    Could you modify the application without the tee by removing the eirtsp_server element. Just connect the enc output to fakesink.

    I have modified application as per your suggestion. Attached the same with logs of debug level 6.

    #include <stdio.h>
    #include <gst/gst.h>
    
    
    
    static gboolean link_source_element_with_filter (GstElement *element1,GstElement *element2)
    
    {
    	/* CAPS to be link:
    	* 'video/x-raw, format=(string)YUY2, width=(int)640, height=(int)720, framerate=10/1'
    	* */
    
    	gboolean link_ok;
    	GstCaps *source_caps;
    
    	source_caps = gst_caps_new_simple ("video/x-raw",
    	"format", G_TYPE_STRING, "YUY2",
    	"width", G_TYPE_INT, 640,
    	"height", G_TYPE_INT, 720,
    	"framerate", G_TYPE_FLOAT, 15/1,
    	NULL);
    	
        	g_object_set (G_OBJECT (element1), "device", "/dev/video1" , NULL);
    	link_ok = gst_element_link_filtered (element1, element2, source_caps);
    	gst_caps_unref (source_caps);
    
    	if (!link_ok) 
    	{
    		g_warning ("Failed to link element1 and element2!(v4l2src->jpegdec)");
    	}
    	return link_ok;
    
    }
    
    
    /* BUS function for ERROR */
    
    static gboolean bus_call(GstBus *bus, GstMessage *msg, gpointer data)
    {
        GMainLoop *loop = (GMainLoop *) data;
        switch (GST_MESSAGE_TYPE (msg)) 
        {
            case GST_MESSAGE_EOS:
                g_print ("End of stream\n");
                g_main_loop_quit (loop);
                break;
     
            case GST_MESSAGE_ERROR: 
            {
                gchar  *debug;
                GError *error;
                gst_message_parse_error (msg, &error, &debug);
                g_free (debug);
                g_printerr ("Error: %s\n", error->message);
                g_error_free (error);
                g_main_loop_quit (loop);
                break;
            }
    
            default:
            break;
        }
     
        return TRUE;
     }
    
    /* Main function does atual processing */
    
    int main (int argc , char *argv[])
    {
        GstElement *pipeline, *video_source, *ducatijpegdec, *rtsp_queue ,*ducatih264enc,*eirtsp_server, *rtsp_sink;     
        GstBus *bus;
        GstMessage *msg;
        GstPadTemplate *tee_src_pad_template;
        GstPad *tee_rtsp_pad, *tee_ovready_pad;
        GstPad *queue_rtsp_pad, *queue_ovready_pad;
        GstCaps *source_caps, *convert_caps, *scale_caps;
        GMainLoop *loop;
        
        gst_init (&argc, &argv);
        loop = g_main_loop_new (NULL, FALSE);
    
        /* Create the elements */
        video_source = gst_element_factory_make ("v4l2src", "video_source");
        ducatijpegdec = gst_element_factory_make ("ducatijpegdec", "ducatijpegdec");
        rtsp_queue = gst_element_factory_make ("queue", "rtsp_queue"); 
        ducatih264enc = gst_element_factory_make ("ducatih264enc", "ducatih264enc");
    //    eirtsp_server = gst_element_factory_make ("eirtspserver", "eirtsp_server");
        rtsp_sink = gst_element_factory_make ("fakesink", "rtsp_sink");
    
    
    
        /* Set up elements for rtsp_queue */
        g_object_set (G_OBJECT (rtsp_queue), "min-threshold-buffers", 2, NULL);
    
        /* Set up elements for ducatih264enc */
        g_object_set (G_OBJECT (ducatih264enc), "rate-preset", 1, NULL);
    
    
    
        /* Create the empty pipeline */
        pipeline = gst_pipeline_new ("test-pipeline");
    
    //    if (!pipeline || !video_source || !ducatijpegdec || !rtsp_queue || !ducatih264enc || !eirtsp_server || !rtsp_sink) 
        if (!pipeline || !video_source || !ducatijpegdec || !rtsp_queue || !ducatih264enc || !rtsp_sink) 
        {
            g_printerr ("Not all elements could be created.\n");
            return -1;
        }
    
    
    
        	/* Link all elements that can be automatically linked because they have "Always" pads */
    //     	gst_bin_add_many (GST_BIN (pipeline), video_source, ducatijpegdec, rtsp_queue, ducatih264enc, eirtsp_server, rtsp_sink, NULL);
         	gst_bin_add_many (GST_BIN (pipeline), video_source, ducatijpegdec, rtsp_queue, ducatih264enc, rtsp_sink, NULL);
    
      
    	
    //	gst_element_link_pads (video_source, "src", ducatijpegdec, "sink");
    	link_source_element_with_filter (video_source, ducatijpegdec);
    	gst_element_link_pads (ducatijpegdec, "src", rtsp_queue, "sink");
    	gst_element_link_pads (rtsp_queue, "src", ducatih264enc, "sink");
    	gst_element_link_pads (ducatih264enc, "src", rtsp_sink, "sink");
    //	gst_element_link_pads (eirtsp_server, "src", rtsp_sink, "sink");
    
    
    
    
        	/* Start playing the pipeline */
        	gst_element_set_state (pipeline, GST_STATE_PLAYING);
      	g_main_loop_run (loop);
        
    
    	/* Wait until error or EOS */
       	bus = gst_element_get_bus (pipeline);
        	msg = gst_bus_timed_pop_filtered (bus, GST_CLOCK_TIME_NONE, GST_MESSAGE_ERROR | GST_MESSAGE_EOS);
    
        
    	/* Free resources */
        	if (msg != NULL)
        	{
            	gst_message_unref (msg);
        	}
        	gst_object_unref (bus);
        	gst_element_set_state (pipeline, GST_STATE_NULL);
    
        	gst_object_unref (pipeline);
       	return 0;
    }
    
    
    
    

    7416.without_tee_logs.txt

    Regards,

    Prerak

  • Hello,

    This line :
    g_object_set (G_OBJECT (element1), "device", "/dev/video1" , NULL);

    should be not in the function :link_source_element_with_filter

    link_source_element_with_filter

    Please replace it here for example:
    video_source = gst_element_factory_make ("v4l2src", "video_source");
    g_object_set (G_OBJECT (video_source), "device", "/dev/video1" , NULL);
    ducatijpegdec = gst_element_factory_make ("ducatijpegdec", "ducatijpegdec");

    The simple gst flow should be:
    Create elements;
    Set the properties;
    Add elements to the pipeline;
    Link the elements;
    Move to playing.

    If does not work again please share gst debug 2 and 4.

    BR
    Margarita

  • Hi,

    Till debug level 3 there is nothing comes.

    I am sharing logs with debug 4.

    ./wtee --gst-debug=4
    0:00:00.001344445  1161    0x2b080 INFO                GST_INIT gstmessage.c:119:_priv_gst_message_initialize: init messages
    0:00:00.003378599  1161    0x2b080 INFO                GST_INIT gstcontext.c:77:_priv_gst_context_initialize: init contexts
    0:00:00.004030244  1161    0x2b080 INFO      GST_PLUGIN_LOADING gstplugin.c:316:_priv_gst_plugin_initialize: registering 0 static plugins
    0:00:00.004400638  1161    0x2b080 INFO      GST_PLUGIN_LOADING gstplugin.c:224:gst_plugin_register_static: registered static plugin "staticelements"
    0:00:00.004447974  1161    0x2b080 INFO      GST_PLUGIN_LOADING gstplugin.c:226:gst_plugin_register_static: added static plugin "staticelements", result: 1
    0:00:00.004507185  1161    0x2b080 INFO            GST_REGISTRY gstregistry.c:1723:ensure_current_registry: reading registry cache: /home/root/.cache/gstreamer-1.0/registry.arm.bin
    0:00:00.076487444  1161    0x2b080 INFO            GST_REGISTRY gstregistrybinary.c:619:priv_gst_registry_binary_read_cache: loaded /home/root/.cache/gstreamer-1.0/registry.arm.bin in 0.071918 seconds
    0:00:00.076711762  1161    0x2b080 INFO            GST_REGISTRY gstregistry.c:1579:scan_and_update_registry: Validating plugins from registry cache: /home/root/.cache/gstreamer-1.0/registry.arm.bin
    0:00:00.079083288  1161    0x2b080 INFO            GST_REGISTRY gstregistry.c:1681:scan_and_update_registry: Registry cache has not changed
    0:00:00.079121515  1161    0x2b080 INFO            GST_REGISTRY gstregistry.c:1758:ensure_current_registry: registry reading and updating done, result = 1
    0:00:00.079155024  1161    0x2b080 INFO                GST_INIT gst.c:720:init_post: GLib runtime version: 2.46.2
    0:00:00.079187720  1161    0x2b080 INFO                GST_INIT gst.c:722:init_post: GLib headers version: 2.46.2
    0:00:00.079219278  1161    0x2b080 INFO                GST_INIT gst.c:723:init_post: initialized GStreamer successfully
    0:00:00.091417857  1161    0x2b080 INFO      GST_PLUGIN_LOADING gstplugin.c:842:_priv_gst_plugin_load_file_for_registry: plugin "/usr/lib/gstreamer-1.0/libgstvideo4linux2.so" loaded
    0:00:00.091478370  1161    0x2b080 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:362:gst_element_factory_create: creating element "v4l2src" named "video_source"
    0:00:00.093384505  1161    0x2b080 INFO        GST_ELEMENT_PADS gstelement.c:646:gst_element_add_pad:<GstBaseSrc@0x14a0a0> adding pad 'src'
    0:00:00.095239725  1161    0x2b080 INFO      GST_PLUGIN_LOADING gstplugin.c:842:_priv_gst_plugin_load_file_for_registry: plugin "/usr/lib/gstreamer-1.0/libgstducati.so" loaded
    0:00:00.095287386  1161    0x2b080 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:362:gst_element_factory_create: creating element "ducatijpegdec" named "ducatijpegdec"
    0:00:00.095662822  1161    0x2b080 INFO        GST_ELEMENT_PADS gstelement.c:646:gst_element_add_pad:<GstDucatiVidDec@0x14d000> adding pad 'sink'
    0:00:00.095710484  1161    0x2b080 INFO        GST_ELEMENT_PADS gstelement.c:646:gst_element_add_pad:<GstDucatiVidDec@0x14d000> adding pad 'src'
    0:00:00.097280548  1161    0x2b080 INFO      GST_PLUGIN_LOADING gstplugin.c:842:_priv_gst_plugin_load_file_for_registry: plugin "/usr/lib/gstreamer-1.0/libgstcoreelements.so" loaded
    0:00:00.097328535  1161    0x2b080 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:362:gst_element_factory_create: creating element "queue" named "rtsp_queue"
    0:00:00.097687053  1161    0x2b080 INFO        GST_ELEMENT_PADS gstelement.c:646:gst_element_add_pad:<GstQueue@0x74008> adding pad 'sink'
    0:00:00.097788232  1161    0x2b080 INFO        GST_ELEMENT_PADS gstelement.c:646:gst_element_add_pad:<GstQueue@0x74008> adding pad 'src'
    0:00:00.097855089  1161    0x2b080 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:362:gst_element_factory_create: creating element "ducatih264enc" named "ducatih264enc"
    0:00:00.098384571  1161    0x2b080 INFO        GST_ELEMENT_PADS gstelement.c:646:gst_element_add_pad:<GstVideoEncoder@0x15c0e0> adding pad 'sink'
    0:00:00.098457771  1161    0x2b080 INFO        GST_ELEMENT_PADS gstelement.c:646:gst_element_add_pad:<GstVideoEncoder@0x15c0e0> adding pad 'src'
    0:00:00.098519584  1161    0x2b080 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:362:gst_element_factory_create: creating element "fakesink" named "rtsp_sink"
    0:00:00.098929994  1161    0x2b080 INFO        GST_ELEMENT_PADS gstelement.c:646:gst_element_add_pad:<GstBaseSink@0x160290> adding pad 'sink'
    0:00:00.098987090  1161    0x2b080 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:362:gst_element_factory_create: creating element "pipeline" named "test-pipeline"
    
    

    Regards,

    Prerak

  • Hi Margarita,

    I was debugging code and found one issue.

    I made application of
    gst-launch-1.0 v4l2src device =/dev/video1 ! 'video/x-raw, format=(string)YUY2, width=(int)640, height=(int)720, framerate=15/1' ! fakesink

    and it also gives same error as previous.

    I think we have problem to making video_source element . do you know any another way to make video_source element with v4l2src. Because i do not find any example code for that.

    Regards,
    Prerak

  • Hello,

    Please, could you post the command that you are using to compile the app?
    I would recommend you to try only with v4l2src ! capsfilter ! fakesink.
    Let me know the result.

    If this case does not work share the code please.

    BR
    Margarita

  • Hi,

    Command for compilation is :

    gcc without_tee.c -o wtee `pkg-config --libs --cflags gstreamer-1.0`

     

    "I would recommend you to try only with v4l2src ! capsfilter ! fakesink. "

    i have already tried this as said in my previous comment.

    Getting same result for that. Atteching code below.

    #include <stdio.h>
    #include <gst/gst.h>
    
    
    
    static gboolean link_source_element_with_filter (GstElement *element1,GstElement *element2)
    
    {
    	/* CAPS to be link:
    	* 'video/x-raw, format=(string)YUY2, width=(int)640, height=(int)720, framerate=10/1'
    	* */
    
    	gboolean link_ok;
    	GstCaps *source_caps;
    
    	source_caps = gst_caps_new_simple ("video/x-raw",
    	"format", G_TYPE_STRING, "YUY2",
    	"width", G_TYPE_INT, 640,
    	"height", G_TYPE_INT, 720,
    	"framerate", G_TYPE_FLOAT, 15/1,
    	NULL);
    	
    	link_ok = gst_element_link_filtered (element1, element2, source_caps);
    	gst_caps_unref (source_caps);
    
    	if (!link_ok) 
    	{
    		g_warning ("Failed to link element1 and element2!(v4l2src->jpegdec)");
    	}
    	return link_ok;
    
    }
    
    
    /* BUS function for ERROR */
    
    static gboolean bus_call(GstBus *bus, GstMessage *msg, gpointer data)
    {
        GMainLoop *loop = (GMainLoop *) data;
        switch (GST_MESSAGE_TYPE (msg)) 
        {
            case GST_MESSAGE_EOS:
                g_print ("End of stream\n");
                g_main_loop_quit (loop);
                break;
     
            case GST_MESSAGE_ERROR: 
            {
                gchar  *debug;
                GError *error;
                gst_message_parse_error (msg, &error, &debug);
                g_free (debug);
                g_printerr ("Error: %s\n", error->message);
                g_error_free (error);
                g_main_loop_quit (loop);
                break;
            }
    
            default:
            break;
        }
     
        return TRUE;
     }
    
    /* Main function does atual processing */
    
    int main (int argc , char *argv[])
    {
        GstElement *pipeline, *video_source, *rtsp_sink;     
        GstBus *bus;
        GstMessage *msg;
        GstPadTemplate *tee_src_pad_template;
        GstPad *tee_rtsp_pad, *tee_ovready_pad;
        GstPad *queue_rtsp_pad, *queue_ovready_pad;
        GstCaps *source_caps, *convert_caps, *scale_caps;
        GMainLoop *loop;
        
        gst_init (&argc, &argv);
        loop = g_main_loop_new (NULL, FALSE);
    
        /* Create the elements */
        video_source = gst_element_factory_make ("v4l2src", "video_source");
        g_object_set (video_source, "device", "/dev/video1", NULL);
        rtsp_sink = gst_element_factory_make ("fakesink", "rtsp_sink");
    
    
    
        /* Set up elements for rtsp_queue */
    
        /* Set up elements for ducatih264enc */
    
    
    
        /* Create the empty pipeline */
        pipeline = gst_pipeline_new ("test-pipeline");
    
        if (!pipeline || !video_source || !rtsp_sink) 
        {
            g_printerr ("Not all elements could be created.\n");
            return -1;
        }
    
    
    
        	/* Link all elements that can be automatically linked because they have "Always" pads */
         	gst_bin_add_many (GST_BIN (pipeline), video_source, rtsp_sink, NULL);
    
      
    	
    	link_source_element_with_filter (video_source, rtsp_sink);
    
    
    
    
        	/* Start playing the pipeline */
        	gst_element_set_state (pipeline, GST_STATE_PLAYING);
      	g_main_loop_run (loop);
        
    
    	/* Wait until error or EOS */
       	bus = gst_element_get_bus (pipeline);
        	msg = gst_bus_timed_pop_filtered (bus, GST_CLOCK_TIME_NONE, GST_MESSAGE_ERROR | GST_MESSAGE_EOS);
    
        
    	/* Free resources */
        	if (msg != NULL)
        	{
            	gst_message_unref (msg);
        	}
        	gst_object_unref (bus);
        	gst_element_set_state (pipeline, GST_STATE_NULL);
    
        	gst_object_unref (pipeline);
       	return 0;
    }
    
    
    
    

    Regards,

    Prerak

  • Hello,

    I am confused. This command gcc without_tee.c -o wtee `pkg-config --libs --cflags gstreamer-1.0` seems like you are building the application for PC not for arm.
    Where you are executing this command?
    On board or on PC?
    The code seems fine it should work. Are you sure this is the correct caps filter(verify it with gst-launch):
    'video/x-raw, format=(string)YUY2, width=(int)640, height=(int)720, framerate=15/1'

    BR
    Margarita
  • Hi Margarita,

    I am executing command on board.

    Yes i am sure , i have tested this command with gst-launch so many times with same caps.

    i have find issue with v4l2src while debugging.

    i have run application with  ./wtee --gst-debug=*v4l2*:5  (till level 4 it nothing seems).

    i have seen below logs.

    0:00:00.082946232  1319   0x13c080 DEBUG                   v4l2 gstv4l2.c:156:gst_v4l2_probe_and_register: Probing 'vpe' located at '/dev/video0'

    0:00:00.083052128  1319   0x13c080 DEBUG                   v4l2 gstv4l2.c:66:gst_v4l2_probe_template_caps: Getting /dev/video0 format enumerations

    0:00:00.083107434  1319   0x13c080 DEBUG                   v4l2 gstv4l2.c:66:gst_v4l2_probe_template_caps: Getting /dev/video0 format enumerations

    0:00:00.083149727  1319   0x13c080 DEBUG                   v4l2 gstv4l2object.c:1348:gst_v4l2_object_v4l2fourcc_to_bare_struct: Unknown fourcc 0x3631564e NV16

    0:00:00.083381527  1319   0x13c080 DEBUG                   v4l2 gstv4l2.c:66:gst_v4l2_probe_template_caps: Getting /dev/video0 format enumerations

    0:00:00.083426423  1319   0x13c080 DEBUG                   v4l2 gstv4l2.c:66:gst_v4l2_probe_template_caps: Getting /dev/video0 format enumerations

    0:00:00.083474410  1319   0x13c080 DEBUG                   v4l2 gstv4l2object.c:1348:gst_v4l2_object_v4l2fourcc_to_bare_struct: Unknown fourcc 0x3631564e NV16

    0:00:00.084270011  1319   0x13c080 DEBUG                   v4l2 gstv4l2object.c:1348:gst_v4l2_object_v4l2fourcc_to_bare_struct: Unknown fourcc 0x50313459 Y41P

    0:00:00.086061457  1319   0x13c080 DEBUG                   v4l2 gstv4l2.c:156:gst_v4l2_probe_and_register: Probing 'omapwb-m2m' located at '/dev/video10'

    0:00:00.086106190  1319   0x13c080 DEBUG                   v4l2 gstv4l2.c:66:gst_v4l2_probe_template_caps: Getting /dev/video10 format enumerations

    0:00:00.086144905  1319   0x13c080 DEBUG                   v4l2 gstv4l2.c:66:gst_v4l2_probe_template_caps: Getting /dev/video10 format enumerations

    0:00:00.086224449  1319   0x13c080 DEBUG                   v4l2 gstv4l2object.c:1348:gst_v4l2_object_v4l2fourcc_to_bare_struct: Unknown fourcc 0x34325258 XR24

    0:00:00.086309361  1319   0x13c080 DEBUG                   v4l2 gstv4l2.c:66:gst_v4l2_probe_template_caps: Getting /dev/video10 format enumerations

    0:00:00.086347913  1319   0x13c080 DEBUG                   v4l2 gstv4l2.c:66:gst_v4l2_probe_template_caps: Getting /dev/video10 format enumerations

    0:00:00.086419486  1319   0x13c080 DEBUG                   v4l2 gstv4l2object.c:1348:gst_v4l2_object_v4l2fourcc_to_bare_struct: Unknown fourcc 0x34325258 XR24

    0:00:00.087675759  1319   0x13c080 DEBUG                   v4l2 gstv4l2object.c:1348:gst_v4l2_object_v4l2fourcc_to_bare_struct: Unknown fourcc 0x50313459 Y41P

    By that ,it looks like /dev/video1 is not setting. so may be error in setting the property of v4l2src

       g_object_set (video_source, "device", "/dev/video1", NULL);

    As per my thinking , there should be something different line inplace of above.

    Regards,

    Prerak

  • Yes, it seems like you are right. Let me check please.

    BR
    Margarita
  • Hello,

    Could you try to replace :
    g_object_set (video_source, "device", "/dev/video1", NULL);

    with

    gst_util_set_object_arg (G_OBJECT (video_source), "device", "/dev/video1");

    BR
    Margarita
  • Hi,

    I had replaced as per your suggestion, but same error comes.

    Regards,
    Prerak
  • Hello,

    Could you try to comment the framerate in the capsfilter function?
    //"framerate", G_TYPE_FLOAT, 5/1,

    BR
    Margarita
  • Hi Margarita,

    i have replace

    "framerate", G_TYPE_FLOAT, 15/1,

    with

    "framerate",GST_TYPE_FRACTION, 15, 1,

    and every thing works fine. :)

    Thank you so much for your quick support.

    Regards,
    Prerak
  • Hello,

    I am glad that this issue is solved.
    Could you let me know which application is working without tee or the another one?

    BR
    Margarita
  • Hi Margarita,

    Both applications are working. (with tee element and without tee element)

    Regards,
    Prerak