# How to set the exposure time range or gain range with nvarguscamerasrc and make it effective immediately

**URL:** <https://forums.developer.nvidia.com/t/how-to-set-the-exposure-time-range-or-gain-range-with-nvarguscamerasrc-and-make-it-effective-immediately/163937>\
**Category:** Jetson AGX Xavier\
**Tags:** camera\
**Created:** [December 17, 2020, 8:04am UTC](https://forums.developer.nvidia.com/t/how-to-set-the-exposure-time-range-or-gain-range-with-nvarguscamerasrc-and-make-it-effective-immediately/163937 "2020-12-17T08:04:08Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![17210720095](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@17210720095](https://forums.developer.nvidia.com/u/17210720095)\
**Post date:** [December 17, 2020, 8:04am UTC](https://forums.developer.nvidia.com/t/how-to-set-the-exposure-time-range-or-gain-range-with-nvarguscamerasrc-and-make-it-effective-immediately/163937/1 "2020-12-17T08:04:08Z")

</div>

Hi,

I am using the gstreamer pipeline to capture images from a CSI camera, and I want to change the camera controls in runtime and make the modification effective immediately.

However, I find that the image is still captured using the previous camera controls after I set the new camera controls such as exposure time range and gain range in the nvarguscamerasrc element of the gstreamer pipeline.

Only after a certain period of time, the image is captured using the new parameters. If the frame rate is set to 30 fps, the wrong captured images flow usually lasts 5-10 frames.

Here is the code of modifying camera controls:

> gst\_element\_set\_state(pipeline\_, GST\_STATE\_PAUSED);  
> g\_object\_set(G\_OBJECT(element\_nv), “exposuretimerange”, “1000000 1000000”, NULL);  
> g\_object\_set(G\_OBJECT(element\_nv), “gainrange”, “5 5”, NULL);  
> gst\_element\_set\_state(pipeline\_, GST\_STATE\_PLAYING);

---

<div class="post-metadata">

**Author:** ![ShaneCCC](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/shaneccc/32/14043_2.png) [@ShaneCCC](https://forums.developer.nvidia.com/u/ShaneCCC)\
**Post date:** [December 17, 2020, 8:11am UTC](https://forums.developer.nvidia.com/t/how-to-set-the-exposure-time-range-or-gain-range-with-nvarguscamerasrc-and-make-it-effective-immediately/163937/3 "2020-12-17T08:11:02Z")

</div>

5 - 6 frames is current design.

---

<div class="post-metadata">

**Author:** ![17210720095](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@17210720095](https://forums.developer.nvidia.com/u/17210720095)\
**Post date:** [December 17, 2020, 8:28am UTC](https://forums.developer.nvidia.com/t/how-to-set-the-exposure-time-range-or-gain-range-with-nvarguscamerasrc-and-make-it-effective-immediately/163937/5 "2020-12-17T08:28:28Z")

</div>

Is there any way I can get the exact exposure time of the image taken ? By doing so , I can tell which image is taken under which exposure time parameter.

---

<div class="post-metadata">

**Author:** ![ShaneCCC](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/shaneccc/32/14043_2.png) [@ShaneCCC](https://forums.developer.nvidia.com/u/ShaneCCC)\
**Post date:** [December 17, 2020, 10:57am UTC](https://forums.developer.nvidia.com/t/how-to-set-the-exposure-time-range-or-gain-range-with-nvarguscamerasrc-and-make-it-effective-immediately/163937/6 "2020-12-17T10:57:46Z")

</div>

Sorry to tell current argus and the AE alg need few frame to take effect.

---

<div class="post-metadata">

**Author:** ![17210720095](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@17210720095](https://forums.developer.nvidia.com/u/17210720095)\
**Post date:** [December 17, 2020, 11:53am UTC](https://forums.developer.nvidia.com/t/how-to-set-the-exposure-time-range-or-gain-range-with-nvarguscamerasrc-and-make-it-effective-immediately/163937/7 "2020-12-17T11:53:21Z")

</div>

well, I could get the the exposure time range which is set in the nvarguscamerasrc plugin now, and i want to know the exact value of the exposure time not the range value when some image is captured. Is there any way I can do that? Or the argus doesn’t support this operation now?

---

<div class="post-metadata">

**Author:** ![ShaneCCC](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/shaneccc/32/14043_2.png) [@ShaneCCC](https://forums.developer.nvidia.com/u/ShaneCCC)\
**Post date:** [December 17, 2020, 3:58pm UTC](https://forums.developer.nvidia.com/t/how-to-set-the-exposure-time-range-or-gain-range-with-nvarguscamerasrc-and-make-it-effective-immediately/163937/8 "2020-12-17T15:58:35Z")

</div>

There’s no this API for current release, sorry.  
But I think you can get it from the v4l2 interface like v4l2-ctl do.

---

<div class="post-metadata">

**Author:** ![17210720095](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@17210720095](https://forums.developer.nvidia.com/u/17210720095)\
**Post date:** [December 18, 2020, 2:31am UTC](https://forums.developer.nvidia.com/t/how-to-set-the-exposure-time-range-or-gain-range-with-nvarguscamerasrc-and-make-it-effective-immediately/163937/9 "2020-12-18T02:31:54Z")

</div>

Thanks for your reply, and I will try it.

---

<div class="post-metadata">

**Author:** ![TomNVIDIA](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/tomnvidia/32/14181_2.png) [@TomNVIDIA](https://forums.developer.nvidia.com/u/TomNVIDIA)\
**Post date:** [October 18, 2021, 6:20pm UTC](https://forums.developer.nvidia.com/t/how-to-set-the-exposure-time-range-or-gain-range-with-nvarguscamerasrc-and-make-it-effective-immediately/163937/11 "2021-10-18T18:20:50Z")

</div>

Closed on October 18, 2021, 6:20pm UTC


