Segmentation Fault (Core Dumped)

Hello ! Im using jetson nano dev kit. For AI application, i have integrated 2 usb cameras for face recognition. Suddenly it causes Segmentation Fault and it remains.

I have tried every possible solution either updating nvargus folder or cache files removal but none fixed my issue.

Please help me !!!

Please give more information can’t tell what problem for such few information.

this is the details of two usb cameras and the gstream pipeline im using . Please validate it.
Also if it is wrong , is this the issue behind Segfault.

v4l2-ctl --list-formats-ext
ioctl: VIDIOC_ENUM_FMT
Index : 0
Type : Video Capture
Pixel Format: ‘MJPG’ (compressed)
Name : Motion-JPEG
Size: Discrete 1920x1080
Interval: Discrete 0.017s (60.000 fps)
Interval: Discrete 0.033s (30.000 fps)
Size: Discrete 1280x960
Interval: Discrete 0.017s (60.000 fps)
Interval: Discrete 0.033s (30.000 fps)
Size: Discrete 1280x720
Interval: Discrete 0.017s (60.000 fps)
Interval: Discrete 0.033s (30.000 fps)
Size: Discrete 1024x768
Interval: Discrete 0.017s (60.000 fps)
Interval: Discrete 0.033s (30.000 fps)
Size: Discrete 800x600
Interval: Discrete 0.017s (60.000 fps)
Interval: Discrete 0.033s (30.000 fps)
Size: Discrete 640x480
Interval: Discrete 0.017s (60.000 fps)
Interval: Discrete 0.033s (30.000 fps)
Size: Discrete 320x240
Interval: Discrete 0.017s (60.000 fps)
Interval: Discrete 0.033s (30.000 fps)
Size: Discrete 1920x1080
Interval: Discrete 0.017s (60.000 fps)
Interval: Discrete 0.033s (30.000 fps)

Index       : 1
Type        : Video Capture
Pixel Format: 'YUYV'
Name        : YUYV 4:2:2
	Size: Discrete 1920x1080
		Interval: Discrete 0.200s (5.000 fps)
	Size: Discrete 1280x960
		Interval: Discrete 0.200s (5.000 fps)
	Size: Discrete 1280x720
		Interval: Discrete 0.100s (10.000 fps)
	Size: Discrete 1024x768
		Interval: Discrete 0.067s (15.000 fps)
	Size: Discrete 800x600
		Interval: Discrete 0.050s (20.000 fps)
	Size: Discrete 640x480
		Interval: Discrete 0.033s (30.000 fps)
	Size: Discrete 320x240
		Interval: Discrete 0.017s (60.000 fps)
	Size: Discrete 1920x1080
		Interval: Discrete 0.200s (5.000 fps)

below is the part of my code where gstreamer pipeline is working

def open_cam_onboard(camera_id,flip, type=“USB”,width = 1920, height= 1080):

gst_elements = str(subprocess.check_output('gst-inspect-1.0'))
if type == "USB":
    gst_str = ('v4l2src device=/dev/video{} ! image/jpeg, width={}, height={},framerate=30/1 ! jpegdec ! video/x-raw, framerate=30/1 ! videoconvert ! appsink, drop=1 ').format(camera_id, width, height)

Does gst-launch v4l2src device=/dev/video0 ! … command have the same result?

please tell me the exact command to run

gst-launch-1.0 v4l2src device=/dev/video0
Setting pipeline to PAUSED …
Pipeline is live and does not need PREROLL …
Setting pipeline to PLAYING …
New clock: GstSystemClock
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data stream error.
Additional debug info:
gstbasesrc.c(3055): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
streaming stopped, reason not-linked (-1)
Execution ended after 0:00:01.328765919
Setting pipeline to PAUSED …
Setting pipeline to READY …
Setting pipeline to NULL …
Freeing pipeline …

Try below

gst-launch-1.0 v4l2src device=/dev/video1 ! image/jpeg,format=MJPG,width=1280,height=720,framerate=30/1 ! nvv4l2decoder mjpeg=1 ! nvvidconv ! autovideosink

gst-launch-1.0 v4l2src device=/dev/video1 ! image/jpeg,format=MJPG,width=1280,height=720,framerate=30/1 ! nvv4l2decoder mjpeg=1 ! nvvidconv ! autovideosink
Setting pipeline to PAUSED …
Opening in BLOCKING MODE
Pipeline is live and does not need PREROLL …
Setting pipeline to PLAYING …
New clock: GstSystemClock
NvMMLiteOpen : Block : BlockType = 277
NVMEDIA: Reading vendor.tegra.display-size : status: 6
NvMMLiteBlockCreate : Block : BlockType = 277
^Chandling interrupt.
Interrupt: Stopping pipeline …
Execution ended after 0:00:04.441311872
Setting pipeline to PAUSED …
Setting pipeline to READY …
Setting pipeline to NULL …
Freeing pipeline …

Hi @aymen.baig,
Its good to check if the camera will let frames flow at all. Also check if maybe using a raw format works:
gst-launch-1.0 v4l2src device=/dev/video1 ! ‘video/x-raw,format=YUY2,width=1920,height=1080’ ! nvvideoconvert ! fakesink silent=false -v

Contact us: support@ridgerun.com
Developers wiki: https://developer.ridgerun.com/
Website: www.ridgerun.com

One thing i would like to add is that I did not face seg fault every time. when my camera units tried multiple connect attempts then jetson nano throws segfault

nano@nano:~$ gst-launch-1.0 v4l2src device=/dev/video1 ! ‘video/x-raw,format=YUY2,width=1920,height=1080’ ! nvvideoconvert ! fakesink silent=false -v

(gst-launch-1.0:8875): GStreamer-CRITICAL **: 14:09:37.508: gst_element_make_from_uri: assertion ‘gst_uri_is_valid (uri)’ failed
WARNING: erroneous pipeline: syntax error
nano@nano:~$ gst-launch-1.0 v4l2src device=/dev/video0 ! ‘video/x-raw,format=YUY2,width=1920,height=1080’ ! nvvideoconvert ! fakesink silent=false -v

(gst-launch-1.0:8938): GStreamer-CRITICAL **: 14:09:51.776: gst_element_make_from_uri: assertion ‘gst_uri_is_valid (uri)’ failed
WARNING: erroneous pipeline: syntax error
nano@nano:~$

(gst-launch-1.0:8938): GStreamer-CRITICAL **: 14:09:51.776: gst_element_make_from_uri: assertion ‘gst_uri_is_valid (uri)’ failed

This error seems to show that there is no /dev/video entry which would only happen if the camera is not actually connected. Also, is your use case to capture images or are you attempting to capture video?

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.