stereolabs / zed-gstreamer

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

Fail to play svo file with zedsrc #19

Closed douo closed 2 years ago

douo commented 3 years ago
gst-launch-1.0 -v zedsrc svo-file-path=/tmp/7y_2.2_HD720_SN21958301_16-13-33.svo ! autovideoconvert ! queue ! fpsdisplaysink video-sink=nveglglessink

Output:

Setting pipeline to PAUSED ...

Using winsys: x11
Setting depth_mode to ULTRA
Failed to query video capabilities: Inappropriate ioctl for device
[NvV4l2Elements] failed to open
Caught SIGSEGV
Error in VIDIOC_REQBUFS at output planeError in VIDIOC_REQBUFS at output plane#0  0x0000007fa40e9d5c in __waitpid (pid=<optimized out>, stat_loc=0x7fc5fe56b4, options=<optimized out>) at ../sysdeps/unix/sysv/linux/waitpid.c:30
#1  0x0000007fa41252a0 in g_on_error_stack_trace ()
#2  0x0000005593f39c3c in  ()
#3  0x0000007fc5fe6ab0 in  ()
Spinning.  Please run 'gdb gst-launch-1.0 5773' to continue debugging, Ctrl-C to quit, or Ctrl-\ to dump core.

gdb:

GNU gdb (Ubuntu 8.1.1-0ubuntu1) 8.1.1
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "aarch64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from gst-launch-1.0...(no debugging symbols found)...done.
Attaching to program: /usr/bin/gst-launch-1.0, process 5773
[New LWP 5777]
[New LWP 5778]
[New LWP 5779]
[New LWP 5780]
[New LWP 5781]
[New LWP 5782]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/aarch64-linux-gnu/libthread_db.so.1".
0x0000007fa40e95fc in __GI___nanosleep (requested_time=0x7fc5fe56c8, remaining=0x7fc5fe56d8) at ../sysdeps/unix/sysv/linux/nanosleep.c:28
28  ../sysdeps/unix/sysv/linux/nanosleep.c: No such file or directory.
(gdb)
Myzhar commented 3 years ago

Hi @douo Can you provide us with more information? Operating System Device type GPU ZED SDK version Does your SVO play correctly using ZED_Explorer or ZED_Depth_Viewer?

douo commented 3 years ago

Hi @Myzhar Open with ZED_Explorer & ZED_Depth_Viewer seem report same error:

[NvV4l2Elements] failed to open
[1]    3289 segmentation fault (core dumped)  ZED_Explorer

ZED_Diagnostic report everything is ok.

I using ZED2 on jetson:

NVIDIA Jetson AGX Xavier [16GB] - Jetpack 4.4.1 [L4T 32.4.4]

 - Up Time:        2 days 7:27:6                                                                                                                                             Version: 3.0.2
 - Jetpack:        4.4.1 [L4T 32.4.4]                                                                                                                                         Author: Raffaello Bonghi
 - Board:                                                                                                                                                                     e-mail: raffaello@rnext.it
   * Type:           AGX Xavier [16GB]
   * SOC Family:     tegra194     ID: 25
   * Module:         P2888-0001   Board: P2822-0000
   * Code Name:      galen
   * Cuda ARCH:      7.2
   * Serial Number:  1**********
 - Libraries:                                                                                                                                                            - Hostname:    tx-desktop
   * CUDA:         10.2.89                                                                                                                                               - Interfaces:
   * OpenCV:       4.5.1  compiled CUDA: YES                                                                                                                               * eth0:      192.168.50.228
   * TensorRT:     7.1.3.0
   * VPI:          0.4.4
   * VisionWorks:  1.6.0.501
   * Vulkan:       1.2.70
   * cuDNN:        8.0.0.180

gstreamer version: GStreamer 1.14.5

ZED SDK Version: Stereolabs ZED SDK Version : 3.3.3

Myzhar commented 3 years ago

So the problem is with the SVO file. How long is it? Have you tried it on other machines?

douo commented 3 years ago

This is not a problem with SVO, it can be played well on other devices. I used ZED_SVO_Editor to repair, but it still doesn't work. It seems to be an environmental issue.

douo commented 3 years ago

