Change or set resolution onboard camera TX2 and how to access on sensor mode

Hello everybody,
I’m using Tegra-X2 and I wondered if it was possible to change camera resolution on On-board camera. I would to understand how can I change it and also if it is possible change the other parameters with or without gstreamer nvgstcapture-1.0 or similar applications.

Below there are some lines where it’s show which pipeline I’m using and also what appear when I try to open Onboard camera. I know how to open a camera, I need only how to set permanently resolution, whitebalance etc.

Using pipeline:
        nvcamerasrc ! video/x-raw(memory:NVMM), width=(int)640, height=(int)480, format=(string)I420, framerate=(fraction)60/1 ! nvvidconv flip-method=4 ! video/x-raw, format=(string)BGRx ! videoconvert ! video/x-raw, format=(string)BGR ! appsink

Available Sensor modes :
2592 x 1944 FR=30.000000 CF=0x1109208a10 SensorModeType=4 CSIPixelBitDepth=10 DynPixelBitDepth=10
2592 x 1458 FR=30.000000 CF=0x1109208a10 SensorModeType=4 CSIPixelBitDepth=10 DynPixelBitDepth=10
1280 x 720 FR=120.000000 CF=0x1109208a10 SensorModeType=4 CSIPixelBitDepth=10 DynPixelBitDepth=10

NvCameraSrc: Trying To Set Default Camera Resolution. Selected sensorModeIndex = 2 WxH = 1280x720 FrameRate = 120.000000 ...

@a.danilo
You can change the sensor mode by change below width, height like if you want to use 2592x1944 sensor mode you need to change as below.

video/x-raw(memory:NVMM), width=(int)2592, height=(int)1944, format=(string)I420, framerate=(fraction)30/1

Available Sensor modes :
2592 x 1944 FR=30.000000 CF=0x1109208a10 SensorModeType=4 CSIPixelBitDepth=10 DynPixelBitDepth=10
2592 x 1458 FR=30.000000 CF=0x1109208a10 SensorModeType=4 CSIPixelBitDepth=10 DynPixelBitDepth=10
1280 x 720 FR=120.000000 CF=0x1109208a10 SensorModeType=4 CSIPixelBitDepth=10 DynPixelBitDepth=10

Hi ShaneCCC,
at first thanks you for answered very fast.
So, I need to set resolution permanently.
If I use nvgstcapture-1.0 --help, the following lines of code are displayed:

Usage:
  nvgstcapture-1.0 [OPTION...] Nvidia GStreamer Camera Model Test

Help Options:
  -h, --help                         Show help options
  --help-all                         Show all help options
  --help-gst                         Show GStreamer Options

