Usb camera fail on deepstream

Please provide complete information as applicable to your setup.

• Hardware Platform (Jetson / GPU): Jetson Xavier NX
• DeepStream Version: 6.3
• JetPack Version (valid for Jetson only): 5.1 (L4T 35.2.1)
• TensorRT Version
• NVIDIA GPU Driver Version (valid for GPU only)
I want to use deepstream for my yolov5. Although I have read several docs and the same problem in Deepstream-test5 for usb camera fail - Intelligent Video Analytics / DeepStream SDK - NVIDIA Developer Forums

I still have a green screen (below).
Here is my config
[application]
enable-perf-measurement=1
perf-measurement-interval-sec=5

[tiled-display]
enable=1
rows=1
columns=1
width=1280
height=720
gpu-id=0
nvbuf-memory-type=0

[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
uri=usb:/dev/video0

[sink0]
enable=1
type=2
sync=0
gpu-id=0
nvbuf-memory-type=0

[osd]
enable=1
gpu-id=0
border-width=5
text-size=15
text-color=1;1;1;1;
text-bg-color=0.3;0.3;0.3;1
font=Serif

However, with the command

 gst-launch-1.0 v4l2src device=/dev/video0 ! "video/x-raw, width=640, height=480,  format=(string)YUY2, framerate=(fraction)30/1" ! nvvidconv ! 'video/x-raw(memory:NVMM),format=I420' ! nv3dsink

Camera will work

So how could I use deepstream to access camera,

Can you set option uri as “v4l2:///dev/video0”?

I have seturi=v4l2:///dev/video0 , but it still does not work

Does pipeline with uridecodebin gst-launch-1.0 uridecodebin uri=v4l2:///dev/video0 **** work in your setup?
It should be similar as the pipeline mentioned in FAQ 28.3.3.

gst-launch-1.0 uridecodebin uri=v4l2:///dev/video0 ! nvvideoconvert ! 'video/x-raw(memory:NVMM),format=NV12' ! mux.sink_0 nvstreammux name=mux width=640 height=480 batch-size=1 ! fakesink

I try this command but it still not work. Its output is Preformatted text/dvs/git/dirty/git-master_linux/nvutils/nvbufsurftransform/nvbufsurftransform.cpp:549: => Surface type not supported for transformation NVBUF_MEM_SYSTEM

However, the signal light of webcam turn on

it should be replaced by nvvidconv, but it is relevant to your deepstream-test5 question.

uri is not needed for USB V4L2, can you set “camera-v4l2-dev-node=0” only?
(uri: URI to the encoded stream. The URI can be a file, an HTTP URI, or an RTSP live source. Valid when type=2 or 3. )

  1. When I change to nvvidconv, nothing popup although the camera signal is turned on.
    And the output is like this

  2. When I change type=2 and set uri=v4l2:///dev/video0, the output is like that

  3. When I set type=1 and have enough key such as

camera-v4l2-dev-node=0
camera-width=640
camera-height=480
camera-fps-n=30
camera-fps-d=1

The output is just a green screen:

In case only set the source as

enable=1
type=1
camera-v4l2-dev-node=0

the output is look like this:

Does this pipeline works on your host?

 deepstream-app -c /opt/nvidia/deepstream/deepstream/samples/configs/deepstream-app/source1_usb_dec_infer_resnet_int8.txt

This config file should work well for /dev/video0 which has a resolution of 640x48 with 30fps(same as your working pipeline):

[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 have tried and it still doesn’t work well. Just a green screen popup

Have you flashed your os when you update the DeepStream to 6.3? You need to use the JetPack 5.1.2. https://docs.nvidia.com/metropolis/deepstream/dev-guide/text/DS_Quickstart.html#id5

1 Like

Oh, my bad.
The reason for issue above may be the conflict of version between Deepstream 6.3 and Jetpack 5.1

I have re-installed Deepstream 6.2 ( or could update Jetpack to 5.1.2) and everything has worked.
Thank you very much for dedicated supporting. !!

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