justinjoy / gst-android-camera

GNU Lesser General Public License v2.1
32 stars 9 forks source link

gst_element_factory_make no such element factory "udpsink " #9

Closed sofien4387 closed 4 years ago

sofien4387 commented 4 years ago

Thank you for tutorial demo application, i tried to add the udp connection via the pipeline and TEE element , but i have an error of undefined element udpsink : 2020-02-03 12:54:14.426 21116-21240/org.freedesktop.gstreamer.examples.camera W/GStreamer+GST_ELEMENT_FACTORY: 0:00:00.475321500 0xe0446020 gstelementfactory.c:456:gst_element_factory_make no such element factory "udpsink "!

Gstreamer Version : gstreamer-1.0-android-universal-1.12.1 Ndk Version : android-ndk-r15c

justinjoy commented 4 years ago

it's strange error because udpsink is a part of gst-plugins-good. If you modified some part of codes, could you share more log? or what pipeline are you using?

sofien4387 commented 4 years ago

On my code, i want to create two queue related by a Tee element : first queue for display preview of the camera and the second to be used for send the src data by the udp

  ahc->ahcsrc = gst_element_factory_make ("ahcsrc", "ahcsrc");
  ahc->vsink = gst_element_factory_make ("glimagesink", "vsink");
  ahc->filter = gst_element_factory_make ("capsfilter", NULL);
  GstElement* udpsink = gst_element_factory_make ("udpsink ", NULL);

  ahc->video_queue = gst_element_factory_make ("queue", "video_queue");
  ahc->udp_queue = gst_element_factory_make ("queue", "udp_queue");

  ahc->tee = gst_element_factory_make ("tee", "tee");

  ahc->pipeline = gst_pipeline_new ("camera-pipeline");

  __android_log_print(ANDROID_LOG_DEBUG, "ahc", "\n ahc->pipeline %d \n", !(ahc->pipeline));
  __android_log_print(ANDROID_LOG_DEBUG, "ahc","ahc->ahcsrc %d", !(ahc->ahcsrc));
  __android_log_print(ANDROID_LOG_DEBUG, "ahc","ahc->vsink %d", !(ahc->vsink));
  __android_log_print(ANDROID_LOG_DEBUG, "ahc","ahc->filter %d", !(ahc->filter));
  __android_log_print(ANDROID_LOG_DEBUG, "ahc","ahc->udpsink %d", !(udpsink));
  __android_log_print(ANDROID_LOG_DEBUG, "ahc","ahc->video_queue %d", !(ahc->video_queue));
  __android_log_print(ANDROID_LOG_DEBUG, "ahc","ahc->udp_queue %d", !(ahc->udp_queue));
  __android_log_print(ANDROID_LOG_DEBUG, "ahc","ahc->tee %d", !(ahc->tee));

  if (!ahc->pipeline || !ahc->ahcsrc || !ahc->vsink || !ahc->filter || !udpsink || !ahc->video_queue || !ahc->udp_queue || !ahc->tee) {
    g_printerr ("Not all elements could be created.\n");
    return -1;
  }

  g_object_set (udpsink, "host", "192.168.43.3", "port", 4445, "sync", "false", NULL);

    gst_bin_add_many (GST_BIN (ahc->pipeline),
    ahc->ahcsrc,
    ahc->tee,
    ahc->video_queue,
    ahc->filter, 
    ahc->vsink,
    ahc->udp_queue,
    udpsink,
    NULL);

the log :