Application Options:
  --prev-res                         Preview width & height. USB Range: 0 to 12 (5632x4224) and CSI Range: 2 to 12 (5632x4224) e.g., --prev-res=3
  --cus-prev-res                     Custom Preview width & height [for CSI only] e.g., --cus-prev-res=1920x1080
  --image-res                        Image width & height. Range: 0 to 12 (5632x4224) e.g., --image-res=3
  --video-res                        Video width & height. Range: 0 to 9 (3896x2192) e.g., --video-res=3
  -m, --mode                         Capture mode value (1=still 2=video)
  -v, --video-enc                    Video encoder type (0=h264[HW] 1=vp8[HW] 2=h265[HW] 3=vp9[HW])
  -b, --enc-bitrate                  Video encoding Bit-rate(in bytes) e.g., --enc-bitrate=4000000
  --enc-profile                      Video encoder profile (Only for H.264) (0=Baseline, 1=Main, 2=High)
  -J, --image-enc                    Image encoder type (0=jpeg_SW[jpegenc] 1=jpeg_HW[nvjpegenc])
  -k, --file-type                    Container file type (0=mp4 1=3gp 2=mkv)
  --color-format                     Color format to use (0=I420[default for v4l2],1=NV12[For CSI only and default for CSI], 2=YUY2[For V4L2 only])
  --cap-dev-node                     Video capture device node (0=/dev/video0[default], 1=/dev/video1, 2=/dev/video2) e.g., --cap-dev-node=0
  --svs                              [For USB] (=) chain for video Preview. [For CSI only] use "nvoverlaysink"
  --file-name                        Captured file name. nvcamtest is used by default
  --camsrc                           Camera Source to use (0=v4l2, 1=csi[default], 2=videotest, 3=eglstream)
  --orientation                      [For CSI only] Camera sensor orientation value
  -w, --whitebalance                 [For CSI only] Capture whitebalance value
  -s, --scene-mode                   [For CSI only] Camera Scene-Mode value
  -c, --color-effect                 [For CSI only] Camera Color Effect value
  --auto-exposure                    [For CSI only] Camera Auto-Exposure value
  --flash                            [For CSI only] Camera Flash value
  --flicker                          [For CSI only] Camera Flicker Detection and Avoidance Mode value
  --contrast                         [For CSI only] Camera Contrast value
  --saturation                       [For CSI only] Camera Saturation value
  --edge-enhancement                 [For CSI only] Camera Edge Enhancement value
  --tnr-strength                     [For CSI only] Camera TNR-Strength value
  --tnr-mode                         [For CSI only] Camera TNR Mode value
  --sensor-id                        [For CSI only] Camera Sensor ID value
  --eglstream-id                     [For CSI EGLStream Consumer] Select EGLStream Producer ID value. Default value 0
  --display-id                       [For nvoverlaysink only] Display ID value
  --aeRegion                         [For CSI Only] ROI for AE coordinates(top,left,bottom,right) and weight in that order.e.g., --aeRegion="30 40 200 200 1.2"
  --wbRegion                         [For CSI Only] ROI for AWB coordinates(top,left,bottom,right) and weight in that order.e.g., --wbRegion="30 40 200 200 1.2"
  --fpsRange                         [For CSI Only] FPS range values (low, high) e.g., --fpsRange="15 30"
  --exposure-time                    [For CSI only] Capture exposure time value. e.g., --exposure-time=0.033
  --wbGains                          [For CSI Only] WB gains values (R, GR, GB, B) in that order. e.g., --wbGains="1.2 1.4 0.8 1.6"
  --overlayConfig                    Overlay Configuration Options index and coordinates in (index, x_pos, y_pos, width, height) order  e.g. --overlayConfig="0, 0, 0, 1280, 720"
  --enable-exif                      Enable Exif data
  --dump-bayer                       Dump bayer data in addition to image capture.
  --eglConfig                        EGL window Coordinates (x_pos y_pos) in that order  e.g., --eglConfig="50 100"
  --aeLock                           [For CSI only] Enable auto exposure lock e.g., --aeLock
  --enable-meta                      Enable Sensor MetaData reporting
  --nvvideosink-create-eglstream     [For nvvideosink EGLStream Producer] Enable nvvideosink EGLStream Producer
  --callback                         Enable User callback to set capture settings per frame
  --app-profile                      Enable KPI profiling
  --kpi-numbers                      Enable KPI measurement
  -A, --automate                     Run application in automation mode
  -S, --start-time                   Start capture after specified time in seconds. Default = 5 sec (use with --automate or -A only)
  -Q, --quit-after                   Quit application once automation is done after specified time in seconds. Default = 0 sec (use with --automate or -A only)
  -C, --count                        Number of iterations of automation testcase. Default = 1 (use with --automate or -A only)
  -N, --num-sensors                  Number of sensors  (use with --automate or -A only)
  --capture-gap                      Number of milliseconds between successive image/video capture. Default = 250 msec (use with --automate and --capture-auto only)
  --capture-time                     Capture video for specified time in seconds. Default = 10 sec (use with --automate and --capture-auto only)
  --toggle-mode                      Toggle between still and video capture modes for count number of times (use with --automate or -A only)
  --toggle-sensor                    Toggle between num_sensors if given otherwise between sensor-id 0 and 1 (use with --automate or -A only)
  --capture-auto                     Do image/video capture in automation mode for count number of times(use with --automate or -A only)
  --enum-wb                          Enumerate all white-balance modes for count number of times (use with --automate or -A only)
  --enum-scm                         Enumerate all scene modes for count number of times (use with --automate or -A only)
  --enum-ce                          Enumerate all color-effect modes for count number of times (use with --automate or -A only)
  --enum-ae                          Enumerate all auto-exposure modes for count number of times (use with --automate or -A only)
  --enum-f                           Enumerate all flash modes for count number of times (use with --automate or -A only)
  --enum-fl                          Enumerate all flicker detection and avoidance modes for count number of times (use with --automate or -A only)
  --enum-ct                          Enumerate contrast value through 0 to 1 by a step of 0.1 for count number of times (use with --automate or -A only)
  --enum-st                          Enumerate saturation value through 0 to 2 by a step of 0.1 for count number of times (use with --automate or -A only)
  --enum-ee                          Enumerate edge-enhancement value through 0 to 1 by a step of 0.1 for count number of times (use with --automate or -A only)
  --enum-ts                          Enumerate TNR strength value through 0 to 1 by a step of 0.1 for count number of times (use with --automate or -A only)
  --enum-tnr                         Enumerate all TNR modes for count number of times (use with --automate or -A only)
  --streaming-mode                   [For CSI Only] Enable streaming mode (1=stream only, 2=stream+record)
  --streaming-file                   File to stream instead of camera input

