Setting exposure for Webcam doesn't work with DeepStream 5.0

Please provide complete information as applicable to your setup.

•Hardware Platform (Jetson / GPU) : Nano 2GB Developer Kit
•DeepStream Version : 5.0
•JetPack Version (valid for Jetson only) : 4.4.1
•TensorRT Version : 7.1
•NVIDIA GPU Driver Version (valid for GPU only) : NA

• Issue Type( questions, new requirements, bugs)

Need to run USB WEBCAM with specific exposure setting/control.

HI,
I am running YOLO V3 to detect a custom object on Nano with deepstream in python.
I am using deepstream-test-1-usbcam to build the flow for USB WEBCAM.
My usb webcam details : LOGITECH 310.

I have the modified the following piece of code.

FROM :

caps_v4l2src.set_property(‘caps’, Gst.Caps.from_string(“video/x-raw, framerate=30/1”))
caps_vidconvsrc.set_property(‘caps’, Gst.Caps.from_string(“video/x-raw(memory:NVMM)”))

TO :

caps_v4l2src.set_property(‘caps’, Gst.Caps.from_string(“video/x-raw, framerate=(fraction)30/1, auto-exposure=(int)1, exposure-time=(double)166.66999999999999, width=(int)640, height=(int)480”))
caps_vidconvsrc.set_property(‘caps’, Gst.Caps.from_string(“video/x-raw(memory:NVMM)”))

Have verified this in the pipeline by the following piece of code :

print(“Exposure Mode :”, caps.get_property(‘caps’).get_structure(0).get_value(‘auto-exposure’))
print(“Exposure Time :”, caps.get_property(‘caps’).get_structure(0).get_value(‘exposure-time’))
print(“Frame Width :”, caps.get_property(‘caps’).get_structure(0).get_value(‘width’))
print(“Frame Height :”, caps.get_property(‘caps’).get_structure(0).get_value(‘height’))
print(“Frame Rate :”, caps.get_property(‘caps’).get_structure(0).get_fraction(‘framerate’))

This results in :

Exposure Mode : 1
Exposure Time : 166.67
Frame Width : 640
Frame Height : 480
Frame Rate : (True, value_numerator=30, value_denominator=1)

The pipeline produces 29 FPS with lights turned on.

When the lights are turned off or camera is covered in such a way to block lights, FPS reduces to 15.

This indicates that EXPOSURE change/setting has not happened in the gstreamer with deepstream.

But i am able to successfully set the exposure setting using opencv in python on the same camera.

Any possible guide on how to control the EXPOSURE, WIDTH, HEIGHT in the pipeline ?

Hi,
The v4l2src is a native gstreamer plugin and suggest you go to gstreamer forum.

Users in the forum may have more experience in applying manual controls to the plugin.

Hi @DaneLLL ,

As per this NVIDIA Camera Architecture Stack, v4l2src seems to be a NVIDIA Plugin only.

Can you please explain ?

Hi,
The flow diagram is not correct. The v4l2src block should be in blue. Please check the information in
https://gstreamer.freedesktop.org/documentation/video4linux2/v4l2src.html?gi-language=c

hello aswin.prabhakaran,

please confirm whether your webcam can support dynamic frame-rates, you may use CID control to adjust the exposure values. i.e. V4L2_CID_EXPOSURE
for those webcam did not support frame-rate changes, you may adjust the gain values to achieve similar results. i.e. V4L2_CID_GAIN or V4L2_CID_BRIGHTNESS
thanks