2020-02-03 12:54:14.420 21116-21240/org.freedesktop.gstreamer.examples.camera I/GStreamer+GST_PADS: 0:00:00.469382334 0xe0446020 gstpad.c:4115:gst_pad_peer_query:<(NULL):sink> pad has no peer
2020-02-03 12:54:14.425 21116-21240/org.freedesktop.gstreamer.examples.camera I/GStreamer+GST_PADS: 0:00:00.474866000 0xe0446020 gstpad.c:2524:gst_pad_link_full linked glcolorbalance0:src and sink:sink, successful
2020-02-03 12:54:14.425 21116-21240/org.freedesktop.gstreamer.examples.camera I/GStreamer+GST_EVENT: 0:00:00.474938167 0xe0446020 gstevent.c:1512:gst_event_new_reconfigure creating reconfigure event
2020-02-03 12:54:14.425 21116-21240/org.freedesktop.gstreamer.examples.camera I/GStreamer+GST_EVENT: 0:00:00.474983584 0xe0446020 gstpad.c:5655:gst_pad_send_event_unchecked:<glcolorbalance0:src> Received event on flushing pad. Discarding
2020-02-03 12:54:14.425 21116-21240/org.freedesktop.gstreamer.examples.camera I/GStreamer+GST_ELEMENT_FACTORY: 0:00:00.475087042 0xe0446020 gstelementfactory.c:361:gst_element_factory_create creating element "capsfilter"
2020-02-03 12:54:14.425 21116-21240/org.freedesktop.gstreamer.examples.camera I/GStreamer+GST_ELEMENT_PADS: 0:00:00.475198167 0xe0446020 gstelement.c:670:gst_element_add_pad:<GstBaseTransform@0xd9bc8138> adding pad 'sink'
2020-02-03 12:54:14.426 21116-21240/org.freedesktop.gstreamer.examples.camera I/GStreamer+GST_ELEMENT_PADS: 0:00:00.475268750 0xe0446020 gstelement.c:670:gst_element_add_pad:<GstBaseTransform@0xd9bc8138> adding pad 'src'
2020-02-03 12:54:14.426 21116-21240/org.freedesktop.gstreamer.examples.camera **W/GStreamer+GST_ELEMENT_FACTORY: 0:00:00.475321500 0xe0446020 gstelementfactory.c:456:gst_element_factory_make no such element factory "udpsink "!**
2020-02-03 12:54:14.426 21116-21240/org.freedesktop.gstreamer.examples.camera I/GStreamer+GST_ELEMENT_FACTORY: 0:00:00.475353792 0xe0446020 gstelementfactory.c:359:gst_element_factory_create creating element "queue" named "video_queue"
2020-02-03 12:54:14.426 21116-21240/org.freedesktop.gstreamer.examples.camera I/GStreamer+GST_ELEMENT_PADS: 0:00:00.475603917 0xe0446020 gstelement.c:670:gst_element_add_pad:<GstQueue@0xd9bce018> adding pad 'sink'
2020-02-03 12:54:14.426 21116-21240/org.freedesktop.gstreamer.examples.camera I/GStreamer+GST_ELEMENT_PADS: 0:00:00.475713875 0xe0446020 gstelement.c:670:gst_element_add_pad:<GstQueue@0xd9bce018> adding pad 'src'
2020-02-03 12:54:14.426 21116-21240/org.freedesktop.gstreamer.examples.camera I/GStreamer+GST_ELEMENT_FACTORY: 0:00:00.475784500 0xe0446020 gstelementfactory.c:359:gst_element_factory_create creating element "queue" named "udp_queue"
2020-02-03 12:54:14.426 21116-21240/org.freedesktop.gstreamer.examples.camera I/GStreamer+GST_ELEMENT_PADS: 0:00:00.475875250 0xe0446020 gstelement.c:670:gst_element_add_pad:<GstQueue@0xd9bce268> adding pad 'sink'
2020-02-03 12:54:14.426 21116-21240/org.freedesktop.gstreamer.examples.camera I/GStreamer+GST_ELEMENT_PADS: 0:00:00.475953084 0xe0446020 gstelement.c:670:gst_element_add_pad:<GstQueue@0xd9bce268> adding pad 'src'
2020-02-03 12:54:14.426 21116-21240/org.freedesktop.gstreamer.examples.camera I/GStreamer+GST_ELEMENT_FACTORY: 0:00:00.476006625 0xe0446020 gstelementfactory.c:359:gst_element_factory_create creating element "tee" named "tee"
2020-02-03 12:54:14.426 21116-21240/org.freedesktop.gstreamer.examples.camera I/GStreamer+GST_ELEMENT_PADS: 0:00:00.476093542 0xe0446020 gstelement.c:670:gst_element_add_pad:<GstTee@0xe01d6800> adding pad 'sink'
2020-02-03 12:54:14.426 21116-21240/org.freedesktop.gstreamer.examples.camera I/GStreamer+GST_ELEMENT_FACTORY: 0:00:00.476160042 0xe0446020 gstelementfactory.c:359:gst_element_factory_create creating element "pipeline" named "camera-pipeline"
2020-02-03 12:54:14.427 21116-21240/org.freedesktop.gstreamer.examples.camera D/ahc:  ahc->pipeline 0 
2020-02-03 12:54:14.427 21116-21240/org.freedesktop.gstreamer.examples.camera D/ahc: ahc->ahcsrc 0
2020-02-03 12:54:14.427 21116-21240/org.freedesktop.gstreamer.examples.camera D/ahc: ahc->vsink 0
2020-02-03 12:54:14.427 21116-21240/org.freedesktop.gstreamer.examples.camera D/ahc: ahc->filter 0
2020-02-03 12:54:14.427 21116-21240/org.freedesktop.gstreamer.examples.camera D/ahc: ahc->udpsink 1
2020-02-03 12:54:14.427 21116-21240/org.freedesktop.gstreamer.examples.camera D/ahc: ahc->video_queue 0
2020-02-03 12:54:14.427 21116-21240/org.freedesktop.gstreamer.examples.camera D/ahc: ahc->udp_queue 0
2020-02-03 12:54:14.427 21116-21240/org.freedesktop.gstreamer.examples.camera D/ahc: ahc->tee 0

Thank you in advance for your help, (do not hesitate to correct my code as i'm new developer on GStreamer android SDK)

justinjoy commented 4 years ago

I found it. Just remove a space behind udpsink. :)

sofien4387 commented 4 years ago

I remove the space, but i got the same error :/ 2020-02-03 13:34:49.503 3524-3539/org.freedesktop.gstreamer.examples.camera W/GStreamer+GST_ELEMENT_FACTORY: 0:00:00.300945000 0xe0441020 gstelementfactory.c:456:gst_element_factory_make no such element factory "udpsink"!

justinjoy commented 4 years ago

Ah...

https://github.com/justinjoy/gst-android-camera/blob/master/app/src/main/jni/Android.mk#L50

Can you try to add $(GSTREAMER_PLUGINS_NET) to GSTREAMER_PLUGINS variable in Android.mk file which I linked above?

sofien4387 commented 4 years ago

Yep, it's fixed now :) thank you for your help. Could you please check my pipeline code to send and see the camera preview at the same time is correct or not? ( i test it now but i haven't a camera preview)

justinjoy commented 4 years ago

Yep, it's fixed now :) thank you for your help.

Good.

Could you please check my pipeline code to send and see the camera preview at the same time is correct or not? ( i test it now but i haven't a camera preview)

Could you provide a conceptual drawing of your pipeline? it's easier to make a correction if it has a problem. Even if there's no problem, the drawing will help us to have a clear discussion.

justinjoy commented 4 years ago

I'll close this issue. Please open another one to discuss your pipeline.