Supported resolutions in case of CSI Camera
  (2) : 640x480
  (3) : 1280x720
  (4) : 1920x1080
  (5) : 2104x1560
  (6) : 2592x1944
  (7) : 2616x1472
  (8) : 3840x2160
  (9) : 3896x2192
  (10): 4208x3120
  (11): 5632x3168
  (12): 5632x4224

Runtime CSI Camera Commands:

  Help : 'h'
  Quit : 'q'
  Set Capture Mode:
      mo:<val>
          (1): image
          (2): video
  Get Capture Mode:
      gmo
  Set Sensor Id (0 to 10):
      sid:<val> e.g., sid:2 
  Get Sensor Id:
      gsid
  Set sensor orientation:
      so:<val>
          (0): none
          (1): Rotate counter-clockwise 90 degrees
          (2): Rotate 180 degrees
          (3): Rotate clockwise 90 degrees
  Get sensor orientation:
      gso
  Set Whitebalance Mode:
      wb:<val>
          (0): off
          (1): auto
          (2): incandescent
          (3): fluorescent
          (4): warm-fluorescent
          (5): daylight
          (6): cloudy-daylight
          (7): twilight
          (8): shade
          (9): manual
  Get Whitebalance Mode:
      gwb
  Set Scene-Mode:
      scm:<val>
          (0): face-priority
          (1): action
          (2): portrait
          (3): landscape
          (4): night
          (5): night-portrait
          (6): theatre
          (7): beach
          (8): snow
          (9): sunset
          (10): steady-photo
          (11): fireworks
          (12): sports
          (13): party
          (14): candle-light
          (15): barcode
  Get Scene-Mode:
      gscm
  Set Color Effect Mode:
      ce:<val>
          (1): off
          (2): mono
          (3): negative
          (4): solarize
          (5): sepia
          (6): posterize
          (7): aqua
  Get Color Effect Mode:
      gce
  Set Auto-Exposure Mode:
      ae:<val>
          (1): off
          (2): on
          (3): OnAutoFlash
          (4): OnAlwaysFlash
          (5): OnFlashRedEye
  Get Auto-Exposure Mode:
      gae
  Set Flash Mode:
      f:<val>
          (0): off
          (1): on
          (2): torch
          (3): auto
  Get Flash Mode:
      gf
  Set Flicker Detection and Avoidance Mode:
      fl:<val>
          (0): off
          (1): 50Hz
          (2): 60Hz
          (3): auto
  Get Flicker Detection and Avoidance Mode:
      gfl
  Set Contrast (0 to 1):
      ct:<val> e.g., ct:0.75
  Get Contrast:
      gct
  Set Saturation (0 to 2):
      st:<val> e.g., st:1.25
  Get Saturation:
      gst
  Set Exposure Time in seconds:
      ext:<val> e.g., ext:0.033
  Get Exposure Time:
      gext
  Set Auto Exposure Lock(0/1):
      ael:<val> e.g., ael:1
  Get Auto Exposure Lock:
      gael
  Set Edge Enhancement (0 to 1):
      ee:<val> e.g., ee:0.75
  Get Edge Enhancement:
      gee
  Set ROI for AE:
      It needs five values, ROI coordinates(top,left,bottom,right)
      and weight in that order
      aer:<val> e.g., aer:20 20 400 400 1.2
  Get ROI for AE:
      gaer
  Set ROI for AWB:
      It needs five values, ROI coordinates(top,left,bottom,right)
      and weight in that order
      wbr:<val> e.g., wbr:20 20 400 400 1.2
  Get ROI for AWB:
      gwbr
  Set FPS range:
      It needs two values, FPS Range (low, high) in that order
      fpsr:<val> e.g., fpsr:15 30
  Get FPS range:
      gfpsr
  Set WB Gains:
      It needs four values (R, GR, GB, B) in that order
      wbg:<val> e.g., wbg:1.2 2.2 0.8 1.6
  Get WB Gains:
      gwbg
  Set TNR Strength (0 to 1):
      ts:<val> e.g., ts:0.75
  Get TNR Strength:
      gts
  Set TNR Mode:
      tnr:<val>
          (0): NoiseReduction_Off
          (1): NoiseReduction_Fast
          (2): NoiseReduction_HighQuality
  Get TNR Mode:
      gtnr
  Capture: enter 'j' OR
           followed by a timer (e.g., jx5000, capture after 5 seconds) OR
           followed by multishot count (e.g., j:6, capture 6 images)
           timer/multihot values are optional, capture defaults to single shot with timer=0s
  Start Recording : enter '1'
  Stop Recording  : enter '0'
  Video snapshot  : enter '2' (While recording video)
  Set Preview Resolution:
      pcr:<val> e.g., pcr:3
          (2) : 640x480
          (3) : 1280x720
          (4) : 1920x1080
          (5) : 2104x1560
          (6) : 2592x1944
          (7) : 2616x1472
          (8) : 3840x2160
          (9) : 3896x2192
          (10): 4208x3120
          (11): 5632x3168
          (12): 5632x4224
  Note - For preview resolutions 4208x3120 and more use option --svs=nveglglessink
  Get Preview Resolution:
      gpcr
  Set Image Resolution:
      icr:<val> e.g., icr:3
          (2) : 640x480
          (3) : 1280x720
          (4) : 1920x1080
          (5) : 2104x1560
          (6) : 2592x1944
          (7) : 2616x1472
          (8) : 3840x2160
          (9) : 3896x2192
          (10): 4208x3120
          (11): 5632x3168
          (12): 5632x4224
  Get Image Capture Resolution:
      gicr
  Set Video Resolution:
      vcr:<val> e.g., vcr:3
          (2) : 640x480
          (3) : 1280x720
          (4) : 1920x1080
          (5) : 2104x1560
          (6) : 2592x1944
          (7) : 2616x1472
          (8) : 3840x2160
          (9) : 3896x2192
  Get Video Capture Resolution:
      gvcr

