Using v4l2 it was possible to make a gstreamer pipeline, access the source (v4l2src) and read the exposure and gain from there, doing something like this:
libcamerasrc doesn't expose any of this. Is there any way to get such information from a video? Output from gst-inspect libcamerasrc:
Even another program that could run in parallel to gstreamer would be a valid option, but libcamera seems to require exclusive access to the device. The only alternative I see is to analyze the images themselves to see how bright they are, but that's a lot of processing for a small parameter.
Code:
std::pair<int, int> get_exposure_and_gain(GstElement* camera_src) { int exposure = 0; int gain = 0; // Query exposure and gain from the camera source (libcamerasrc or v4l2src) g_object_get(camera_src, "shutter", &exposure, "gain", &gain, nullptr); return {exposure, gain};}
Code:
Pads: SRC: 'src' Pad Template: 'src'Element Properties: auto-focus-mode : Available options: AfModeManual, AfModeAuto or AfModeContinuous. flags: writable Enum "GstLibcameraAutoFocus" Default: 0, "manual-focus" (0): manual-focus - AfModeManual (1): automatic-auto-focus - AfModeAuto (2): continuous-auto-focus - AfModeContinuous Write only camera-name : Select by name which camera to use. flags: readable, writable, changeable only in NULL or READY state String. Default: null name : The name of the object flags: readable, writable String. Default: "libcamerasrc0" parent : The parent of the object flags: readable, writable Object of type "GstObject"
Statistics: Posted by chourizo — Wed Oct 23, 2024 3:17 pm