Segmentation fault while running examples with USB camera

I am trying to run ./detectnet-camera --camera /dev/video0 and camera-viewer /dev/video0 examples and running into a segmentation fault. I do have a screenshot of the log, but I am not sure how to post it in this topic. The log is very similar to what is mentioned in this thread:
https://devtalk.nvidia.com/default/topic/1057554/jetson-nano/imagenet-camera-on-my-logitech-hd-webcam-270-crashed-with-segmentation-fault-core-dumped-/

and the difference is that I have already tried providing the camera input as /dev/video0 which is the correct video source.

Another difference in the log is:

[gStreamer] opening gstCamera for streaming, transitioning pipeline to GST_STAT_PLAYING

The other statements in log are similar to the one shown in the link. It ends as follows:

camera-viewer: camera open for streaming
GST_ARGUS: Creating output stream
CONSUMER:Waiting until producer is connected …
GST_ARGUS: Available sensor modes:
Segmentation fault (core-dumped)

Kindly suggest if any other debugging steps are required.

Hi,
The error shows it opens the source as Argus camera source. Your source is USB camera and you should specify it as v4l2 source in command line.

How do I specify it as a v4l2 source. This is the way I have already tried out:

./detectnet-camera --camera /dev/video0

I am using Logitech C170. Is it because this model is unsupported?

Hi,
https://github.com/dusty-nv/jetson-inference/blob/master/docs/detectnet-camera.md
The example is

$ ./detectnet-camera <b>--camera=/dev/video0</b>

You probably miss ‘=’.

That was a typo when I posted it. I have tried the same command as you have posted.

Now when I run this command, I notice that jetson freezes. Following is the log towards the end:

[gstreamer] gstreamer changed state from PAUSED to PLAYING ==> v4l2src0
[gstreamer] gstreamer msg stream start ==> pipeline0
[gstreamer] gstCamera onEOS
[gstreamer] gstreamer v4l2src0 ERROR Internal data stream error.
[gstreamer] gstreamer Debugging info:gstbasesrc.c(3055):gst_base_src_loop ():
/GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
streaming stopped, reason not negotiated (-4)
[gstreamer] gstreamer changed state from READY to PAUSED ==>mysink
detectnet-camera: camera open for streaming

After this the terminal is stuck and I have to kill the process

Inow tried with Logitech C920 camera which is mentioned in the list of supported cameras and it is working

Hi,
Please check if you can launch C170 by following the steps:
https://devtalk.nvidia.com/default/topic/1057681/jetson-tx1/logitech-c930e-on-jetson-tx1-very-slow-and-choppy-video/post/5363417/#5363417

https://github.com/dusty-nv/jetson-utils/blob/798c416c175d509571859c9290257bd5cce1fd63/camera/gstCamera.cpp
The pipeline of launching USB camera(v4l2src) is

{
		ss << "v4l2src device=" << mCameraStr << " ! ";
		ss << "video/x-raw, width=(int)" << mWidth << ", height=(int)" << mHeight << ", "; 
		
	#if NV_TENSORRT_MAJOR >= 5
		ss << "format=YUY2 ! videoconvert ! video/x-raw, format=RGB ! videoconvert !";
	#else
		ss << "format=RGB ! videoconvert ! video/x-raw, format=RGB ! videoconvert !";
	#endif

		ss << "appsink name=mysink";

		mSource = GST_SOURCE_V4L2;
	}

For C170, probably the pipeline have to be customized. You may try to modify format, width, height and check again.