Runtime USB Camera Commands:

  Help : 'h'
  Quit : 'q'
  Set Capture Mode:
      mo:<val>
          (1): image
          (2): video
  Get Capture Mode:
      gmo
  Capture: enter 'j' OR
           followed by a timer (e.g., jx5000, capture after 5 seconds) OR
           followed by multishot count (e.g., j:6, capture 6 images)
           timer/multihot values are optional, capture defaults to single shot with timer=0s
  Start Recording : enter '1'
  Stop Recording  : enter '0'
  Set Preview Resolution:
      pcr:<val> e.g., pcr:2
          (0) : 176x144
          (1) : 320x240
          (2) : 640x480
          (3) : 1280x720
          (4) : 1920x1080
  NOTE: Preview/Encode resolution will be same as Capture resolution for USB-Camera
  Get Preview Resolution:
      gpcr
  Get Image Capture Resolution:
      gicr
  Get Video Capture Resolution:
      gvcr
  Set Capture Device Node:
      cdn:<val> e.g., cdn:0
          (0): /dev/video0
          (1): /dev/video1
          (2): /dev/video2
  Get Capture Device Node:
      gcdn

Runtime encoder configuration options:

  Set Encoding Bit-rate(in bytes):
      br:<val> e.g., br:4000000
  Get Encoding Bit-rate(in bytes):
      gbr
  Set Encoding Profile(only for H.264):
      ep:<val> e.g., ep:1
          (0): Baseline
          (1): Main
          (2): High
  Get Encoding Profile(only for H.264):
      gep
  Force IDR Frame on video Encoder(only for H.264):
      Enter 'f'

My questions are:

