stereolabs / zed-gstreamer

Package of GStreamer elements to interface with ZED Cameras
https://www.stereolabs.com/docs/gstreamer/
61 stars 23 forks source link

Error on ZED Mini #9

Closed Tetsujinfr closed 3 years ago

Tetsujinfr commented 4 years ago

hi, thanks for this repo, very timely.

I am trying to use it with my ZED Mini on Ubuntu 18.04 (Jetpack 4.4) but I get and error all the time on all the examples. Sometimes a quick window shows up and disappear immediately but its content seems to be rgb greenish noise/ or not proper encoded pixels. I did not see any during the build and I can see the properties when running the inspector on zedsrc.

Here the error after running:

gst-launch-1.0 zedsrc stream-type=4 camera-resolution=2 camera-fps=30 ! queue ! zedodoverlay ! queue ! autovideoconvert ! fpsdisplaysink

Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock

(gst-launch-1.0:5583): GStreamer-CRITICAL **: 01:51:27.077: gst_buffer_map_range: assertion 'GST_IS_BUFFER (buffer)' failed

(gst-launch-1.0:5583): GStreamer-CRITICAL **: 01:51:27.077: gst_mini_object_unref: assertion 'GST_MINI_OBJECT_REFCOUNT_VALUE (mini_object) > 0' failed
ERROR: from element /GstPipeline:pipeline0/GstZedSrc:zedsrc0: Failed to map buffer for writing
Additional debug info:
/media/tetsfr/SSD/zed-gstreamer/gst-zed-src/gstzedsrc.cpp(1094): gst_zedsrc_fill (): /GstPipeline:pipeline0/GstZedSrc:zedsrc0
Execution ended after 0:00:00.270505320
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...

please can you help? Did you test with the ZED Mini specifically?

thanks

Tetsujinfr commented 4 years ago

when I replace "fpsdisplaysink" by "ximagesink" at the of the gstreamer command above, it works ok. I tool "fpsdisplaysink" in one of your examples to check the fps of the camera stream, but it seems it crashes on my end.

Am I doing something wrong ? How can I use the fpsdisplaysink sink? thanks

Myzhar commented 4 years ago

HI @Tetsujinfr thanks for reporting. I'm going to check and fix it

Myzhar commented 4 years ago

Hi @Tetsujinfr I tested the ZED Mini with the GStreamer plugins and like in all the pre-release tests it correctly works.

The pipeline that you are trying to use is wrong for tre reasons: 1) you are using the zedodoverlay element without activating object detection in zedsrc (option od-enabled) 2) you cannot use the object detection module with the ZED Mini, it is available only with the ZED2 3) you are using parameters for zedsrc that do not exist

Can you try this correct pipeline letting me know if it works for you? $ gst-launch-1.0 zedsrc stream-type=2 resolution=2 framerate=30 ! queue ! autovideoconvert ! fpsdisplaysink

Tetsujinfr commented 4 years ago

thanks for your explanations. I did not realize that zedodoverlay was related to obj detection, which I (frustratingly) know is not supported for the Mini (I do not know why btw, would love to have obj detection on the Mini). I did try the above command, but I had to tweak it a little, since the resolution or framerate properties are not recognised (a typo?). So I tried:

gst-launch-1.0 zedsrc stream-type=2 camera-resolution=2 camera-fps=30 ! queue ! autovideoconvert ! fpsdisplaysink

I have the same error as before though. Short greenish windows pops up and disappear, seems like a video mode type of issue to me (initialize and crashes).

If I use ximagesink or xvimagesink instead of fpsdisplaysink, that works fine however (as before). So the error does not seems to be only related to the use of zedodoverlay but to fpsdisplaysink too no?. Fyi I am on a Jetson Xavier NX.

Myzhar commented 4 years ago

I just updated the README to fix some typos, you can find the correct name for all the parameters now. Anyway, to be sure to use the correct names you can inspect the GStreamer elements using the gst-inspect-1.0 command: $ gst-inspect-1.0 zedsrc

About fpsdisplaysink maybe that it's an OpenGL issue on Xavier NX, try to add the video-sink=nvoverlaysink parameter.

Tetsujinfr commented 4 years ago

Can you pls give me a syntax example with video-sink=nvoverlaysink ? I am not a gstreamer expert and I am not sure where to use that parameter (when I tried it returned a syntax error)

Myzhar commented 4 years ago

Simply add it at the end of the command line because it's a parameter of the fpsdisplaysink element $ gst-launch-1.0 zedsrc stream-type=2 resolution=2 framerate=30 ! queue ! autovideoconvert ! fpsdisplaysink video-sink=nvoverlaysink

On the Jetson you can also replace autovideoconvert with nvvidconv that is optimized by Nvidia