Get GStreamer camera settings after initialization

Honey_Patouceul, thanks for the code. Like you mentioned, it seemed to work fine but it doesn’t return any information. Both gain and exposure returned 0.0.

miguel.taylor, thanks for the code as well. I was unable to get v4l2 to work properly. I kept getting errorno 22 on the arguments. This is probably because I have no idea where to find the kernel defined CID on the nano. However, this did point me in the right direction.

The v4l2-ctrl command in terminal is able to get camera settings in real time. This might be an inelegant solution, but in python, I can execute the command and capture its output.

import subprocess

def printCamSettings():
    print subprocess.check_output(['v4l2-ctl', '--get-ctrl', 'exposure']),
    print subprocess.check_output(['v4l2-ctl', '--get-ctrl', 'gain'])
>>> printCamSettings()
exposure: 90000
gain: 16

I manually set exposure time to 90 ms, so the output is in microseconds. I manually set both digital and analog gain to 1, so perhaps the gain output is scaled by 16. Putting this in a loop shows how the auto modes change the gain and exposure over time.