How to set permanently some of these parameters (e.g. white balance, framerate, resolution, auto-exposure, color effect etc) without nvgstcapture?

How to access on onboard camera system files?

@a.danilo
What’s you use case? We may give you some suggestion if you give more detail information.

Hi ShaneCCC,

In general, but not ultimately with the onboard camera, we need to understand how to control CSI cameras from within OpenCV. (We have purged OpenCV4Tegra and installed OpenCV3.3 and successfully open the video stream from nsight compiled on the host). So we are starting with the onboard camera.

We need to understand the information regarding the difference between supported resolutions as reported by nvgstcapture-1.0 --help. Resolutions from (2) to (9) - this appears to be misleading as I don’t believe the onboard camera can support all these resolutions ?. So is this the only resolutions that the nvgstcapture application will support - but its not related to the specific camera ?

We can see available sensorModes and after compilation in nsight:

NvCameraSrc: Trying To Set Default Camera Resolution. Selected sensorModeIndex = 2 WxH = 1280x720 FrameRate = 120.000000 ...

The actual use case is to be able to select and change the resolution mode that the camera is streaming out, from within OpenCV. So what is happening when we set width and height to 640x480 in the pipeline?

If a camera has more sensor modes we may want to force it into one rather than another - and how would we change it on the fly? Would we need to close the stream and reopen with another pipeline - I guess.

Also for example we want to change the whitebalance from within OpenCV how do we issue the
“Runtime CSI Camera Commands:” or is there another way to do this under program control.

Thanks for your support.

@a.asnilo
You can start from tracing the nvgstcapture source code first.

http://developer.nvidia.com/embedded/dlc/l4t-24-1-nv-gst-apps-sources

Hi Shane,
thanks you for answered.
So, what’s about the other questions?
Can anyone help help me?

Thanks for your support.

You have to list the question you still can’t find it after tracing the nvgstcapture.

hi Shane,
I’ve read the nvgstcapture file but I’ve always the same problems.
I would like to change the properties of Jetson tx2 embedded camera when cpp code it is running. I’m trying to use OpenCV libraries on Nsight Eclipse Edition and the following pipeline to open the embedded camera:

std::string get_tegra_pipeline(int width, int height, int fps) {
    return "nvcamerasrc saturation=2 ! video/x-raw(memory:NVMM), width=(int)" + to_string(width) + ", height=(int)" +
           to_string(height) + ", format=(string)I420, framerate=(fraction)" + to_string(fps) +
           "/1 ! nvvidconv flip-method=4 ! video/x-raw, format=(string)BGRx ! videoconvert ! video/x-raw, format=(string)BGR ! appsink";
}

I thought I could use nvgstcapture-1.0 to set some video properties but is not possible to include nvgstcapture-1.0 into a cpp code.

Do you have any idea to set custom properties using nvcamerasrc or others?

Thanks in advance for your support.
Best,
Danilo

All of below nvgstcapture parameter can set by gst-launch except the g_param_spec_boxed type.
Like sensor-id by “gst-launch-1.0 nvcamerasrc sensor-id=0”

