Hello all,
Looking for some help with optimizing my GigE camera software for controlling a B1921 Imperx camera (1952x1112). The goal of this software is to control camera functions in real-time (i.e. exposure, digital gain, frame rate, etc) and save images on command. After reading several prior posts on similar subjects, I wrote my code using a producer/consumer structure and saved the images in binary format. The images are saved when the boolean control (save frames) is triggered making both the queue block (producer loop) and save block (consumer loop) true. The images are dequeued from the queue and saved into a binary file. Once the file is opened successive frames are appended to the original binary file keeping all of the images in a single file.
I have notice that the software starts to lose frames when the frame rate exceeds 20 frames/sec (frames are saved onto a SSD). The max frame rate of the camera is 39 fps. I did check the jumbo packets size and the highest I can set it to is 9 kb. My test is to image a clock and count how many frames are collected in a given time. For example, if I run the camera at 10 frames/sec for 30 seconds, I should have 300 frames. Are there other computer/camera settings I need to modify to save at higher frame rates? Am I missing something in my code that might make saving images more efficient?
Attached is the code for your review. Any help is really appreciated!