From fef47412d5260075d541c492b8c9c08f6b7c5927 Mon Sep 17 00:00:00 2001 From: dchvs Date: Thu, 4 Mar 2021 00:34:39 -0600 Subject: [PATCH] documentation: Update README with AE --- README.md | 51 +++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 49 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0e8689c..19dc4b2 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ gst-launch-1.0 nvarguscamerasrc sensor-id=0 aelock=true awblock=true ! 'video/x- ### UDP Streaming Test #### Sender Endpoint ``` -gst-launch-1.0 nvarguscamerasrc ! 'video/x-raw(memory:NVMM), width=(int)1280, height=(int)720, format=(string)NV12,framerate=(fraction)30/1' ! omxh264enc control-rate=2 bitrate=8000000 ! 'video/x-h264, stream-format=(string)byte-stream' ! h264parse ! rtph264pay mtu=1400 ! udpsink host=$HOST_IP port=5000 sync=false async=false +gst-launch-1.0 nvarguscamerasrc ! 'video/x-raw(memory:NVMM), width=(int)1280, height=(int)720, format=(string)NV12,framerate=(fraction)60/1' ! omxh264enc control-rate=2 bitrate=8000000 ! 'video/x-h264, stream-format=(string)byte-stream' ! h264parse ! rtph264pay mtu=1400 ! udpsink host=$HOST_IP port=5000 sync=false async=false ``` #### Receiver Endpoint @@ -71,11 +71,58 @@ v4l2-ctl -d /dev/video0 --set-fmt-video=width=1280,height=720,pixelformat=RG12 - #### Slave ``` -v4l2-ctl -d /dev/video01 --set-fmt-video=width=1280,height=720,pixelformat=RG12 --set-ctrl bypass_mode=0 --stream-mmap +v4l2-ctl -d /dev/video1 --set-fmt-video=width=1280,height=720,pixelformat=RG12 --set-ctrl bypass_mode=0 --stream-mmap +``` + +### AE Synchronized +First run the master pipeline and then the slave pipeline: + +#### Master Pipeline +``` +gst-launch-1.0 nvarguscamerasrc sensor-id=1 ! 'video/x-raw(memory:NVMM), width=(int)1280, height=(int)720, format=(string)NV12,framerate=(fraction)60/1' ! fakesink +``` + +#### Slave Pipeline +``` +gst-launch-1.0 nvarguscamerasrc sensor-id=0 aelock=true awblock=true ! 'video/x-raw(memory:NVMM), width=(int)1280, height=(int)720, format=(string)NV12,framerate=(fraction)60/1' ! fakesink +``` + +### Run script +``` +./script_to_control_gain_exposure.sh & ``` ## Appends +#### Auto Exposure + +The AE controls realays in the feedback provided by the Driver's camera sensor to the nvarguscamerasrc libraries, +and the custom DTSIs with the sensor parameters definitions. +As the AE has interdependency with the digital gain. This gain it's and operation on the Driver, and follows this setup: + +```bash + /* + * Digital gain equation: + * + * RANGE: 1x, 7.97x + * GAIN: VAL / STEPS; + * STEPS: 1/32 + * + * SCALE FACTOR = 100.000 + * + * min_gain_val = 100.000 + * max_gain_val = 797.000 + * step_gain_val = 3125 + */ + + MT9M021 sensor datasheet: + * MT9M021 Developer Guide +``` + +Where, the min_gain_val, max_gain_val, step_gain_val are part of the cameras' DTSI (tegra186-tx2-spiri-camera.dtsi) fixed parameters +as per the datasheet. The step_gain_val consists of the steps (1/32 for the register) scaled to a value that makes this fraction become an significant +in integer. + #### Kernel Changes The Driver for the MT9M021 cameras consists on the following structure, that adds the DTB and Kernel sources, along with its Makefiles that lead its portability to a Kernel source.