Setting exposure time

I am using the FLIR Chameleon 3 (model: CM3-U3-31S4M-CS) running aravis on a raspberry pi 4. I am trying to acquire an image via usb with a set exposure time. I am unable to set the exposure time with aravis.

According to the documentation for my camera, the exposure time can be set anywhere from .011 ms to 32 seconds.

Here is part of my code:

    int acquire_frame()
    {
           double exposure_time = 76000; //in us

            ArvCamera *camera;
            ArvBuffer *buffer;
            
            GError *error = NULL;

            camera = arv_camera_new (NULL, &error);
            
            if (arv_camera_is_exposure_time_available (camera,
                                       &error))
                                       {
                                       printf("yes");
                                       }                 
            arv_camera_set_exposure_mode (camera,
                              arv_exposure_mode_from_string ("Timed"),
                              &error);
                
            arv_camera_set_exposure_time(camera, exposure_time, &error);

            printf("exposure: %f", arv_camera_get_exposure_time (camera,
                              &error)); 
            buffer = arv_camera_acquisition (camera, 0, &error);
            if (ARV_IS_BUFFER (buffer)){
                    printf ("Image successfully acquired\n");
                    FILE * fp;
                    fp=fopen("/home/pi/test.png", "r");
                    arv_save_png(buffer, "test.png");
            }else{
                    printf ("Failed to acquire a single image\n");
            }
            
            g_clear_object (&camera);
            g_clear_object (&buffer);

            return EXIT_SUCCESS;
    }

No matter what value I set exposure_time to, when i print the value with arv_camera_get_exposure_time(), the value is 17887.35

Interestingly, if I move the line:

printf("exposure: %f", arv_camera_get_exposure_time (camera,
                              &error));

to a line in the program AFTER the image is saved, the exposure time changes to 2392.53

This makes no sense to me since according to arv_camera_is_exposure_time_available(), I can set the exposure time, but I seem to have no control over it. When I viewed the acquired images, they were all equally overexposed, no matter what the value of exposure_time.

Any help is appreciated!!

On the documentation:

https://aravisproject.github.io/docs/aravis-0.8/ArvCamera.html#arv-camera-set-exposure-mode

It does not say " Since: 0.8.0" as many of the other functions. Does this mean the function is not supported?

Hi,

Did you try the viewer ? Did you check for errors ?

It should, like all the other functions where a GError placeholder was added in the 0.8 series.