How to clear camera buffer to eliminate delay?

We are running multiple perception models on 4 USB cameras.
There is a considerable delay of 3 seconds between the frame capture and the rendering of the processed image.
This is due to a buffer being created in the USB cameras.
The dwSensorCamera_readFrame() function grabs the image from the buffer and not the latest image, leading to a delay.
Is there a way to clear the buffer without reducing the frame rate or getting the latest frame directly from the camera instead of the buffer?

1 Like

nevermind, fixed it

Dear @Hassan0,
May I know what is the platfrom? This forum is for DRIVE AGX Orin platform. Also could you share the used solution and inputs to benefit others in the community.