What should I do to set the USB camera in the configuration file?

I didn’t find in the documentation explaining the “nvurisrcbin” plugin and where I should go to see the parameters of this plugin.
Now, I want to read the USB camera input based on this plugin, and I know it is possible to read it based on offline files and URI input.
What should I do to set the USB camera in the configuration file?
deepstream-test3 Code:

 if (PERF_MODE) {
        uri_decode_bin = gst_element_factory_make ("nvurisrcbin", "uri-decode-bin");//Here
        g_object_set (G_OBJECT (uri_decode_bin), "file-loop", TRUE, NULL);
    } else {
        uri_decode_bin = gst_element_factory_make ("uridecodebin", "uri-decode-bin");
    }

config file:

source-list:
  #semicolon separated uri. For ex- uri1;uri2;uriN;
  #list: file:///home/fast-cnn-train/CLionProjects/test3/cmake-build-debug/1.mp4;   
  camera-v4l2-dev-node: 0;

Which platfrom and deepstream version are you using? Seems you are using DS6.1 or later.
Please be noted that by default PERF is set to FALSE, meaning nvurisrcbin will not be used, the decodebin will still be “uridecodebin”.
Documentation for nvurisrcbin: NvDsSourceExt — DeepStream 6.1.1 Release documentation (nvidia.com), and
please refer to DeepStream 5: deepstream-app yoloV3 with video stream from camera - #6 by mchi for setting usb camera.

Can’t I read the usb camera input by modifying the configuration file?
Do you mean to refer to deepstream-app to modify the code to achieve it?

You can modify the config to read usb camera, please refer to the second link above on how to make the change.

config file:

source-list:
  #semicolon separated uri. For ex- uri1;uri2;uriN;
  #list: file:///home/fast-cnn-train/CLionProjects/test3/cmake-build-debug/1.mp4;
  list: usb:/dev/video0;

Report an error:

Running...
Returned, stopping playback
Deleting pipeline
ERROR from element uri-decode-bin: No URI handler implemented for "usb".
Error details: gsturidecodebin.c(1408): gen_source_element (): /GstPipeline:dstest3-pipeline/GstBin:source-bin-00/GstURIDecodeBin:uri-decode-bin

Can you run v4l2-ctl -d /dev/video0 --list-formats-ext to get the features of your camera? Please set correct device node according to your device.

You need to replace uridecodebin/nvurisrcbin with v4l2src for your USB camera. Before that you need to know which formats are supported by your camera to find out the correct pipeline. v4l2src (gstreamer.freedesktop.org)

This is a basic gstreamer usage. You can google for more information.

What decoder bin is used by deepstream-app? when I testing it, I found that deepstream-app performs very well and is compatible with various types of input forms.

There is no update from you for a period, assuming this is not an issue anymore.
Hence we are closing this topic. If need further support, please open a new one.
Thanks

The key is not decode bin but the source. Deepstream-app supports multiple types of sources (uridecodebin, rtspsrc, v4l2src). When you choose camera source, it uses v4l2src. The code is totally open source. Please refer to /opt/nvidia/deepstream/deepstream/sources/apps/apps-common/src/deepstream_source_bin.c

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