g_object_class_install_property (gobject_class, PROP_QUEUE_SIZE,
      g_param_spec_int ("queue-size", "Queue Size",
          "Number of buffers for the driver to enqueue",
          MIN_QUEUE_SIZE, MAX_QUEUE_SIZE, DEFAULT_QUEUE_SIZE,
          (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));

  g_object_class_install_property (gobject_class, PROP_WHITE_BALANCE,
      g_param_spec_enum ("wbmode", "white balance mode",
          "White balance affects the color temperature of the photo",
          GST_TYPE_NVCAM_WB_MODE, NVCAM_DEFAULT_WB_MODE,
          (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));

  g_object_class_install_property (gobject_class, PROP_SCENE_MODE,
      g_param_spec_enum ("scene-mode", "scene mode",
          "property to set scene mode",
          GST_TYPE_NVCAM_SCENE_MODE, NVCAM_DEFAULT_SCENE_MODE,
          (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));

  g_object_class_install_property (gobject_class, PROP_COLOR_EFFECT,
      g_param_spec_enum ("color-effect", "color effect",
          "property to set color effect",
          GST_TYPE_NVCAM_COLOR_EFFECT, NVCAM_DEFAULT_COLOR_EFFECT,
          (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));

  g_object_class_install_property (gobject_class, PROP_AUTO_EXPOSURE,
      g_param_spec_enum ("auto-exposure", "auto exposure mode",
          "property to set auto exposure mode",
          GST_TYPE_NVCAM_AUTO_EXPOSURE, NVCAM_DEFAULT_AUTO_EXPOSURE,
          (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));

  g_object_class_install_property (gobject_class, PROP_FLASH_MODE,
      g_param_spec_enum ("flash", "flash mode",
          "property to set flash mode",
          GST_TYPE_NVCAM_FLASH_MODE, NVCAM_DEFAULT_FLASH_MODE,
          (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));

  g_object_class_install_property (gobject_class, PROP_FLICKER_MODE,
      g_param_spec_enum ("flicker", "flicker mode",
          "property to select flicker detection and avoidance mode",
          GST_TYPE_NVCAM_FLICKER_MODE, NVCAM_DEFAULT_FLICKER_MODE,
          (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));

  g_object_class_install_property (gobject_class, PROP_CONTRAST,
      g_param_spec_float ("contrast", "constrast",
          "property to adjust contrast value",
          0.0, 1.0, NVCAM_DEFAULT_CONTRAST,
          (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));

  g_object_class_install_property (gobject_class, PROP_SATURATION,
      g_param_spec_float ("saturation", "saturation",
          "property to adjust saturation value",
          0.0, 2.0, NVCAM_DEFAULT_SATURATION,
          (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));

  g_object_class_install_property (gobject_class, PROP_TNR_STRENGTH,
      g_param_spec_float ("tnr-strength", "TNR Strength",
          "property to adjust temporal noise reduction strength",
          0.0, 1.0, NVCAM_DEFAULT_TNR_STRENGTH,
          (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));

  g_object_class_install_property (gobject_class, PROP_TNR_MODE,
      g_param_spec_enum ("tnr-mode", "TNR mode",
          "property to select temporal noise reduction mode",
          GST_TYPE_NVCAM_TNR_MODE, NVCAM_DEFAULT_TNR_MODE,
          (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));

  g_object_class_install_property (gobject_class, PROP_EDGE_ENHANCEMENT,
      g_param_spec_float ("edge-enhancement", "edge enhancement",
          "property to adjust edge enhnacement value",
          0.0, 1.0, NVCAM_DEFAULT_EDGE_ENHANCEMENT,
          (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));

  g_object_class_install_property (gobject_class, PROP_CAPTURE_TRIGGER,
      g_param_spec_enum ("trigger", "capture trigger",
          "property to fire pre capture trigger",
          GST_TYPE_NVCAM_CAPTURE_TRIGGER, NVCAM_DEFAULT_CAPTURE_TRIGGER,
          (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));

  g_object_class_install_property (gobject_class, PROP_CAPTURE_INTENT,
      g_param_spec_enum ("intent", "capture intent",
          "property to select capture intent",
          GST_TYPE_NVCAM_CAPTURE_INTENT, NVCAM_DEFAULT_CAPTURE_INTENT,
          (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));

  g_object_class_install_property (gobject_class, PROP_SENSOR_ID,
      g_param_spec_int ("sensor-id", "Sensor ID",
          "Set the id of camera sensor to use. Default 0.)",
          0, G_MAXUINT8, DEFAULT_SENSOR_ID,
          (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));

  g_object_class_install_property (gobject_class, PROP_ENABLE_EXIF,
      g_param_spec_boolean ("enable-exif", "Enable Exif Data",
          "Return Exif data with captured frame",
          FALSE, (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));

  g_object_class_install_property (gobject_class, PROP_ENABLE_METADATA,
      g_param_spec_boolean ("enable-meta", "Enable meta data",
          "Return Sensor meta data with captured frame",
          FALSE, (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));

  g_object_class_install_property (gobject_class, PROP_BAYER_CAPTURE,
      g_param_spec_boolean ("dump-bayer", "Dump bayer data",
          "Dump raw bayer data in still capture mode.",
          FALSE, (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));

  g_object_class_install_property (gobject_class, PROP_AE_REGION,
      g_param_spec_boxed ("aeRegion", "Auto Exposure Region",
          "Property to set region of interest for auto exposure.\n"
          "\t\t\t Use GArray, with values of ROI coordinates (top,left,bottom,right)\n"
          "\t\t\t and weight in that order, to set the property.",
          G_TYPE_ARRAY, (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));

  g_object_class_install_property (gobject_class, PROP_WB_REGION,
      g_param_spec_boxed ("wbRegion", "White balance Region",
          "Property to set region of interest for white balance.\n"
          "\t\t\t Use GArray, with values of ROI coordinates (top,left,bottom,right)\n"
          "\t\t\t and weight in that order, to set the property.",
          G_TYPE_ARRAY, (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));

  g_object_class_install_property (gobject_class, PROP_FPS_RANGE,
      g_param_spec_string ("fpsRange", "FPS Range",
          "Property to set FPS range.\n"
          "\t\t\t Use string with values of FPS Range (low, high)\n"
          "\t\t\t in that order, to set the property.",
          DEFAULT_FPS_RANGE, (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));

  g_object_class_install_property (gobject_class, PROP_EXPOSURE_TIME,
      g_param_spec_float ("exposure-time", "Exposure Time",
          "Property to adjust exposure time.\n"
          "\t\t\t This property will have effect only when Exposure mode is Off.",
          0.0f, FLT_MAX, NVCAM_DEFAULT_EXPOSURE_TIME,
          (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));

  g_object_class_install_property (gobject_class, PROP_WB_MANUAL_MODE,
      g_param_spec_enum ("wbManualMode", "white balance manual mode",
          "Property to set manual mode of White balance.\n"
          "\t\t\t This property will have effect only when wbMode is manual.",
          GST_TYPE_NVCAM_WB_MANUAL_MODE, NVCAM_DEFAULT_WB_MANUAL_MODE,
          (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));

  g_object_class_install_property (gobject_class, PROP_WB_GAINS,
      g_param_spec_boxed ("wbGains", "White Balance Gains",
          "Property to set external white balance Gains.\n"
          "\t\t\t Use GArray, with values of WB gains (R, GR, GB, B)\n"
          "\t\t\t in that order, to set the property.\n"
          "\t\t\t This will have effect only when wbMode is manual.",
          G_TYPE_ARRAY, (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));

  g_object_class_install_property (gobject_class, PROP_AE_LOCK,
      g_param_spec_boolean ("aeLock", "AE Lock",
          "Property to lock auto exposure.",
          FALSE, (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));

  g_object_class_install_property (gobject_class, PROP_CALLBACKS,
      g_param_spec_pointer ("callback", "user callbacks",
          "Property to set user callback. It is required if user wants \n"
          "\t\t\t to change capture settings per frame. Provide address \n"
          "\t\t\t of GstNvCamSrcCallbacks type struct as value. \n",
          (GParamFlags) (G_PARAM_WRITABLE | G_PARAM_STATIC_STRINGS)));

  g_object_class_install_property (gobject_class, PROP_SURFACE_LAYOUT,
      g_param_spec_int ("surface-layout", "Surface Layout",
          "Set the surface layout. Default 0. (0=Blocklinear, 1=Pitch)",
          0, 1, DEFAULT_SURFACE_LAYOUT,
          (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));

  g_object_class_install_property (gobject_class, PROP_NUM_SENSORS,
      g_param_spec_boxed ("num-sensors", "Number of connected sensors",
          "Property to get number of sensors.\n"
          "\t\t\t Returns GArray containing number of sensors {usb,csi}\n",
          G_TYPE_ARRAY, (GParamFlags) (G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)));

  g_object_class_install_property (gobject_class, PROP_SENSOR_ORIENTATION,
      g_param_spec_int ("orientation", "Sensor orientation",
          "Sensor orientation value. This must be accessed after PAUSED state.",
          0, 360, DEFAULT_SENSOR_ORIENTATION,
          (GParamFlags) (G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)));

is there a way to change resolution of the onboard sensor when nvgstcapture is running?
by some reason with camsrc=1 it wont operate with resolutions
but with camsrc=2 it operates with resolutions but has null camera or so

Has anyone found a solution to the last post on this thread? I am using this type of video capture to capture images and need to find a way to adjust the exposure without restarting the pipe.

I tried using v4l2 but my camera doesn’t have absolute_exposure and the frame_length that it does have doesn’t have a low enough exposure time.

Please check argus_camera that should be support what you want.