Closed SmrityB closed 6 years ago
Hi SmrityB, I had a look and I think maybe a gstreamer plugin is missing on your system Could you try apt-get install for each of these dependencies: gstreamer1.0 gstreamer1.0-dev gstreamer1.0-libav gstreamer1.0-plugins-bad libgstreamer-plugins-base1.0-dev
If that doesn't work, we can try to make a log with the commands: export GST_DEBUG=*:4 then ./pylongstreamer -window &> debug.log
Hi Matt,
I have all the plugins installed. It doesn't work. As per your advise, I have attached the log in this email. Please let me know.
Thank you. Appreciate your help.
On Thu, Mar 1, 2018 at 9:52 PM, Matthew B. notifications@github.com wrote:
Hi SmrityB, I had a look and I think maybe a gstreamer plugin is missing on your system Could you try apt-get install for each of these dependencies: gstreamer1.0 gstreamer1.0-dev gstreamer1.0-libav gstreamer1.0-plugins-bad libgstreamer-plugins-base1.0-dev
If that doesn't work, we can try to make a log with the commands: export GST_DEBUG=*:4 then ./pylongstreamer -window &> debug.log
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/MattsProjects/pylon_gstreamer/issues/3#issuecomment-369804306, or mute the thread https://github.com/notifications/unsubscribe-auth/AZGA6KYTNorFiRegpqOlA8HGzsEPOdHLks5taLPjgaJpZM4SWufX .
-- With Best Regards,
Smrity Bhattarai Graduate Research Assistant The University of Akron
Hi Smrity, could you copy/paste the log text? I'm afraid the attachment did not make it through. sorry for that. -matt
Dear Matt,
I have tried attaching the file again in this email. I hope you get it this time. Please let me know.
Thanks very much.
On Mar 2, 2018 7:23 PM, "Matthew B." notifications@github.com wrote:
Hi Smrity, could you copy/paste the log text? I'm afraid the attachment did not make it through. sorry for that. -matt
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/MattsProjects/pylon_gstreamer/issues/3#issuecomment-370096073, or mute the thread https://github.com/notifications/unsubscribe-auth/AZGA6LNgPErCLr58tdm2vdLhy-Hnmv4oks5taeKTgaJpZM4SWufX .
Still nothing :( I think the issue section does not like attachments. Can you paste into the body?
Dear Matt,
Please find the log copied and pasted in this email.
Press CTRL+C at any time to quit.
0:00:00.000099999 [335m 4318 [00m 0x449800 [36mINFO [00m [00;01;31m
GST_INIT gst.c:511:init_pre: [00m Initializing GStreamer Core
Library version 1.8.3
0:00:00.000180735 [335m 4318 [00m 0x449800 [36mINFO [00m [00;01;31m
GST_INIT gst.c:512:init_pre: [00m Using library installed in
/usr/lib/aarch64-linux-gnu
0:00:00.000205727 [335m 4318 [00m 0x449800 [36mINFO [00m [00;01;31m
GST_INIT gst.c:523:init_pre: [00m Linux tegra-ubuntu
4.4.38-tegra #1 SMP PREEMPT Thu Jul 20 00:49:07 PDT 2017 aarch64
0:00:00.000635453 [335m 4318 [00m 0x449800 [36mINFO [00m [00;01;31m
GST_INIT gstmessage.c:119:_priv_gst_message_initialize: [00m
init messages
0:00:00.001436603 [335m 4318 [00m 0x449800 [36mINFO [00m [00;01;31m
GST_INIT gstcontext.c:83:_priv_gst_context_initialize: [00m init
contexts
0:00:00.001796793 [335m 4318 [00m 0x449800 [36mINFO [00m [00;01;36m
GST_PLUGIN_LOADING gstplugin.c:316:_priv_gst_plugin_initialize: [00m
registering 0 static plugins
0:00:00.002024665 [335m 4318 [00m 0x449800 [36mINFO [00m [00;01;36m
GST_PLUGIN_LOADING gstplugin.c:224:gst_plugin_register_static: [00m
registered static plugin "staticelements"
0:00:00.002059416 [335m 4318 [00m 0x449800 [36mINFO [00m [00;01;36m
GST_PLUGIN_LOADING gstplugin.c:226:gst_plugin_register_static: [00m added
static plugin "staticelements", result: 1
0:00:00.002116760 [335m 4318 [00m 0x449800 [36mINFO [00m [00m
GST_REGISTRY gstregistry.c:1723:ensure_current_registry: [00m reading
registry cache: /home/nvidia/.cache/gstreamer-1.0/registry.aarch64.bin
0:00:00.033741961 [335m 4318 [00m 0x449800 [36mINFO [00m [00m
GST_REGISTRY gstregistrybinary.c:619:priv_gst_registry_binary_read_cache:
[00m loaded /home/nvidia/.cache/gstreamer-1.0/registry.aarch64.bin in
0.031576 seconds
0:00:00.033877801 [335m 4318 [00m 0x449800 [36mINFO [00m [00m
GST_REGISTRY gstregistry.c:1579:scan_and_update_registry: [00m Validating
plugins from registry cache:
/home/nvidia/.cache/gstreamer-1.0/registry.aarch64.bin
0:00:00.035760386 [335m 4318 [00m 0x449800 [36mINFO [00m [00m
GST_REGISTRY gstregistry.c:1681:scan_and_update_registry: [00m Registry
cache has not changed
0:00:00.035790338 [335m 4318 [00m 0x449800 [36mINFO [00m [00m
GST_REGISTRY gstregistry.c:1758:ensure_current_registry: [00m registry
reading and updating done, result = 1
0:00:00.035806082 [335m 4318 [00m 0x449800 [36mINFO [00m [00;01;31m
GST_INIT gst.c:724:init_post: [00m GLib runtime version: 2.48.2
0:00:00.035822050 [335m 4318 [00m 0x449800 [36mINFO [00m [00;01;31m
GST_INIT gst.c:726:init_post: [00m GLib headers version: 2.48.1
0:00:00.035835522 [335m 4318 [00m 0x449800 [36mINFO [00m [00;01;31m
GST_INIT gst.c:727:init_post: [00m initialized GStreamer
successfully
Initializing camera and driver...
Using Camera : Basler daA1600-60uc (22375118)
Camera Area Of Interest : 1600x1200
Camera Speed : 40.9266 fps
0:00:00.492090114 [335m 4318 [00m 0x449800 [36mINFO [00m
[00;01;37;41m GST_ELEMENT_FACTORY
gstelementfactory.c:362:gst_element_factory_create: [00m creating element
"pipeline" named "pipeline"
0:00:00.494919480 [335m 4318 [00m 0x449800 [36mINFO [00m [00;01;36m
GST_PLUGIN_LOADING
gstplugin.c:842:_priv_gst_plugin_load_file_for_registry: [00m plugin
"/usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstapp.so" loaded
0:00:00.494999704 [335m 4318 [00m 0x449800 [36mINFO [00m
[00;01;37;41m GST_ELEMENT_FACTORY
gstelementfactory.c:362:gst_element_factory_create: [00m creating element
"appsrc" named "source"
0:00:00.495476566 [335m 4318 [00m 0x449800 [36mINFO [00m
[00;01;37;41m GST_ELEMENT_PADS
gstelement.c:659:gst_element_add_pad:GstBaseSrc@0x69e120 [00m adding pad
'src'
0:00:00.498135597 [335m 4318 [00m 0x449800 [36mINFO [00m [00;01;36m
GST_PLUGIN_LOADING
gstplugin.c:842:_priv_gst_plugin_load_file_for_registry: [00m plugin
"/usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstvideoscale.so" loaded
0:00:00.498248044 [335m 4318 [00m 0x449800 [36mINFO [00m
[00;01;37;41m GST_ELEMENT_FACTORY
gstelementfactory.c:362:gst_element_factory_create: [00m creating element
"videoscale" named "rescaler"
0:00:00.498732011 [335m 4318 [00m 0x449800 [36mINFO [00m
[00;01;37;41m GST_ELEMENT_PADS
gstelement.c:659:gst_element_add_pad:GstBaseTransform@0x6f2b10 [00m
adding pad 'sink'
0:00:00.498862186 [335m 4318 [00m 0x449800 [36mINFO [00m
[00;01;37;41m GST_ELEMENT_PADS
gstelement.c:659:gst_element_add_pad:GstBaseTransform@0x6f2b10 [00m
adding pad 'src'
0:00:00.500382565 [335m 4318 [00m 0x449800 [36mINFO [00m [00;01;36m
GST_PLUGIN_LOADING
gstplugin.c:842:_priv_gst_plugin_load_file_for_registry: [00m plugin
"/usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstcoreelements.so" loaded
0:00:00.500446213 [335m 4318 [00m 0x449800 [36mINFO [00m
[00;01;37;41m GST_ELEMENT_FACTORY
gstelementfactory.c:362:gst_element_factory_create: [00m creating element
"capsfilter" named "rescalerCaps"
0:00:00.500646724 [335m 4318 [00m 0x449800 [36mINFO [00m
[00;01;37;41m GST_ELEMENT_PADS
gstelement.c:659:gst_element_add_pad:GstBaseTransform@0x6d61b0 [00m
adding pad 'sink'
0:00:00.500716932 [335m 4318 [00m 0x449800 [36mINFO [00m
[00;01;37;41m GST_ELEMENT_PADS
gstelement.c:659:gst_element_add_pad:GstBaseTransform@0x6d61b0 [00m
adding pad 'src'
0:00:00.501329378 [335m 4318 [00m 0x449800 [36mINFO [00m [00;01;36m
GST_PLUGIN_LOADING
gstplugin.c:842:_priv_gst_plugin_load_file_for_registry: [00m plugin
"/usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstvideofilter.so" loaded
0:00:00.501377089 [335m 4318 [00m 0x449800 [36mINFO [00m
[00;01;37;41m GST_ELEMENT_FACTORY
gstelementfactory.c:362:gst_element_factory_create: [00m creating element
"videoflip" named "rotator"
0:00:00.501662176 [335m 4318 [00m 0x449800 [36mINFO [00m
[00;01;37;41m GST_ELEMENT_PADS
gstelement.c:659:gst_element_add_pad:GstBaseTransform@0x6e8f60 [00m
adding pad 'sink'
0:00:00.501727232 [335m 4318 [00m 0x449800 [36mINFO [00m
[00;01;37;41m GST_ELEMENT_PADS
gstelement.c:659:gst_element_add_pad:GstBaseTransform@0x6e8f60 [00m
adding pad 'src'
0:00:00.501795808 [335m 4318 [00m 0x449800 [36mINFO [00m
[00;01;37;41m GST_ELEMENT_FACTORY
gstelementfactory.c:362:gst_element_factory_create: [00m creating element
"bin" named "sourcebin"
0:00:00.501958015 [335m 4318 [00m 0x449800 [36mINFO [00m
[00;01;37;41m GST_ELEMENT_PADS
gstutils.c:1573:gst_element_link_pads_full: [00m trying to link element
source:(any) to element rescaler:(any)
0:00:00.502005599 [335m 4318 [00m 0x449800 [36mINFO [00m
[00;01;31;41m GST_PADS gstutils.c:932:gst_pad_check_link: [00m
trying to link source:src and rescaler:sink
0:00:00.502066111 [335m 4318 [00m 0x449800 [36mINFO [00m
[00;01;31;41m GST_PADS
gstpad.c:4098:gst_pad_peer_query:
Thanks Smrity,
I see something:
“omxvideosink
gstomxvideosink.c:1242:gst_omx_video_sink_setcaps:
Seems an issue with the omx libraries on the host. Maybe a different version that what was preinstalled on mine. I will see what I can find out....
Dear Matt,
Did you figure out something? I am not sure if I have mentioned this before but just wanted to let you to know that I am using Nvidia Jetson TX2 kit. I hope it's not the device issue. Please let me know if you discover something.
Thanks very much.
On Sun, Mar 4, 2018 at 10:37 AM, Matthew B. notifications@github.com wrote:
Thanks Smrity, I see something: “omxvideosink gstomxvideosink.c:1242:gst_omx_video_sink_setcaps: [00m Unsupported format RGB”
Seems an issue with the omx libraries on the host. Maybe a different version that what was preinstalled on mine. I will see what I can find out....
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/MattsProjects/pylon_gstreamer/issues/3#issuecomment-370238464, or mute the thread https://github.com/notifications/unsubscribe-auth/AZGA6CI7aauYluSH83gGvWO5eFF2u4Wmks5tbAo6gaJpZM4SWufX .
-- With Best Regards,
Smrity Bhattarai Graduate Research Assistant The University of Akron
Hi Smrity, Yes, I am getting closer. This is more or less a common issue when using GStreamer... The issue is that different systems support different plugins (which makes it extremely hard to create a single generic program), and so this program merely calls gstreamer's "autovideosink", which then automatically loads the display plugin(s) which are pre-existing on the system. On the TX1/TX2, the plugins available for display are from the gstomxvideosink offering. The error says that this plugin does not support RGB format (the CInstantCameraAppSrc class converts all incoming images to RGB because I've found this to be a rather universally supported format downstream, except of course in this case...). What is a little confusing is that I have coded some safety in here in case of unsupported formats. I've added a gstreamer videoconvert plugin that should convert the image from RGB to XXX so that it fits whatever display plugin is being used. This does not appear to be working though...
Dear Matt,
I understand what you mean. At least now we are aware of the reason for this current issue regarding gstreamer. Let me know if you need any input or debug-logs from me regarding this issue.
Appreciate your help.
On Mon, Mar 5, 2018 at 11:16 AM, Matthew B. notifications@github.com wrote:
Hi Smrity, Yes, I am getting closer. This is more or less a common issue when using GStreamer... The issue is that different systems support different plugins (which makes it extremely hard to create a single generic program), and so this program merely calls gstreamer's "autovideosink", which then automatically loads the display plugin(s) which are pre-existing on the system. On the TX1/TX2, the plugins available for display are from the gstomxvideosink offering. The error says that this plugin does not support RGB format (the CInstantCameraAppSrc class converts all incoming images to RGB because I've found this to be a rather universally supported format downstream, except of course in this case...). What is a little confusing is that I have coded some safety in here in case of unsupported formats. I've added a gstreamer videoconvert plugin that should convert the image from RGB to XXX so that it fits whatever display plugin is being used. This does not appear to be working though...
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/MattsProjects/pylon_gstreamer/issues/3#issuecomment-370472529, or mute the thread https://github.com/notifications/unsubscribe-auth/AZGA6ACYkR8PMehqIKcSD6csevdaw5B4ks5tbWTIgaJpZM4SWufX .
-- With Best Regards,
Smrity Bhattarai Graduate Research Assistant The University of Akron
Thanks. I found on my machine that switching from autovideosink in the pipelinehelper to "xvimagesink" does result in an image, but not yet continuous video... Nevertheless, it would be nice to get the systems' preferred plugin working. It seems to support YUV, which the camera does as well, so perhaps setting the camera to YUV, setting "format" = "yuv" in the instantcameraappsrc, and turning off the pylon image format converter might work, but I need some time to test this...
Dear Matt,
That sounds good. Seems like we are getting somewhere. We would definitely want the live video-stream over the image. Let me know how the test goes. I will keep looking at my end too.
Thanks very much.
On Mon, Mar 5, 2018 at 11:29 AM, Matthew B. notifications@github.com wrote:
Thanks. I found on my machine that switching from autovideosink in the pipelinehelper to "xvimagesink" does result in an image, but not yet continuous video... Nevertheless, it would be nice to get the systems' preferred plugin working. It seems to support YUV, which the camera does as well, so perhaps setting the camera to YUV, setting "format" = "yuv" in the instantcameraappsrc, and turning off the pylon image format converter might work, but I need some time to test this...
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/MattsProjects/pylon_gstreamer/issues/3#issuecomment-370477371, or mute the thread https://github.com/notifications/unsubscribe-auth/AZGA6KhG3Lrf7cqqdyBErCgDju5-dHmsks5tbWf0gaJpZM4SWufX .
-- With Best Regards,
Smrity Bhattarai
Hi Smrity, Can you try the following code in place of build_pipeline_display() in the pipeline helper and let me know what happens? see the line about adding caps to convert to I420...
bool CPipelineHelper::build_pipeline_display()
{
try
{
if (m_pipelineBuilt == true)
{
cout << "Cancelling -display. Another pipeline has already been built." << endl;
return false;
}
// build the videoscaler
if (build_videoscaler() == false)
return false;
GstElement *convert;
GstElement *sink;
cout << "Creating Pipeline for displaying images in local window..." << endl;
// Create gstreamer elements
convert = gst_element_factory_make("videoconvert", "converter");
sink = gst_element_factory_make("autovideosink", "videosink"); // depending on your platform, you may have to use some alternative here, like ("autovideosink", "sink")
if (!convert){ cout << "Could not make convert" << endl; return false; }
if (!sink){ cout << "Could not make sink" << endl; return false; }
// add and link the pipeline elements
//gst_bin_add_many(GST_BIN(m_pipeline), m_source, m_videoScaler, m_videoScalerCaps, convert, sink, NULL);
//gst_element_link_many(m_source, m_videoScaler, m_videoScalerCaps, convert, sink, NULL);
// add caps to the pipeline so that the video converter converts it to something the sink recognizes, in this case I420.
GstElement *filter;
GstCaps *filter_caps;
filter = gst_element_factory_make("capsfilter", "filter");
filter_caps = gst_caps_new_simple("video/x-raw",
"format", G_TYPE_STRING, "I420",
NULL);
g_object_set(G_OBJECT(filter), "caps", filter_caps, NULL);
gst_caps_unref(filter_caps);
// add and link the pipeline elements
gst_bin_add_many(GST_BIN(m_pipeline), m_source, m_videoScaler, m_videoScalerCaps, convert, filter, sink, NULL);
gst_element_link_many(m_source, m_videoScaler, m_videoScalerCaps, convert, filter, sink, NULL);
cout << "Pipeline Made." << endl;
m_pipelineBuilt = true;
return true;
}
catch (std::exception &e)
{
cerr << "An exception occurred in build_pipeline_display(): " << endl << e.what() << endl;
return false;
}
}
Dear Matt,
I tried your code. I could get a snap-picture taken from a camera when I start the pylongstreamer window which definitely is a good step toward our goal.
Please let me know if you need anything else from me.
On Mon, Mar 5, 2018 at 5:32 PM, Matthew B. notifications@github.com wrote:
Hi Smrity, Can you try the following code in place of build_pipeline_display() in the pipeline helper and let me know what happens?
`bool CPipelineHelper::build_pipeline_display() { try { if (m_pipelineBuilt == true) { cout << "Cancelling -display. Another pipeline has already been built." << endl; return false; }
// build the videoscaler if (build_videoscaler() == false) return false;
GstElement convert; GstElement sink;
cout << "Creating Pipeline for displaying images in local window..." << endl; // Create gstreamer elements convert = gst_element_factory_make("videoconvert", "converter"); sink = gst_element_factory_make("autovideosink", "videosink"); // depending on your platform, you may have to use some alternative here, like ("autovideosink", "sink")
if (!convert){ cout << "Could not make convert" << endl; return false; } if (!sink){ cout << "Could not make sink" << endl; return false; }
// add and link the pipeline elements //gst_bin_add_many(GST_BIN(m_pipeline), m_source, m_videoScaler, m_videoScalerCaps, convert, sink, NULL); //gst_element_link_many(m_source, m_videoScaler, m_videoScalerCaps, convert, sink, NULL);
// add caps to the pipeline so that the video converter converts it to something the sink recognizes, in this case I420. GstElement filter; GstCaps filter_caps; filter = gst_element_factory_make("capsfilter", "filter"); filter_caps = gst_caps_new_simple("video/x-raw", "format", G_TYPE_STRING, "I420", NULL);
g_object_set(G_OBJECT(filter), "caps", filter_caps, NULL); gst_caps_unref(filter_caps);
// add and link the pipeline elements gst_bin_add_many(GST_BIN(m_pipeline), m_source, m_videoScaler, m_videoScalerCaps, convert, filter, sink, NULL); gst_element_link_many(m_source, m_videoScaler, m_videoScalerCaps, convert, filter, sink, NULL);
cout << "Pipeline Made." << endl;
m_pipelineBuilt = true;
return true; } catch (std::exception &e) { cerr << "An exception occurred in build_pipeline_display(): " << endl << e.what() << endl; return false; }
}`
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/MattsProjects/pylon_gstreamer/issues/3#issuecomment-370591225, or mute the thread https://github.com/notifications/unsubscribe-auth/AZGA6PHAOnu9KQnWPjRl0FN03QRXD00Wks5tbbzkgaJpZM4SWufX .
-- With Best Regards,
Smrity Bhattarai
Hi Smirty, I believe I fixed this. Please see commit 6898823 (or just reclone/redownload the project). The single-image issue was due to where I was wrapping the pylon image in the gst buffer. I also added the code to put in that additional caps filter in the display pipeline to support the nvidia display sink. their sink doesn't support RGB, which is what the camera source element is providing. normally the converter element would take care to convert it, but as I read on the forums, the nvidia sink doesn't 'advertise' what it supports so to say. So the caps filter after the converter manually tells the converter to convert to i420, which the sink supports.
Thank you Matt. It worked. Appreciate all your help.
On Tue, Mar 6, 2018 at 3:43 PM, Matthew B. notifications@github.com wrote:
Closed #3 https://github.com/MattsProjects/pylon_gstreamer/issues/3.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/MattsProjects/pylon_gstreamer/issues/3#event-1507458719, or mute the thread https://github.com/notifications/unsubscribe-auth/AZGA6Nyl_T6MK-oGbKmFpXiRGtRPRAduks5tbvT6gaJpZM4SWufX .
-- With Best Regards,
Smrity Bhattarai
great thanks! :)
thank you for this project, I download your project and compile on my tx1 board。there i want open two pylon camera for Binocular recognition, how to change the code can you give me some advice。 Another,I noticed you have encode the output for h264stream, can i open it from vlc app from another PC? my tx1 IP is 192.168.1.8。 I used this common: ./pylon_gstreamer -h264stream 192.168.1.8
Hi Mahxn0, Could you create a new issue in the github for your question? Multiple camera support and VLC are not things I have tried yet, but it sounds interesting. I am curious to know if other users would like the same features. I can track this via an "issue". Do you already have your own GStreamer pipeline which supports input from two cameras?
I was trying to access my basler camera (serial number 22375118) through gstreamer. I am having some issues even when I try to display the camera. I believe I have installed all the dependencies required mention in the above link. I am using Nvidia Jetson TX2 kit containing arm processor to connect this camera. I am using ubuntu 16.04. After compilation and running of the code, I get the following error:
nvidia@tegra-ubuntu:~/Downloads/pylon_gstreamer-master/source$ ./pylongstreamer -camera 22375118 -aoi 640 480 -display Press CTRL+C at any time to quit. Initializing camera and driver... Using Camera : Basler daA1600-60uc (22375118) Camera Area Of Interest : 640x480 Camera Speed : 65.8979 fps Creating Pipeline for displaying images in local window... Pipeline Made. Starting Camera image acquistion and Pylon driver Grab Engine... Starting pipeline... ERROR from element source: Internal data flow error. Debugging info: gstbasesrc.c(2948): gst_base_src_loop (): /GstPipeline:pipeline/GstBin:sourcebin/GstAppSrc:source: streaming task paused, reason not-negotiated (-4) Stopping pipeline... Sending EOS event... Stopping Camera image acquistion and Pylon image grabbing...
Press Enter to exit.
I am totally unsure of what is going wrong. I hope you can guide me on this issue that I am facing. I really appreciate your help.