IMX219 set sensor_mode

I’m using a Jetson Nano with a Raspberry Pi camera v2 (IMX219).

The sensor supports several modes and I want to switch the default sensor mode (0)

I use the command:
gst-launch-1.0 nvarguscamerasrc ! … ! … ! somesink

When I inspect the nvarguscamerasrc I do not see any options to set the sensor mode.

When I use nvgstcapture, I notice a different sensor mode is used (4), so apparently it ís possible.

Can someone tell me how I should be able to set this? Do I need to use another source than nvarguscamerasrc? I’m unable to find out what nvgstcapture uses under the hood.

hello TechnoM,

if you’re launching with gst-launch-1.0, the following given resolution will determine the sensor mode.
for example,

gst-launch-1.0 nvarguscamerasrc sensor-id=0 ! 'video/x-raw(memory:NVMM),width=1920, height=1080,
framerate=30/1, format=NV12' ! nvoverlaysink -ev

here are three sensor modes available,

GST_ARGUS: Available Sensor modes :
GST_ARGUS: 2592 x 1944 FR = 29.999999 fps Duration = 33333334 ; Analog Gain range min 1.000000, max 16.000000; Exposure
Range min 34000, max 550385000;

GST_ARGUS: 2592 x 1458 FR = 29.999999 fps Duration = 33333334 ; Analog Gain range min 1.000000, max 16.000000; Exposure
Range min 34000, max 550385000;

GST_ARGUS: 1280 x 720 FR = 120.000005 fps Duration = 8333333 ; Analog Gain range min 1.000000, max 16.000000; Exposure R
ange min 22000, max 358733000;

since gst-launch launching with 1920x1080, it will choose the closest resolution to match the request.

GST_ARGUS: Running with following settings:
   Camera index = 0
   Camera mode  = 1
   Output Stream W = 2592 H = 1458
   seconds to Run    = 0
   Frame Rate = 29.999999

please refer to Libargus Camera API for more details.
thanks

Hi Jerry,
Thanks for your reply.

Unfortunately, setting the resolution this way just crops the image from center. This results in an image that appears to be “zoomed in” and effectively I’m losing data this way (since the edge area is lost).

The log does tell me “Camera mode = 2”, so apparently it did set the sensor-mode correctly but perhaps I have a wrong expectation of what setting the sensor mode does.

I’m looking for the same image, but down-sampled to a lower resolution (preferably the down-sampling done on the camera).

edit: since your answer does provide the solution to setting the sensor mode, I’ll accept it as the answer.

Hi.
I have same user like TechnoM and I have similar question, too.
Do you know “Arducam 8M IMX219” is supportd the AE, AWB…?
Could you tell me the way to change AE, AWB… if you know…
Please :)
Thanks,

Hi Jay,

Please open a new topic for your issue. Thanks