After many attempts, the problem became clearer:

douo commented 3 years ago

Hi @Myzhar , Can you provide any working example for svo playback

Myzhar commented 3 years ago

SVO playback is natively supported, the pipeline that you submitted should work: gst-launch-1.0 -v zedsrc svo-file-path=/tmp/7y_2.2_HD720_SN21958301_16-13-33.svo ! autovideoconvert ! queue ! fpsdisplaysink have you tried removing the video-sink=nveglglessink part. You can also try using ximagesink instead of fpsdisplaysink

douo commented 3 years ago

After re-flash and re-setup the environment again and again. I finally figure out this issue cause by the package libv4l-dev:arm64 (1.14.2-1)

sudo apt  install libv4l-dev

ZED_Explorer xxx.svo throw this exception:

[NvV4l2Elements] failed to open

I remove libv4l-dev and run ZED_Explorer again:

FAILURE : Didn't manage to open svo file -- UNSUPPORTED
FAILURE : Didn't manage to open svo file -- UNSUPPORTED

Then I re-run the script ZED_SDK_Tegra_JP44_v3.3.3.run to reinstall sdk, Problem gone!!

Seem ZED SDK is incompatible with libv4l-dev?

Myzhar commented 3 years ago

@obraun-sl do you know something more about this problem with the Jetson Xavier AGX?

aemarkov commented 3 years ago

Faced with same issue with TX, JetPack 4.4.1. Several days ago I tested, and it worked. I didn't change zed software or jetpack. Strange.

obraun-sl commented 3 years ago

The hardware encoder/decoder on jetson is controlled by v4l2 as a ioctl device (when H264/5 SVO is recorded or played). The v4l2 library has been modified by NVIDIA to add more control access to the encoding/decoding parameters. Maybe installing libv4l-dev is overwritting the existing libv4l2 installed during jetpack flash, but that would be surprising. I tried to reproduce on my AGX JP4.4.1 by installing libv4l-dev, but ZED Explorer was still playing H264 files correctly. Maybe the issue was somewhere else than the libv4l-dev package

aemarkov commented 3 years ago

I reinstalled JetPack 4.4.1 on TX2 and ZED was working. I didn't run apt upgrade to prevent libraries update. However, one time ZED svo playing was broken again.

I've installed ros-melodic-base-ros and several other packages and ZED was still working.

After last known state when ZED worked and before I realized that it broken, I installed several packages: libatlas-base-dev, libsuitesparse-dev, libyaml-cpp-dev, libgoogle-glog-dev, libgflags-dev, autogen, autoconf, libtool, libprotobuf-dev, protobuf-compiler, ros-melodic-vision-opencv, libopencv-dev=3.2.0+dfsg-4ubuntu0.1, ros-melodic-camera-info-mamanger, ros-melodic-perception.

When I realized that zed was broken, i tried to uninstall ros-melodic-perception, ros-melodic-vision-opencv, cv_bridge, opencv 3.2 and install back opencv 4.x. But it didn't help.

Then I tried a very dirty hack: just copy /bin, /sbin, /usr, /lib from the rootfs from the NVidia SDK Manager JetPack installation to the Jetson. I used rsync, so existing files should be replaced with original ones, but files which I installed later, should be kept. Strange, but this didn't help too.

P.S. I also tried to copy only v4l .so libraries before I reflash jetson first time, but didn't help.

XuErShuo commented 2 years ago

After re-flash and re-setup the environment again and again. I finally figure out this issue cause by the package libv4l-dev:arm64 (1.14.2-1)

sudo apt  install libv4l-dev

ZED_Explorer xxx.svo throw this exception:

[NvV4l2Elements] failed to open

I remove libv4l-dev and run ZED_Explorer again:

FAILURE : Didn't manage to open svo file -- UNSUPPORTED
FAILURE : Didn't manage to open svo file -- UNSUPPORTED

Then I re-run the script ZED_SDK_Tegra_JP44_v3.3.3.run to reinstall sdk, Problem gone!!

Seem ZED SDK is incompatible with libv4l-dev?

Thanks for helping me solve the problem

Myzhar commented 2 years ago

It's a known problem. When you install a new version of the ZED SDK a warning message is indeed displayed