USB Camera not working - Deepstream SDK 5

When possible, please provide the following info:

**• Hardware Platform (Jetson / GPU)**Jetson Nano
• DeepStream Version5
**• JetPack Version (valid for Jetson only)**4.4
• TensorRT Version7
• NVIDIA GPU Driver Version (valid for GPU only)

I tried running the USB camera (Logitech c930e) on deepstream sdk -
deepstream-app/source1_usb_dec_infer_resnet_int8.txt

here is the config file:

[source0]
enable=1
#Type - 1=CameraV4L2 2=URI 3=MultiURI
type=1
camera-width=640
camera-height=480
camera-fps-n=30
camera-fps-d=1
camera-v4l2-dev-node=0 (I changed the dev-node from 6 to 0 (even tried 1) as values greater than 2 gives the error - cannot identify device dev/video6)

it gave this error:
** INFO: <bus_callback:147>: incorrect camera parameters provided, please provide supported resolution and frame rate

I tried the CSI camera, no problems there.

Hi
your issue is ** INFO: <bus_callback:147>: incorrect camera parameters provided, please provide supported resolution and frame rate
If you do not have v4l2-ctl, please install and run below to check camera supported resolution and frame rate
v4l2-ctl --list-formats-ext
then pass supported resolution and frame rate to camera property in config.

Hi, I have installed v4l2-utils and was able to run command
v4l2-ctl --list-formats-ext, it showed this output:
ioctl: VIDIOC_ENUM_FMT
Index : 0
Type : Video Capture
Pixel Format: ‘RG10’
Name : 10-bit Bayer RGRG/GBGB
Size: Discrete 3264x2464
Interval: Discrete 0.048s (21.000 fps)
Size: Discrete 3264x1848
Interval: Discrete 0.036s (28.000 fps)
Size: Discrete 1920x1080
Interval: Discrete 0.033s (30.000 fps)
Size: Discrete 1280x720
Interval: Discrete 0.017s (60.000 fps)
Size: Discrete 1280x720
Interval: Discrete 0.017s (60.000 fps)

So I tried both 1920x 1080 30fps and 1280x 720 60fps, here is the config:
[source0]
enable=1
#Type - 1=CameraV4L2 2=URI 3=MultiURI
type=1
camera-width=1920
camera-height=1080
camera-fps-n=30
camera-fps-d=1
camera-v4l2-dev-node=0

It still gave this error message:

ERROR from src_elem: Internal data stream error.
Debug info: gstbasesrc.c(3055): gst_base_src_loop (): /GstPipeline:pipeline/GstBin:multi_src_bin/GstBin:src_sub_bin0/GstV4l2Src:src_elem:
streaming stopped, reason not-negotiated (-4)
** INFO: <bus_callback:147>: incorrect camera parameters provided, please provide supported resolution and frame rate

Quitting
App run failed
jetsondesktop:/opt/nvidia/deepstream/deepstream-5.0$

I have tried to run cheese, and was able to run it with the webcam.

Thanks. Hope to get your reply.

Hi
Please make sure you are using usb camera not CSI camera and if indeed usb camera, make sure use the right device node
v4l2-ctl -d /dev/videoX --list-formats-ext

Hi,

I was able to determine the correct node for the webcam (dev node 1), and it showed 2 formats - YUYV and MJPG.

Here are the available sizes
ioctl: VIDIOC_ENUM_FMT
Index : 0
Type : Video Capture
Pixel Format: ‘YUYV’
Name : YUYV 4:2:2

   	Size: Discrete 1280x720 (showing this for now, there are many available sizes)
		Interval: Discrete 0.100s (10.000 fps)
		Interval: Discrete 0.133s (7.500 fps)
		Interval: Discrete 0.200s (5.000 fps)

Index       : 1
Type        : Video Capture
Pixel Format: 'MJPG' (compressed)
Name        : Motion-JPEG

Size: Discrete 1280x720
Interval: Discrete 0.033s (30.000 fps)
Interval: Discrete 0.042s (24.000 fps)
Interval: Discrete 0.050s (20.000 fps)
Interval: Discrete 0.067s (15.000 fps)
Interval: Discrete 0.100s (10.000 fps)
Interval: Discrete 0.133s (7.500 fps)
Interval: Discrete 0.200s (5.000 fps)

I was able to run deepstream but i think it followed the YUYV format (limited performance) , how do I use the MJPG format (has better available performance)?

The config i used are as follows:

[source0]
enable=1
#Type - 1=CameraV4L2 2=URI 3=MultiURI
type=1
camera-width=1280
camera-height=720
camera-fps-n=10
camera-fps-d=1
camera-v4l2-dev-node=1

Please refer to this topic for how to use mjpg format,

Thanks. I posted my concern separately on that thread because the code used on Deepstream 5 is a bit different from Deepstream 4, I tried to recompile as guided by the solution but I am having errors.

1 Like

Sorry for a late reply, have you solved this issue?

it’s one workable sample you can refer to.
from a glance of your code, you created redundancy caps for “image/jpeg”, but no caps like “video/x-raw”, “format”, G_TYPE_STRING,“NV12”, “width”, G_TYPE_INT, config->source_width, “height”, G_TYPE_INT, config->source_height, “framerate”, GST_TYPE_FRACTION, config->source_fps_n, config->source_fps_d which can accepted by nvvideoconvert.

Hello @Amycao,

Thanks for this. I’ll consider this for my troubleshooting.

Robi